Description
Teperature sensor sense the temperature and it will give corresponding analog output signal the signal read by the ADC and convert into a digital value and send it to microcontroller. In this circuit we display the corresponding value using LEDs
For further developments please contact sekharstuff@gmail.com
C program
#include
sbit CS=P1^0;
sbit READ=P1^1;
sbit WRITE=P1^2;
sbit INTR=P1^3;
//sfr MYDATA=P2;
void delay()
{
int i,j;
for(i=0;i<=1000;i++)
for(j=0;j<=10;j++);
}
void main()
{
unsigned char value;
P2=0xff;
INTR=1;
READ=1;
WRITE=1;
while(1)
{
WRITE=0; //take analog input
WRITE=1; //L to H
while(INTR==1); //INTR=0 end of conversion
READ=0; //read value into controller
value=P2;
// delay();
P3=value;
// delay();
READ=1;
}
}
Hex file
:0300000002003AC1
:0C003A00787FE4F6D8FD758107020020F5
:10000300E4FFFEE4FDFC0DBD00010CED640B4C7040
:0C001300F50FBF00010EBE03EABFE9E7D5
:01001F0022BE
:1000200075A0FFD293D291D292C292D2922093FD28
:0A003000C291AFA08FB0D29180EF13
:00000001FF