View previous topic :: View next topic |
Author |
Message |
pieter
Joined: 16 Jan 2011 Posts: 27
|
Pic24HJ256GP610 Oscillator Fuses |
Posted: Fri Jan 21, 2011 2:21 pm |
|
|
If you can help, with the following, it will be highly appreciated
I set up the fuses correctly but MPLab shows the fuses are different.
It shows Primary Osc = disabled (wrong)
primary clock = FRC (wrong)
but PLL shows enabled (correct)
My fuses are:
Code: | #FUSES WDT //Watch Dog Timer
#FUSES NOWRTB //Boot block not write protected
#FUSES NOBSS //No boot segment
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOWRT //Program memory not write protected
#FUSES XT
#FUSES PR_PLL //Pimary oscillator
#FUSES NOOSCIO //OSC2 is general purpose output
#FUSES WPRES128 //Watch Dog Timer PreScalar 1:128
#FUSES WPOSTS16 //Watch Dog Timer PostScalar 1:32768
#FUSES PUT128 //Power On Reset Timer value 128ms
#FUSES NOIESO //Internal External Switch Over mode #FUSES NORSS //No secure segment RAM
#FUSES NOSSS //No secure segment
#FUSES NOWRTSS //Secure segment not write protected
#FUSES NORBS //No Boot RAM defined
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOJTAG //JTAG disabled |
etc.
Code: | #use delay(clock=40M, Oscillator=10M,RESTART_WDT) |
The micro runs at 5 times lower speed to what is programmed
On a few other but different Pic24 microcontrollers it works correct.
Any ideas? |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Fri Jan 21, 2011 4:29 pm |
|
|
I couldn't reproduce what you said about different fuse bits in MPLAB, so apparently your using a different PCD version,
or something else is different. Obviously it's useless to check the other points then.
I may want to look into it further, if you
-tell the involved PCD version
-post a complete compilable example that reproduces the issue |
|
|
pieter
Joined: 16 Jan 2011 Posts: 27
|
|
Posted: Sat Jan 22, 2011 1:22 am |
|
|
Thank you for helping
I am using Pcd 4.107
Printf == >= ! functions and expressions do not work correctly either |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Sat Jan 22, 2011 3:40 am |
|
|
PCD V4.107 doesn't set the PLL parameters for your chip according to #use delay, newer versions (e.g. V4.112) do.
I can't see a problem with #fuses in V4.107, however.
Setup_oscillator() also doesn't work correctly with V4.107, so you have to write to CLKDIV and PLLFBD directly.
Some other bugs (e.g. arithmetic) are also present with V4.107. I'll check V4.118 next days. |
|
|
|