Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

PIC24FJ128GA010 Clock settings

Status
Not open for further replies.

Kareem101

Newbie level 2
Joined
Jun 30, 2015
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
20
The Data sheet says that this chip can do 16 MIPS @32Mhz, although I cant make it work @ 32Mhz

From MPLABX V2.26 and using C30, I generated these Config bits Value as follow :


Code C - [expand]
1
2
3
4
5
6
7
8
9
int CONFIG2 __attribute__((space(prog), address(0x157FC))) = 0xFB3E ;
 
//_CONFIG2(
//    POSCMOD_HS &         // Primary Oscillator Select (HS Oscillator mode selected)
//    OSCIOFNC_OFF &       // Primary Oscillator Output Function (OSC2/CLKO/RC15 functions as CLKO (FOSC/2))
//    FCKSM_CSECME &       // Clock Switching and Monitor (Clock switching is enabled, Fail-Safe Clock Monitor is enabled)
//    FNOSC_PRIPLL &       // Oscillator Select (Primary Oscillator with PLL module (HSPLL, ECPLL))
//    IESO_ON              // Internal External Switch Over Mode (IESO mode (Two-Speed Start-up) enabled)
//);



Now I know that my controller is not working @ 32Mhz as I mesaured the clock on RC15 and found 8Mhz, Hence is working @16Mhz !

So my Question is , what I am missing ?? How to Make it work @ 32Mhz !!
 
Last edited by a moderator:

Aussie Susan

Advanced Member level 4
Joined
Jan 5, 2015
Messages
1,197
Helped
366
Reputation
732
Reaction score
363
Trophy points
83
Activity points
12,979
That is not the way to set up the configuration bits. Look at the C30 User Guide, section 6.6.1.
Also read Section 8 of the data sheet and the Family Reference Manual Section 6 which explain the oscillator setup.
What is frequency of the crystal you are using? I assume it is 8MHz since you are measuring RC15 and this pin is acting as the OSCO line to drive the crystal. (It is NOT Fosc/2 in this configuration.)
If that is correct, then you actually need to use XT (and XTPLL) mode - look at Section 6.5 of the FRM to see the correct settings based on the crystal frequency.
I suggest that you have a look at some of the example code that is available from Microchip and also through a Google search to see how others have set up the oscillator. While the data sheets and FRM sections actually will tell you just about everything you will need to know to use these MCUs, there is a fairly steep learning curve involved, part of which is learning how to read these documents.
Susan
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top