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

DS1820 help

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



Joined: 27 Apr 2008
Posts: 167

View user's profile Send private message Send e-mail MSN Messenger

DS1820 help
PostPosted: Fri Apr 03, 2009 10:11 am     Reply with quote

Hi everyone.

I am using a single DS18B20 in my application, and it work fine, the problem is that suddenly, after reading the sensor, it shows wrong temperature, on the next reading cycle, it comes back to normal value.

I use lots of interruptions, Timer_0, Timer_1 and timer_2, and I am using CRC to check if the bytes are correct, driving me to suspicious that the DS1820 is not working properly.

Can anyone give me a help.

Regards;

Manoel.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Apr 03, 2009 12:50 pm     Reply with quote

If you believe that interrupts are disrupting the timing in your DS18B20
driver, then disable/enable global interrupts around the critical sections
of the DS18B20 driver. If you do this, the DS18B20 may start to work
again, but you may have excessive delays in your interrupt servicing.
You will need to consider these issues.
rudy



Joined: 27 Apr 2008
Posts: 167

View user's profile Send private message Send e-mail MSN Messenger

PostPosted: Fri Apr 03, 2009 2:38 pm     Reply with quote

Never mind,

I found the problem on CRC check routine.

Instead of this:
Code:
if(shift_reg==crc_value)crc_test=1;

I wrote this:
Code:
if(shift_reg=crc_value)crc_test=1;

Thanks anyway.

Regards.
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