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 support@ccsinfo.com

moving from PIC16F876 to PIC18F252

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



Joined: 15 Sep 2003
Posts: 36

View user's profile Send private message

moving from PIC16F876 to PIC18F252
PostPosted: Thu Jul 22, 2004 2:21 pm     Reply with quote

Hello,

Thank you for all your replies to my UART post, on another topic, I'm moving from PIC16F876 to a PIC18F252, I upgraded to PCH, I will use a 10Mhz osc, can someone please tell me how do I have to have the FUSES configured? what else should I change to my F876 programms?

Thank you
Peter
valemike
Guest







Not much change at all...
PostPosted: Thu Jul 22, 2004 3:16 pm     Reply with quote

Not much changes at all. I have the following #fuse statement on my app...(it uses a 4MHz clock though).

#include <18F252.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=4000000)

Same statements work on the 18F876 (with the appropriate #include of course).

Someone correct me if i'm wrong, but I believe you don't even need to use the "#device *=16" statement (that uses 16 bit pointers) for the 18f452 if you used them in the 876. heck, you don't even need to use the #separate statement either. A lot of good comes out of using the 18F stuff.
runtime



Joined: 15 Sep 2003
Posts: 36

View user's profile Send private message

PostPosted: Thu Jul 22, 2004 3:55 pm     Reply with quote

If I am going to use a 10MHz osc (ceramic osc with built in caps), should I configure the PLL 4 x clock to get it running at 40Mhz? what's best: to have it at plain 10Mhz or kick it to 40MHz?

Best Regards
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Thu Jul 22, 2004 6:35 pm     Reply with quote

I think you might have to do something to Timer0 if memory serves me correctly. It is now 16 bit but can be configured for 8 bit.
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Fri Jul 23, 2004 8:31 am     Reply with quote

If you have any registers defined you'll need to change the address of your defines. Check ALL of the timers to make sure you have them configured correctly. I haven't looked at the data sheet but make sure your I/O pins haven't moved around (like your serial or I2C pins). And check anything else I can't think of either. Rolling Eyes
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Fri Jul 23, 2004 9:02 am     Reply with quote

Seems like I remember they changed the LVP pin from B5 to B3 or vice versa. If you don't specify the NOLVP fuse then your program might hang if there is a change on the LVP pin
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