I have an MP3 development board I picked up from sparkfun that runs off the LPC2148 ARM processor. In looking through the code, I see a function to force a watchdog reset. My question is, how do you figure out what values to feed to the watchdog register? I looked through the LPC2148 data sheet and couldn't figure it out. I don't just want to use other people's code, I want to understand why they did what they did and how they figured out what to do.
|
2
|
|
|
|
|
2
|
From the LPC23XX datasheet, should be the same for LPC2148 ::
|
||
|
|
|
1
|
This is the code I use for an LPC2148: WDTC = 0x00000FFF; // very short timeout WDMOD = 0x03; // watchdog resets CPU WDFEED = 0xAA; // start watchdog WDFEED = 0x55; |
|||
|
|
|
1
|
You need the User Manual! You won't find that stuff in the data sheet. What don't you understand about my code? It's commented. |
|||
|
|
1
|
Leon: that's the code I'm using. The thing is that I don't want to just use other people's code without understanding why it's being used. I understand the code just fine. What I don't understand is where the numbers came from. Malkocoglu: is there a master NXP ARM datasheet I'm not seeing that tells you these things? How would I know to look in the LPC23XX datasheet, or is it just something you happen across? EDIT: I found the actual user manual. All my searches before were just giving me the data sheet, the site for the kit that I was using just had the data sheet, and I wasn't aware that there was a user manual. I didn't realize that the data sheet and user manual were separate, now I get it. Thanks for the help! |
|||
|
|
1
|
0xAA and 0x55 are often used in this sort of code which affects an application in a big way, as they are unlikely to be encountered during normal code execution. You'll find the LPC2000 Yahoo group very useful for this sort of question. It has over 8,000 members! |
||
|
|
|
0
|
It sounds like you're trying to force a watchdog reset, not keep the watchdog from resetting you. This is accomplished by a misfeed: feeding the watchdog 0xaa followed by a value OTHER than 0x55. Example:
|
||
|
|
