leebr 0 Posted March 4, 2019 Share Posted March 4, 2019 Hi, I am developing a monitor that will wake up every 15 minutes read and sensor and send some data. I'm using an EXP430G2 onto which I have successfully soldered the 32KHz crystal. The interrupts are working OK, waking every 16 seconds and toggling a LED. I'm using TACTL = TASSEL_1 +ID_3 + MC_2 +TAIE and Timer0-A1. My problem occurs whenever I try to use either the serial port (using Serial.print) or the AirBooster Pack. Then nothing happens - the system freezes. I'm assuming this has something to do with use of interrupts by the Serial and Airbooster libraries but I have no idea what. Any pointers on how to resolve this much appreciated. (Note serial and airbooster work fine when not using interrupts) Cheers brian Quote Link to post Share on other sites
JRDavisUF 5 Posted March 18, 2019 Share Posted March 18, 2019 Just curious, are you trying to do the Serial.print inside the interrupt? Somewhere in the documentation it says you shouldn't do that. What I do, is use and "Event" variable to trigger something time consuming (e.g., Serial writes) outside of the ISR. So something like this: #include "Event.h" Event SampleTaken; volatile (datatype) SampleValue; setup: setup/start timer SampleTaken.begin(); loop: SampleTaken.waitFor(); print SampleValue; ISR: Grab SampleValue; SampleTaken.send(); jrd 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.