Apr 9, 2014

MSP430-INTERNAL PULL DOWN

Digital input with INTERNAL PULL DOWN in “P1.4”

      .include "msp430g2x31.inc"
      org 0xf800                           
      mov.w #(WDTPW|WDTHOLD), &WDTCTL
      mov.b #0x10, P1REN
      CLR.B P1OUT
      CLR R5  
      mov.b #0x1, &P1DIR 
               
L1:   MOV.b &P1IN,  r5
      AND.b #0x10,r5
      tst r5
      JZ L1
      mov.b #0x41, &P1OUT     
L3:   jmp L3
      org 0xfffe
      dw 0xf800