\ Program Name: lp-blinky.fs \ Date: Tue Nov 2018 \ Copyright 2018 t.porter , licensed under the GPL \ For Mecrisp-Across by Matthias Koch \ http://mecrisp.sourceforge.net/ \ chip: MSP430G2452 \ Current consumption (when not driving leds) \ Word Description Power Usage (idle - uA) Power Reduction % \ ====== ========================================================================================================================= ======================= ========================= \ none Quiescent: No low power mode in use 2500 0 \ LPM0 CPU and MCLK are shutoff. SMCLK and ACLK remain active. 302 87.92 \ LPM1 CPU and MCLK are off, as in LPM1, but DCO and DC generator are disabled if the DCO is not used for SMCLK. ACLK is active. 302 87.92 \ LPM2 CPU, MCLK, SMCLK and DCO are disabled, while DC generator is still enabled. ACLK is active. 26.41 98.9436 \ LPM3 CPU, MCLK, SMCLK, DCO and DC generator are disabled. ACLK is active. 1.03 99.9588 \ LPM4 CPU and all clocks disabled 0.21 99.9916 new +jtag target : off 0 p1out c! ; : red 1 p1out c@ or p1out c! ; : green $40 p1out c@ or p1out c! ; : delay 65535 0 do loop ; : delay1 0 do delay loop ; : blink eint \ enable interrupts 8mhz \ use the 8Mhz clock $41 p1dir c! \ initialise Port 1, bits 1 and 6 as outputs 5 0 do \ loop 5 times red 3 delay1 \ red led on, then delay for 3*65535 cycles off 3 delay1 \ turn all leds off the delay green 3 delay1 off 3 delay1 loop 300 delay1 \ measure the quiescent current red green 3 delay off lpm4 ; \ activate low power mode 4, the most frugal mode of all \ measure the LPM4 current after red and green leds flash together host \ $FFFE vector blink crosscompile flashtarget -jtag run \ 254 bytes