| 2850 |
dpurdie |
1 |
;*******************************************************************************
|
|
|
2 |
; MSP430x4xx Demo - Software Toggle P5.1
|
|
|
3 |
;
|
|
|
4 |
; Description; Toggle P5.1 by xor'ing P5.1 inside of a software loop.
|
|
|
5 |
; ACLK = n/a, MCLK = SMCLK = default DCO
|
|
|
6 |
;
|
|
|
7 |
; MSP430x4xx
|
|
|
8 |
; -----------------
|
|
|
9 |
; /|\| XIN|-
|
|
|
10 |
; | | |
|
|
|
11 |
; --|RST XOUT|-
|
|
|
12 |
; | |
|
|
|
13 |
; | P5.1|-->LED
|
|
|
14 |
;
|
|
|
15 |
; M.Buccini
|
|
|
16 |
; Texas Instruments, Inc
|
|
|
17 |
; September 2004
|
|
|
18 |
; Built with CCE for MSP430 Version: 1.00
|
|
|
19 |
;*******************************************************************************
|
|
|
20 |
.cdecls C,LIST,"msp430f412.h" ; Include device header file
|
|
|
21 |
|
|
|
22 |
;-------------------------------------------------------------------------------
|
|
|
23 |
.text ; Progam Start
|
|
|
24 |
;-------------------------------------------------------------------------------
|
|
|
25 |
RESET mov.w #300h,SP ; Initialize stackpointer
|
|
|
26 |
StopWDT mov.w #WDTPW+WDTHOLD,&WDTCTL ; Stop WDT
|
|
|
27 |
SetupP1 bis.b #002h,&P5DIR ; P5.1 output
|
|
|
28 |
;
|
|
|
29 |
Mainloop xor.b #002h,&P5OUT ; Toggle P5.1
|
|
|
30 |
Wait mov.w #050000,R15 ; Delay to R15
|
|
|
31 |
L1 dec.w R15 ; Decrement R15
|
|
|
32 |
jnz L1 ; Delay over?
|
|
|
33 |
jmp Mainloop ; Again
|
|
|
34 |
;
|
|
|
35 |
;-------------------------------------------------------------------------------
|
|
|
36 |
; Interrupt Vectors
|
|
|
37 |
;-------------------------------------------------------------------------------
|
|
|
38 |
.sect ".reset" ; MSP430 RESET Vector
|
|
|
39 |
.short RESET ;
|
|
|
40 |
|
|
|
41 |
.end
|