Author |
Message |
Topic: lm35 temperature sensor |
evaang2003
Replies: 15
Views: 26696
|
Forum: General CCS C Discussion Posted: Mon Jun 22, 2009 8:11 pm Subject: lm35 temperature sensor |
hi, everybody, I finally found the problem.
I didn't include the #device ADC=10 into the file that I compile.
That's why I always get the wrong reading.
Thanks for everyone that have try to help me ... |
Topic: lm35 temperature sensor |
evaang2003
Replies: 15
Views: 26696
|
Forum: General CCS C Discussion Posted: Mon Jun 22, 2009 7:41 pm Subject: lm35 temperature sensor |
the complete code is only involve lcd driver and main function. plus some include header file as below:
#include <16f877a.h>
#device ADC=10
#use delay(clock=4000000)
#fuses XT, NOWDT ... |
Topic: lm35 temperature sensor |
evaang2003
Replies: 15
Views: 26696
|
Forum: General CCS C Discussion Posted: Mon Jun 22, 2009 3:54 am Subject: lm35 temperature sensor |
Hi, I now trying to use pic16f877a and lm35 to read temperature.
Below is the code written:
void main(void)
{
int16 temp_adc;
float temp;
setup_adc ... |
Topic: DS18S20 8 bit lcd |
evaang2003
Replies: 11
Views: 11273
|
Forum: General CCS C Discussion Posted: Thu Jun 18, 2009 9:23 pm Subject: DS18S20 8 bit lcd |
Another question, how do Dallas sense temperature?
From the black encapsulate head? |
Topic: DS18S20 8 bit lcd |
evaang2003
Replies: 11
Views: 11273
|
Forum: General CCS C Discussion Posted: Thu Jun 18, 2009 9:22 pm Subject: DS18S20 8 bit lcd |
I get the code from somewhere I think is www.vermontficks.org.
I can't recall it.
I try the code that you post.
The result give me 0.5 degree celcius.
I don't understand why.
Could it be my h ... |
Topic: DS18S20 8 bit lcd |
evaang2003
Replies: 11
Views: 11273
|
Forum: General CCS C Discussion Posted: Thu Jun 18, 2009 2:45 am Subject: DS18S20 8 bit lcd |
erm, please let me do the correction.
the
iTemperature = iDataIn / 1000
is actually
iTemperature = iDataIn / 2 |
Topic: DS18S20 8 bit lcd |
evaang2003
Replies: 11
Views: 11273
|
Forum: General CCS C Discussion Posted: Thu Jun 18, 2009 2:36 am Subject: DS18S20 8 bit lcd |
The code that have been modified is as follow:
void main ( void )
{
delay_ms ( 200 );
LCD_Init();
LCD_SetPosition ( LINE_1 + 0 );
pri ... |
Topic: DS18S20 8 bit lcd |
evaang2003
Replies: 11
Views: 11273
|
Forum: General CCS C Discussion Posted: Wed Jun 17, 2009 8:43 pm Subject: DS18S20 8 bit lcd |
Well, the lcd I use is lmb162hba.
I have solved the lcd display text problem already.
Now the problem I encounter is to get the correct temperature in degrees Celsius.
However, based on the main ... |
Topic: DS18S20 8 bit lcd |
evaang2003
Replies: 11
Views: 11273
|
Forum: General CCS C Discussion Posted: Wed Jun 17, 2009 12:20 am Subject: DS18S20 8 bit lcd |
This is because the lcd I use can only run in 8 bit.
That's why I'm very headache about it.
The schematic is for 4 bit lcd.
But the lcd driver I post is 8 bit.
Yet the program I write cannot wor ... |
Topic: change 4 bit to 8 bit lcd code |
evaang2003
Replies: 5
Views: 5259
|
Forum: General CCS C Discussion Posted: Tue Jun 16, 2009 10:27 pm Subject: change 4 bit to 8 bit lcd code |
well, i have included the
#fuses XT, NOPROTECT, NOPUT, NOWDT, NOBROWNOUT, NOLVP, NOCPD
and change the clock to 4 MHz.
However, it still can't run.
Why? |
Topic: DS18S20 8 bit lcd |
evaang2003
Replies: 11
Views: 11273
|
Forum: General CCS C Discussion Posted: Tue Jun 16, 2009 10:06 pm Subject: DS18S20 8 bit lcd |
hi, i am trying to do temperature sensor using ds18s20 and display it on 8 bit lcd module.
the pic i am using is 16f877a and below is the source code that i modified from a 4 bit lcd temperature se ... |
Topic: change 4 bit to 8 bit lcd code |
evaang2003
Replies: 5
Views: 5259
|
Forum: General CCS C Discussion Posted: Tue Jun 16, 2009 8:28 pm Subject: change 4 bit to 8 bit lcd code |
well, i have found hd44780 8 bit lcd driver.
however, the program i write do not display text.
can anybody tell me what's wrong?
the main() is the program i wrote while the rest of the fuction ... |
Topic: change 4 bit to 8 bit lcd code |
evaang2003
Replies: 5
Views: 5259
|
Forum: General CCS C Discussion Posted: Mon Jun 15, 2009 1:44 am Subject: change 4 bit to 8 bit lcd code |
Well, I use the 8 bit driver and change it into the following code.
However, it can't be compiled. Look at the bold one.
Why?
void main ( void )
{
char LINE1 char LINE2
delay_ms ... |
Topic: change 4 bit to 8 bit lcd code |
evaang2003
Replies: 5
Views: 5259
|
Forum: General CCS C Discussion Posted: Sun Jun 14, 2009 7:38 pm Subject: change 4 bit to 8 bit lcd code |
Hi, I'm trying to change the following code to suit my 8 bit lcd.
Can anybody show me?
This is the code using ds1820 to display temperature on 4 bit lcd.
/************************************* ... |
|