In SX Microcontrollers, SX/B Compiler and SX-Key Tool, g_daubach wrote: Will add this to the FAQ document in the future, but I think it makes sense posting it here in advance: For one of my customers, I have developed an SX28-based board with various functions. One task of the board is to communicate with an SHT11 humidity/temperature sensor. The SHT11 uses a 2-wire protocol which is similar to I²C with the exception that when you request the temperature/humidity reading, the SHT11 holds low the Data line as long as it performs the necessary conversion. For safety reasons, I have activated the watchdog timer in my application, and I have a clr !wdt instruction in my main loop that gets called often enough to keep the watchdog from barking (at least, this was what I thought). Since now, over 100 controller boards are out in the field, and all of them work without any flaws. For the next bunch of boards, I had ordered another lot of SHT11s, and while testing the boards with the sensors, about 20 of 100 sensors caused the board to reset when I tried to read the temperature. So, my first assumption was that there was something wrong with the new SHT11s, especially because they came with another lot number than the devices I bought before. It looked as if some of these devices caused a short on the power supply that made the board reset. Before contacting Sensirion concerning a problem with the SHT11s, I thought it might be an idea to test the SX program once again using the Debugger. To my surprise, when running my programm in debug mode, the problems reading temperature from the SHT11 were gone. This made me aware that the watchdog might cause my PIA, as it has to be turned off while in debug mode, and this was it: The new SHT11s I was using take a bit longer to convert a temperature reading - long enough to wake up the SX watchdog in my application, so it was the watchdog that caused the reset, not the SHT11. Adding another clr !wdt instruction inside the WaitConvert loop finally fixed the problem. It never happened while reading the humidity because the SHT11 does humidity conversions faster than temperature conversions. Conclusion: When using the watchdog timer, always make sure to keep it from barking as long as your program operates normally. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=144922 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)