View previous topic :: View next topic |
Author |
Message |
Guest
|
Problems with the pic16f877A exercise book code |
Posted: Sat Jun 05, 2004 11:36 pm |
|
|
Im useing the this code from the book
Code: |
#include <16f877A.h>
#include <ds1631.c>
#fuses HS,NOLVP,NOWDT,PUT
#use DELAY(clock=20000000)
#use RS232(BAUD=9600, XMIT=PIN_C6, RCV=PIN_C7)
void main(){
float value;
init_temp();
while(true){
value = read_full_temp();
value /= 100.0;
printf("%3.2f\n\r", value);
delay_ms(1000);
}
}
|
here is the snip of the output from the serial port
84.41
87.80
93.91
-31.79
-28.09
-26.29
I'm using pcm 3.182
Why cant it read temps over 100? |
|
|
RatFink
Joined: 01 May 2004 Posts: 49
|
oops |
Posted: Sun Jun 06, 2004 12:50 am |
|
|
oops |
|
|
MikeP
Joined: 07 Sep 2003 Posts: 49
|
|
Posted: Sun Jun 06, 2004 4:39 pm |
|
|
Nobody has any ideas about this problem..
Im thinking its the math in the ds1631.c driver file |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Jun 06, 2004 4:55 pm |
|
|
I once posted a modification of the DS1631 driver that lets
you see the raw data returned by the chip. You could try
this code and see if you're able to get the full range of
values out of the chip.
http://www.ccsinfo.com/forum/viewtopic.php?t=18743 |
|
|
|