CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

setup-counter() question

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Core2



Joined: 27 Sep 2008
Posts: 22

View user's profile Send private message

setup-counter() question
PostPosted: Thu Nov 20, 2008 12:37 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Nov 20, 2008 1:45 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group