Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "msp430g2231.h"
- ;-------------------------------------------------------------------------------
- ORG 0F800h ; Program Reset
- ;-------------------------------------------------------------------------------
- RESET mov.w #0280h,SP ; Initialize stackpointer
- StopWDT mov.w #WDTPW+WDTHOLD,&WDTCTL ; Stop WDT
- SetupPx bis.b #01h,&P1DIR ; P1.0 output
- bic.b #01h,&P1OUT ; P1.0 output
- bis.b #018h,&P1IE ; P1.4 Interrupt enabled
- bis.b #018h,&P1IES ; P1.4 hi/low edge
- bic.b #018h,&P1IFG ; P1.4 IFG Cleared
- ;
- Mainloop bis.w #LPM4+GIE,SR ; LPM4, enable interrupts
- nop ; Required only for debugger
- tgl xor.b #01h,&P1OUT
- wait mov #5000h,R4
- dd dec R4
- jnz dd
- jmp tgl
- P1_ISR and.b #010h,&P1IFG
- jnz off
- bic.w #LPM4,0(SP)
- reti
- off bic.b #010h,&P1IFG ; P1.4 IFG Cleared
- bic.b #01h,&P1OUT ; P1.0 output
- mov.w #Mainloop,2(SP)
- reti ; Return from ISR
- ORG 0FFFEh ; MSP430 RESET Vector
- DW RESET ;
- ORG 0FFE4h ; P1.x Vector
- DW P1_ISR ;
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement