View previous topic :: View next topic |
Author |
Message |
runtime
Joined: 15 Sep 2003 Posts: 36
|
moving from PIC16F876 to PIC18F252 |
Posted: Thu Jul 22, 2004 2:21 pm |
|
|
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... |
Posted: Thu Jul 22, 2004 3:16 pm |
|
|
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
|
|
Posted: Thu Jul 22, 2004 3:55 pm |
|
|
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
|
|
Posted: Thu Jul 22, 2004 6:35 pm |
|
|
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
|
|
Posted: Fri Jul 23, 2004 8:31 am |
|
|
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. |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Fri Jul 23, 2004 9:02 am |
|
|
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 |
|
|
|