I was incorrect on the last post when I said our blinking fizzbuzz would need to step down to the LPM1 in order to use the watchdog timer, other than using external crystal. The watchdog timer, like I’ve said on the last post, can be sourced from a low-powered internal oscillator (VLO) which actually still active at LPM3.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
On the ISR we should alternate between deactivating the button interrupt with the watchdog timer like this:
From Port1’s ISR:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
And here is from the watchdog timer’s ISR:
1 2 3 4 5 6 7 8 9 10 11
I’ve setup git repository for tracking my progress, you can refer to complete source code here. The sources was to be compiled only with msp430gcc. Need to modify some ISR attribute if you want to compile them in CCS (with Texas Instrument’s own C compiler) or IAR.
Some note regarding msp430gcc, the complete setup for the development environment is explained really well here. Except that for some distro without static lib available on its repo cougharchlinuxcough we will need to recompile some library like expat to get the static variant, just download expat source code. Configure with:
1 2 3
LDFLAGS to the lib folder before proceeding with msp430-gcc compilation just like described here:
1 2 3 4
Now I need to learn myself some PWM huft