> swallen wrote:
>> WDT_A register is defined wrong per the datasheet ().
>> 
>> from the listing:
>> 00000150 l *ABS* 00000000 WDTCTL
>> 
>> from datasheet (SLAS612–SEPTEMBER 2008):
>> 
>> REGISTER BASE OFFSET
>> WDTCTL 0150h 0Ch (=0x15C)
>> 
>Yes, you are right. Wrong offset in wdt_a.h. Fixed in repository:
>http://mspgcc.cvs.sourceforge.net/viewvc/mspgcc/msp430-libc/include/msp430/wdt_a.h?r1=1.3&r2=1.4

It's not the only bug in wdt_a.h:

#define WDTPW               (0xA5<<8)

should read

#define WDTPW               (0x5A<<8)


Looks like the WDT is not often used ;)

Some thing I had to fix in the default startup code is the default disabling of 
the WDT. Of course copying the 
initialized data into RAM is a lot faster if you don't have to toggle the WDT 
in between, but it renders the WDT 
useless for any application where WTD resets might be cause by ESD influence - 
if the processor crashes again 
(due to continued ESD influence) while copying the data, the device will never 
recover until manual reset.

It took quite some time after starting with MSPs and mspgcc until I noticed 
that the WDT is silently disabled right 
after reset and all triggering of it was void. A wrong password together with a 
wrong register address wouldn't have 
changed anything ;)

Fixing the startup code suddenly showed up a LOT of timing problems in the 
current projects where the WDT was 
suddenly causing a reset.

JMGross


Reply via email to