I am working with G120HDR and implemented Watchdog in my code in accordance with:
When trying to set the timeout in ‘Watchdog.Enable(timeout)’ to 30 secs to prevent the board from restarting when trying to reprogram it, I get an exception saying that the MAX_TIMEOUT has been exceeded. Setting a break point and examining it, I found out that it’s approx. 16 secs.
A CTRL+MouseClick revealed the following:
// Maximum supported timeout.
// Value is platform dependant.
According to LPC178x/7x datasheet:
7.30 Windowed WatchDog Timer (WWDT)
• Selectable time period from (Tcy(WDCLK) x 256 x 4) to (Tcy(WDCLK) x 2^24 x 4) in
multiples of Tcy(WDCLK) x 4.
• The Watchdog Clock (WDCLK) source is a dedicated watchdog oscillator, which is
always running if the watchdog timer is enabled.
22.214.171.124 Watchdog oscillator
The Watchdog Timer has a dedicated watchdog oscillator that provides a 500 kHz clock to
the Watchdog Timer.[/quote]
So the max time period = 1/500KHz x 2^24 x 4 = 134.2177 secs
Does the code GHI.Premium.Hardware.LowLevel.Watchdog know the platform it’s running on? Should I specify it some where?
Could it be that the MAX_TIMEOUT constant is possibly calculated wrong?
Thanks in advance.