;******************************************************************************* ; MSP430G2xx1 Demo - Software Poll P1.4, Set P1.0 if P1.4 = ; ; Description: Poll P1.4 in a loop, if hi P1.0 is set, if low, P1.0 reset ; ACLK = n/a, MCLK = SMCLK = default DCO ; ; MSP430G2xx1 ; ; /|\| XIN|; | | | ; |RST XOUT|; /|\ | | ; o |P1.4 P1.0| >LED ; \|/ ; ; D Dang ; Texas Instruments Inc ; October 2010 ; Built with IAR Embedded Workbench Version: 5.10 ;******************************************************************************* #include "msp430g2231.h" ; ORG 0F800h ; Program Reset ; RESET mov.w #0280h,SP ; Initialize stackpointer StopWDT mov.w #WDTPW+WDTHOLD,&WDTCTL ; Stop WDT SetupP1 bis.b #001h,&P1DIR ; P1.0 output ; 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