View previous topic :: View next topic |
Author |
Message |
rudy
Joined: 27 Apr 2008 Posts: 167
|
DS1820 help |
Posted: Fri Apr 03, 2009 10:11 am |
|
|
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
|
|
Posted: Fri Apr 03, 2009 12:50 pm |
|
|
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
|
|
Posted: Fri Apr 03, 2009 2:38 pm |
|
|
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. |
|
|
|