I am running in standby mode which has the processor running at 10,000 Hz.
I think the watchdog is turned off. I have replaced every instance that I can find of a watchdog reset, or watchdog init with a watchdog hold.
I have the ACLK as 10000 / 32 = 312.5 Hz
I have the TA2 timer source as ACLK and divides it by 8 in TA2EXO Register giving 39.0625 Hz.
Then I divide it again by 8 in the TA2CTL register giving the counter clock about 4.882813 Hz.
So for an hour I have to count up to 3600 sec * 4.882813cy/sec = 17578. And generate the interrupt to wake up.
For testing I count up to 293 which is about 1 minute, because 1 hour is too long to wait for debugging. And the timing is not far off.
--------------------------
What is happening is it is resetting. And I am trying to figure out why.
After the reset it stops on the first line of my program where I have a breakpoint,
The registers
SYSCTL = 0
SYSBSLC = 0x8003
SYSBERRRIV = 0
SYSUNIV = 0
SYSSNIV = 0
SYSRSTIV = 10
I am not sure if the startup code wipees out any of that data and if it does how I can catch it before it does.
But SYSRSTIV is not 0 so that may be a clue.
All I can find is that is a "Security Violation (BOR)." in Section 1.15.10
So I did a search on Security Violation and found it on Figure 1-6 Operation Modes which feeds into the BOR. And those are the only two places the term "Security Violation" occur in the whole "MSP430x5xx and MSP430x6xx Family User's Guide" So I do not know what a security violation is or what causes it.
Since I have been having trouble with the Watchdog I thought maybe I messed up with a Watchdog timer Event change. But that appears to be a PUC system reset not a BOR system reset
In section 16.2 it says:
"Any write to WDTCTL with any value other than 05Ah in the upper byte is a password violation and triggers a PUC"
So the next thing I tried was to setup the interrupt so I could put a break when it happens to see if I can figure out where it happened.
#pragma vector=RESET_VECTOR __interrupt void Reset(void) { switch(__even_in_range(SYSRSTIV,0x22)) { case 0x00: // No interrupt pending break; case 0x02: // Interrupt Source: Brownout (BOR) (highest priority) break; case 0x04: // Interrupt Source: RST/NMI (BOR) break; case 0x06: // Interrupt Source: PMMSWBOR (BOR) break; case 0x08: // Interrupt Source: Wakeup from LPMx.5 (BOR) break; case 0x0A: // Interrupt Source: Security violation (BOR) break; case 0x0C: // Interrupt Source: SVSL (POR) break; case 0x0E: // Interrupt Source: SVSH (POR) break; case 0x10: // Interrupt Source: SVML_OVP (POR) break; case 0x12: // Interrupt Source: SVMH_OVP (POR) break; case 0x14: // Interrupt Source: PMMSWPOR (POR) break; case 0x16: // Interrupt Source: WDT time out (PUC) break; case 0x18: // Interrupt Source: WDT password violation (PUC) break; case 0x1A: // Interrupt Source: Flash password violation (PUC) break; case 0x1C: // Interrupt Source: Reserved break; case 0x1E: // Interrupt Source: PERF peripheral/configuration area fetch (PUC) break; case 0x20: // Interrupt Source: PMM password violation (PUC) break; } /* 00h = No interrupt pending 02h = Brownout (BOR) (highest priority) 04h = RST/NMI (BOR) 06h = PMMSWBOR (BOR) 08h = Wakeup from LPMx.5 (BOR) 0Ah = Security violation (BOR) 0Ch = SVSL (POR) 0Eh = SVSH (POR) 10h = SVML_OVP (POR) 12h = SVMH_OVP (POR) 14h = PMMSWPOR (POR) 16h = WDT time out (PUC) 18h = WDT password violation (PUC) 1Ah = Flash password violation (PUC) 1Ch = Reserved 1Eh = PERF peripheral/configuration area fetch (PUC) 20h = PMM password violation (PUC) 22h to 3Eh = Reserved */ }
And the IAR linker does not like it. And I can not figure out why.
IRQHandlers.c
Linking
Error[e16]: Segment RESET (size: 0x2 align: 0x1) is too long for segment definition. At least 0x2 more bytes needed. The problem occurred while processing the segment placement
command "-Z(CODE)RESET=FFFE-FFFF", where at the moment of placement the available memory ranges were "-none-"
Reserved ranges relevant to this placement:
ff80-ffff INTVEC
Error while running Linker
Looking in the .map file it says
Error[e16]: Segment RESET (size: 0x2 align: 0x1) is too long for segment definition. At least 0x2 more bytes needed. The problem occurred while processing the segment placement command "-Z(CODE)RESET=FFFE-FFFF", where at the moment of placement the available memory ranges were "-none-"
Reserved ranges relevant to this placement:
ff80-ffff INTVEC
Any ideas how to help?
Where can I find documentation on Security Violation?
Why does my Reset interrupt not work?
How do I find out what is causing the reset?