Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 3 > Interfacing psoc with thermocouple

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Interfacing psoc with thermocouple
Moderator:
RKRM

Post Reply
Follow this topic



Interfacing psoc with thermocouple

isha posted on 08 Jul 2010 10:17 AM PST

1 Forum Post

 my basic aim is to interface thermocouple with psoc. I have accomplished the reference junction temp measuring using temp sensor which is working perfectly but regarding the measuring jn, i have used the INSAMP along with ADCINCVR and m trying to display the adc counts on lcd. The latter part is nt being implemented. Below is my source c file and the design file view is also attached:

 

#include <m8c.h>        // part specific constants and macros

#include "PSoCAPI.h"    // PSoC API definitions for all User Modules

void main(void)

{

   int a,b,c,d,e,f,i,g,h,sum,sum1,p,q;

   double display,reading;

   double volt,temp;

    

    M8C_EnableGInt;                     // Enable global interrupts  

    PGA_SetGain(PGA_G8_00);  

    PGA_Start(PGA_HIGHPOWER);

INSAMP_Start(INSAMP_HIGHPOWER); 

INSAMP_SetGain(INSAMP_G16_0);

 

ADCINCVR_Start(ADCINC_HIGHPOWER);         

   ADCINC_GetSamples(0);                    

   ADCINCVR_SetResolution(10);          

LCD_Init(); 

LCD_Start();                  // Initialize LCD  

     LCD_Position(0,2);            // Place LCD cursor at row 0, col 2.  

     LCD_PrCString("Temparature");         

     ADCINCVR_1_Start(ADCINCVR_HIGHPOWER); // Turn on Analog section  

     ADCINCVR_1_SetResolution(10);         // Set resolution to 10 Bits  

     ADCINCVR_1_GetSamples(0);             // Start ADC to read continuously  

         

for(;;)  

{  

sum=0;

       for(i=0;i<10;i++)

{               

while(ADCINCVR_fIsDataAvailable() == 0); // Wait for data to   

                                                 // be ready.  

        a = (ADCINCVR_iGetData()+512);    // Get Data  

        sum=sum+a;

ADCINCVR_ClearFlag(); 

}

display=sum/10;

f=display*(.033)+13.2325;

g=f/1000;

b=(f/100)%10;

c=(f/10)%10;

d=(f%100)%10;

e=sum%10;

LCD_Position(1,2);

LCD_PrHexByte(16*g+g);

 

LCD_Position(1,3);

LCD_PrHexByte(16*b+b);

LCD_Position(1,4);

LCD_PrHexByte(16*c+c);

LCD_Position(1,5);

LCD_PrHexByte(16*d+d);

LCD_Position(1,6);

LCD_PrCString(".");

LCD_PrHexByte(16*e+e);

LCD_Position(1,8);

LCD_PrCString("C ");

 

 

sum1=0;

       for(i=0;i<10;i++)

  {    

while(ADCINCVR_1_fIsDataAvailable() == 0); // Wait for data to   be ready.   

 

        p= (ADCINCVR_iGetData()+ 512 );    // Get Data  

        sum1=sum1+p;

ADCINCVR_1_ClearFlag();              

}

reading=sum1/10;

q=reading;

LCD_Position(0,2);

LCD_PrHexInt(q);

 }

}

 

 

 

 




Re: Interfacing psoc with thermocouple

graaja posted on 29 Oct 2010 04:29 PM PST
Top Contributor
41 Forum Posts

Try application note AN2148.  That has all the code to implement a thermocouple measurement.

Best Regards

Ganesh






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: KXP; Secondary Owner: VWA; Sunset Date: 01/01/20