;******************************************************************************* ; MSP430F20xx Demo - Poll P1 With Software with Internal Pull-up ; ; Description: Poll P1.4 in a loop, if hi P1.0 is set, if low, P1.0 reset ; Internal pullup enabled on P1.4 ; ACLK = n/a, MCLK = SMCLK = default DCO ; ; MSP430F20xx ; ; /|\| XIN|; | | | ; |RST XOUT|; /|\ | R | ; o | P1.4-o P1.0| >LED ; \|/ ; ; M Buccini / L Westlund ; Texas Instruments Inc ; September 2005 ; Built with IAR Embedded Workbench Version: 3.40A ;******************************************************************************* #include "msp430x20x3.h" ; ORG 0F800h ; Program Reset ; RESET mov.w #0280h,SP ; Initialize stackpointer StopWDT mov.w #WDTPW+WDTHOLD,&WDTCTL ; Stop WDT SetupP1 mov.b #001h,&P1DIR ; P1.0 output, else input mov.b #010h,&P1OUT ; P1.4 set, else reset bis.b #010h,&P1REN ; P1.4 pullup Mainloop bit.b jc #010h,&P1IN ON ; P1.4 hi/low? ; jmp > P1.4 is set ; OFF bic.b #001h,&P1OUT ; P1.0 = / LED OFF jmp Mainloop ; ON bis.b #001h,&P1OUT ; P1.0 = / LED ON jmp Mainloop ; ; ; ; Interrupt Vectors ; ORG 0FFFEh ; MSP430 RESET Vector DW RESET ; END