CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Problems with the pic16f877A exercise book code

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Guest








Problems with the pic16f877A exercise book code
PostPosted: Sat Jun 05, 2004 11:36 pm     Reply with quote

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

View user's profile Send private message

oops
PostPosted: Sun Jun 06, 2004 12:50 am     Reply with quote

oops
MikeP



Joined: 07 Sep 2003
Posts: 49

View user's profile Send private message

PostPosted: Sun Jun 06, 2004 4:39 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Jun 06, 2004 4:55 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group