[SOLVED] Why can't I configure pic18f46k22's oscillator?

Status
Not open for further replies.

ahsoopk

Member level 5
Joined
Mar 12, 2010
Messages
81
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
2,103
I am newbie to micro-controller and trying to understand that why I can define Oscillator of pic18f4520 by using
#pragma OSC =HS
but can do the same for pic18f46k22, instead I have to use the following
#pragma FOSC = HSMP

what is the difference between two?

Regards,
 

hello,

they are many sub-familly in the PIC18 familly, so
every time use on MPLAB IDE
help
topics
PIC18 Config setting


Example for PIC18F46K22
Code:
// voir Help
//  Topics
//        Pic18
//            config bits settings
//                    choisir PIC18F46K22
#ifdef OSCILLATEUR_INTERNE
#pragma config FOSC = INTIO67, FCMEN = OFF, PLLCFG=OFF            // CONFIG1H
#else
#pragma config FOSC = HSHP, PLLCFG=OFF, PRICLKEN=ON ,FCMEN=OFF
#endif
#pragma config IESO=OFF,PWRTEN=OFF,BOREN=OFF,WDTEN=OFF,CCP2MX=PORTC1
#pragma config PBADEN=OFF,CCP3MX=PORTE0,T3CMX=PORTC0,P2BMX=PORTC0
#pragma config MCLRE=EXTMCLR,STVREN=OFF,LVP=ON,XINST=OFF,DEBUG=OFF
#pragma config CP0 = OFF, CP1 = OFF, CP2 = OFF, CP3 = OFF                    // CONFIG5L
#pragma config CPB = OFF, CPD = OFF                                          // CONFIG5H
#pragma config WRT0 = OFF, WRT1 = OFF, WRT2 = OFF, WRT3 = OFF                // CONFIG6L
#pragma config WRTB = OFF, WRTC = OFF, WRTD = OFF                            // CONFIG6H
#pragma config EBTR0 = OFF, EBTR1 = OFF, EBTR2 = OFF, EBTR3 = OFF            // CONFIG7L
#pragma config EBTRB = OFF                                                   // CONFIG7H
 

Attachments

  • 18F46K22_config.jpg
    162.6 KB · Views: 57
  • 18F4520_config.jpg
    147.6 KB · Views: 52

thanks my dear friend Paul.. always helpful.. *** bless..
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…