In SX Microcontrollers, SX/B Compiler and SX-Key Tool, g_daubach wrote: Bean, I have carefully studied the SX 28 datasheet but could not find any information wether writing to the OPTION register resets the prescaler or not. I think, in "real life", this is nothing we need to be concerned about anyway. Usually, the OPTION register would be setup in the application's initialization section. There, it will be defined if the prescaler shall be used for the watchdog or for the RTCC, and what divide-by factor shall be used (if any). I usually write to the OPTION register at the very beginning of my applications, disabling the RTCC roll-over interrupt, then do aother initializations, like clearing the RAM, setting up the port configurations, etc. This makes sure that no interrupt occurs while variables and ports are not yet hplding defined states. Finally, before entering the main loop, I enable RTCC roll-over interrupts when the application shall make use if it with an ISR. Somehow, it would be logical if the prescaler were cleared to make sure a "clean" start when OPTION is modified. In case this is not so, the first call of the ISR might be out of timing, where all subesquent calls would be fine - IMO not a big problem at all. So, unless you plan to write some "tricky" application that modifies the OPTION register during "normal" program execution, e.g. to temporarily disable the RTCC intreerupt, it does not matter what happens to the prescaler. Finally, I think the only way to really find out if the prescaler is cleared or not during OPTION writes is to write a test application. Let me try to do that, and I'll report the results later. In case, someone already did this, please bail in. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=84910#m85107 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)