Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .cdecls C,LIST,"msp430.h"
- .def RESET
- .text
- .retain
- .retainrefs
- RESET: mov.w #__STACK_END, SP ; Initialize stackpointer
- StopWDT: mov.w #WDTPW | WDTHOLD, &WDTCTL ; Stop watchdog timer
- SetupP1: bis.b #1b, &P1DIR ; P1.0 output
- SetupC0: mov.w #CCIE, &CCTL0 ; CCR0 interrupt enabled
- mov.w #50000, &CCR0
- SetupTA: mov.w #TASSEL_2 | MC_2, &TACTL ; SMCLK, continuous
- Mainloop: bis.w #CPUOFF + GIE, SR ; CPU off, interrupts on
- nop
- TA0_ISR:
- xor.b #1b, &P1OUT ; Toggle P1.0
- add.w #50000, &CCR0 ; Add offset to CCR0
- reti
- .global __STACK_END
- .sect .stack
- .sect ".reset" ; MSP430 RESET Vector
- .short RESET
- .sect ".int09" ; Timer_A0 Vector
- .short TA0_ISR
- .end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement