MSP430 Tests

Port Tests

\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
\ P1.3 Port test
\ Using Mecrisp-Across on A F4 Disco Host, target = MSP430G2201IRSA16R
\ Set P1.3 high with internal pullup and read  P1 to confirm P1.3 is high.
\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\


\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
\  GPIO 1 ports are numbered P1.0 - P1.7
\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

\ Read power up defaults, note may vary with floatting pins etc
\ P1IN c@ pbb 00000000 ok.
\ P1OUT c@ pbb 11111110 ok.
\ P1DIR c@ pbb 00000000 ok.
\ P1IFG c@ pbb 00000000 ok.
\ P1IES c@ pbb 11111111 ok.
\ P1IE c@ pbb 00000000 ok.
\ P1SEL c@ pbb 00000000 ok.
\ P1REN c@ pbb 00000000 ok.


\ Pullup/Pulldown Resistor Enable
\ -------------------------------
\ .2.4 Pullup/Pulldown Resistor Enable Registers PxREN
\ 
\ Each bit in each PxREN register enables or disables the pullup/pulldown resistor of the corresponding I/O
\ pin. The corresponding bit in the PxOUT register selects if the pin is pulled up or pulled down.
\ 
\ Bit = 0: Pullup/pulldown resistor disabled
\ Bit = 1: Pullup/pulldown resistor enabled

\ Resistor UP or Down ?
\ ---------------------
\ If the pin's pullup/pulldown resistor is enabled, the corresponding bit in the PxOUT register selects pullup
\ or pulldown.
\ 
\ Bit = 0: The pin is pulled down
\ Bit = 1: The pin is pulled up


\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
\  Set up P1-3 as high in input mode using a internal pullup
\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

\ Enable P1.3 Pullup/pulldown resistor
1 3 lshift P1REN c!

\ Select P1.3 resistor as pull up
1 3 lshift P1OUT c!


\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
\  Test P1.3
\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

\ Read P1 input register
P1IN c@ bin8.

\ ----->   P1IN c@ bin8. 00001000 ok.