Moving from PIC18F1330 to 18F4331 Int. Osc Issue...

Status
Not open for further replies.

bsodmike

New Member
I just ported some code over, and made the necessary adjustments for pin changes etc; code completely compiles. However this is the strange thing.

On the 1330 I had OSCCON = 0x70 to enable to 8MHz int osc. and PLLEN =0. Since this does not support the PLL, I've removed that line but OSCCON = 0x70 is showing up as 1.98kHz on RA6 when I use:

Update: Just realised, it should be Fosc/4 on RA6, and as such this is working.

Problem solved. I tried to define,

#define PIC18F1330
#define PIC18F4331

and use #ifdef...#endif's to swap between chips, but I don't think the compiler liked those names...
 
Last edited:
what ever compiler you are using probably has a define for the selected chip. I'm sure it's in your documentation somewhere.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…