From 50ed8de458ff83f3549f602364ca05c9fe66f8a0 Mon Sep 17 00:00:00 2001 From: flabbergast Date: Wed, 25 Sep 2019 20:45:48 +0100 Subject: [PATCH] MSP430: Add basic pin test for G2553. --- msp430/g2553/test-launchpad-basic.fs | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 msp430/g2553/test-launchpad-basic.fs diff --git a/msp430/g2553/test-launchpad-basic.fs b/msp430/g2553/test-launchpad-basic.fs new file mode 100644 index 0000000..46e4c8f --- /dev/null +++ b/msp430/g2553/test-launchpad-basic.fs @@ -0,0 +1,37 @@ +\ MSP430G2553 Launchpad-specific words + +include basis-g2553.fs + +compiletoflash + +: init init + 8 $21 cbis! \ High (P1OUT) + 8 $27 cbis! \ Pullup for button (P1REN) + %11110001 $21 cbic! \ all free P1 pins low (P1OUT) + %11110001 $22 cbis! \ all free P1 pins are outputs (P1DIR) + %00111111 $29 cbic! \ all free P2 pins low (P2OUT) + %00111111 $2A cbis! \ all free P2 pins are outputs (P2DIR) +; + +: blink \ all free pins + begin + %11110001 $21 cbis! + %00111111 $29 cbis! + 700 ms + %11110001 $21 cbic! + %00111111 $29 cbic! + 700 ms + key? until ; + +: button? + 8 $20 cbit@ + ; + +: button + begin + 1 $21 button? if cbic! else cbis! then + 20 ms + key? until ; + + +compiletoram