Deleted code - replaced with post #3
Code deleted - replaced with post #3.
I printed out the Include File for the MSP430f2012 and all of the example files for Timer A. Found a number of errors in my approaches above (now deleted).
This is the present code:
#include “msp430x20x3.h”
;-------------------------------------------------------------------------------
ORG 0F800h ; Program Reset
;-------------------------------------------------------------------------------
RESET: MOV.W #0280h,SP ; Initialize stackpointer
StopWDT MOV.W #05A80h, 0120h ; Stop Watchdog
MOV.W #40, R15 ; Set delay count
SetupP1 BIS.B #001h,&P1DIR ; P1.0 output
SetTA: MOV.W #02A0h, &TACTL ; Set timer A control reg
BIS.B #CPUOFF+GIE, SR
NOP
;Interrupt Service Routines
Intov: ADD &TAIV, PC ; Add offset to PC
RETI ; Vector 0
RETI ; Vector 2
RETI ; Vector 4
RETI ; Vector 6
RETI ; Vector 8
TAovflw: DECD.W R15 ; Vector 10 Timer A overflow
JNZ IntOut
MOV.W #40, R15 ; Reload delay count value
XOR.B #001h,&P1OUT ; Toggle P1.0
IntOut: RETI
;-------------------------------------------------------------------------------
; Interrupt Vectors
;-------------------------------------------------------------------------------
ORG 0FFFEh
DW RESET
ORG 0FFF0h
DW Intov
END
Before I came to the above code I had an error that prevented the CPU from turning off. When I put a scope probe on pin2 I got a square wave of about 10 microseconds period. It was running in a loop.
When I corrected the error the CPU turned off, but does not subsequently wake up as the result of a TA Ovflw interrupt.
Ta Da! It’s working.
I did not enable the Timer Interrupt bit in the Timer Control Register -
MOV.W #02A2h, 0160h