Hi,

I've had this one brewing for some time.

Looking at schemes for: AT90CAN128 & ATA6612C. Common variables
between chips: WDTCSR (WDTCR), WDTOE (WDCE), WDCE, WDE.
WDTCSR & WDTOE are included "For compatibility" in the CAN chip.

I include this in cold.asm. It should work with the two WDTs in the
chip series above as well as chips with no WDT at all:

.if defined(WDTCSR)
; There's a WDT, so we reset it as per the docs.
        in_     temp0, WDTCSR
        ori     temp0, (1<<WDCE) | (1<<WDE)
        out_    WDTCSR, temp0
        andi    temp0, ~(1<<WDE)
        out_    WDTCSR, temp0
.endif

If there is a third type of WDT then I'll think again.

IMHO this should be included in the boot-up code for all AVR8's. At the
end of the day, Aunty Atmel knows best and more about their chips than
any of us do, so if they say do it - just do it.

RIP Matthias Trute.

-- 
Regards,

Martin Nicholas.

E-mail: reply-2...@mgn.org.uk (Address will be valid throughout 2020).


_______________________________________________
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel

Reply via email to