Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. .cdecls C,LIST,"msp430.h"
  2.  
  3. .def RESET
  4. .text
  5. .retain
  6. .retainrefs
  7.  
  8. RESET: mov.w #__STACK_END, SP ; Initialize stackpointer
  9. StopWDT: mov.w #WDTPW | WDTHOLD, &WDTCTL ; Stop watchdog timer
  10. SetupP1: bis.b #1b, &P1DIR ; P1.0 output
  11. SetupC0: mov.w #CCIE, &CCTL0 ; CCR0 interrupt enabled
  12. mov.w #50000, &CCR0
  13. SetupTA: mov.w #TASSEL_2 | MC_2, &TACTL ; SMCLK, continuous
  14.  
  15. Mainloop: bis.w #CPUOFF + GIE, SR ; CPU off, interrupts on
  16. nop
  17.  
  18. TA0_ISR:
  19. xor.b #1b, &P1OUT ; Toggle P1.0
  20. add.w #50000, &CCR0 ; Add offset to CCR0
  21. reti
  22.  
  23. .global __STACK_END
  24. .sect .stack
  25.  
  26. .sect ".reset" ; MSP430 RESET Vector
  27. .short RESET
  28. .sect ".int09" ; Timer_A0 Vector
  29. .short TA0_ISR
  30. .end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement