I'm trying to port some code written for a PIC16F877 to a PIC18F4620. The statement in question is:
Code:
setup_counters(RTCC_EXT_L_TO_H, WDT_2304MS);
The parameter WDT_2304MS is specific to the '877 but NOT the'4620. What does the parameter 'WDT_2304MS' mean/do? The manual that I have (version 4 march 2007) just lists this as a parameter but doesn't explain its function. More importantly, how do I get this functionality ported to the 4620? Or do I even need to? The WDT base is 18ms for the '877; 4ms for the 4620. Both are being clocked at 20MHz.
My compiler version is PCWH 4.071
Thanks,
Duane
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
Posted: Thu Nov 20, 2008 1:45 am
Apart from what's written in a CCS C manual or found in the header files, it's a good idea to understand the underlying chip hardware before starting to write the code. Microchip datsheets are a valid source in this regard.
You'll find, that PIC18 family generally has the WDT period set by configuration bits (fuses) rather than a register. That's the reason, why you won't find an equivalent WDT setup function with this chip. The valid fuses tab shows the possible settings. A postscaler value of 512 would the setting next to the said 2304 ms with PIC16F.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum