Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.

New Articles From Microcontroller Tips

Back
Top