// LCD module connectionschar OW_val;
sbit LCD_RS at P0_2_bit;
sbit LCD_EN at P2_3_bit;
sbit LCD_D4 at P2_4_bit;
sbit LCD_D5 at P2_5_bit;
sbit LCD_D6 at P2_6_bit;
sbit LCD_D7 at P2_7_bit;// End LCD module connections
sbit OW_Bit1 at P1_0_bit;
sbit OW_Bit2 at P1_1_bit;
sbit OW_Bit3 at P1_2_bit;
sbit OW_Bit4 at P1_3_bit;
sbit OW_Bit5 at P1_4_bit;
sbit OW_Bit6 at P1_5_bit;
sbit OW_Bit7 at P1_6_bit;
sbit OW_Bit8 at P1_7_bit;char txt3[]="Jordan university";char txt4[]="of science";char txt5[]="and technology";void main(){
Lcd_Init();// Initialize LCD
Lcd_Cmd(_LCD_CLEAR);// Clear display
Lcd_Cmd(_LCD_CURSOR_OFF);// Cursor off
LCD_Out(1,1,txt3);// Write text in first row
LCD_Out(2,3,txt4);// Write text in second row
Delay_ms(1000);
Lcd_Cmd(_LCD_CLEAR);
LCD_Out(1,2,txt5);
Delay_ms(1000);
Lcd_Cmd(_LCD_CLEAR);
OW_val = OW_read(0);
LCD_Out(1,1,OW_val);}
the program shows me error with the OW_read() I think it's not a valid command, and I don't know how can I read the input bits on the input pins to be shown on the LCD in Celsius.
here is my ckt:
Thanks gelectron and arunsharma0731..
I kinda know how ADC works and I am fine when it comes to LCD 8051 interfacing, but what really concerns me is how can I define the input to the microcontroller for example telling the microcontroller that the temperature is 27 C degree ??
Where is your Code for ADC read ?
How to convert it (LM35 values ) to ASCI
The LM35 has a scale factor of 10mV per 1oC, so the range of temperature set was between 0 oC and 100 oC. The LM35 would give a total output voltage 1v since every degree has a value of 10mv and so a range of 0 to 1V. This means that when the temperature is 0 oC then the output voltage is 0V. At 100 oC * 10mV = 1V (o/p voltage).
Well !! do the ADC_read statement work with 8051 (I know that it doesn't has an internal A/D converter ??) ? and if it is work how can I read all the inputs from P1.0 to P1.7 and write a code to combine these bits and convert them to decimal value. I think there's a lack of info's and examples about 8051 microcontroller on the web...
No there is no ADC in 8051 and there is no ADC read function in mikroC 8051. You have to write your own ADC read routine if you use 8051 and some adc like 0804 or 0809.
Can anybody give me any example about how to write this routine ??? or how even to start this as I don't know anything but the ADC_read() to read the input pins for a certain microcontroler....
Thanks all...