Optronik 0 Posted March 26, 2015 Share Posted March 26, 2015 I am currently working on a project that uses the external crystal for the watchdog timer and the internal DSO clock for all other tasks. The crystal is 32kHz. The watchdog timer interrupt is taking care of controlling the state machine in the main loop. At first sight everything looks ok. However, after a while (hours later) the controller (MSP430G2553) appears to be stuck. Closer investigation show that this is due to the watchdog timer interrupt not served, means that the 32Khz clock is not present. I already tried to play with the XTAL capacitor settings to no effect. I am wondering if scope measures could be done in order to see if there is something ongoing in the clock circuit that could point to an issue with the XTAL capacitors, driver circuit, parasitics, etc. However, I do not know what exactly to look for. Can anyone help me here? Quote Link to post Share on other sites
spirilis 1,265 Posted March 26, 2015 Share Posted March 26, 2015 One thing you can do is implement the IRQ for that - an ISR for the NMI_VECTOR interrupt vector. You need to set the OFIE bit in IE1 to activate the interrupt handler for that fault, then check OFIFG in the ISR itself and do something appropriate to signal it as such. If that ISR never fires, then something weird is going on... i.e. the MSP430 isn't detecting the XTAL stopping. I thought the MSP430 is supposed to fail-safe back to the VLOCLK when that happens, but I might be wrong about that. Your NMI_VECTOR handler code could do it manually I guess (set/clear appropriate BCSCTL3 bits to set ACLK=VLO). Quote Link to post Share on other sites
Optronik 0 Posted March 26, 2015 Author Share Posted March 26, 2015 I will try that. The fall back does probably not happen because ACLK is used with the crystal. The fall back seems only happen for MCLK. Quote Link to post Share on other sites
zeke 693 Posted April 1, 2015 Share Posted April 1, 2015 One quick way of testing an external crystal is to freeze it and see how well it recovers. To freeze it quickly, I use Canned Air turned upside down. This will release the liquid propellant which happens to come out at some ridiculously low temperature like -70'C. Frozen condensation will appear rapidly on whatever you spray it at so be selective. In my experience, never has this condensation damaged a circuit that I was testing. For added torture, get out your hot air gun and heat that crystal a minute after you've frozen it with the cold spray. Quote Link to post Share on other sites
rockets4kids 204 Posted April 2, 2015 Share Posted April 2, 2015 Are you checking for an oscillator fault condition in software? Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.