PIC32 oscillator question

I'm using the following code to test my oscillator configuration setup, and I'm puzzled. No matter what values I use for fpllidiv, fpllodiv, fpllmul, etc., my PORTB scope waveform never changes its period.

Code runs fine on the device, I just expect to see the output vary with clock freq settings. I must be missing something obvious. Any suggestions?

/* MPLAB v8.92, if that's important */ #pragma FCKSM = CSDCMD #pragma IESO = OFF #pragma UPLLEN = OFF #pragma FNOSC = FRCPLL #pragma FSOSCEN = OFF #pragma POSCMOD = OFF #pragma OSCIOFNC = OFF #pragma JTAGEN = OFF #pragma FPLLIDIV = DIV_2 #pragma FPLLODIV = DIV_256 #pragma FPLLMUL = MUL_20 #pragma FPBDIV = DIV_8

. . . li s1, 0xFFFFFFFF test: sw s1, PORTBINV b test

Reply to
Randy Day
Loading thread data ...

I finally caught on that the pragmas in my code were being ignored, and that the 'config bits' window in mplab actually allows you to change settings.

I'm getting lots of speed now!

Reply to
Randy Day

As a suggestion, if you're ever going to have someone else work on the design, make sure that this is all very well documented somehow.

I hate IDE's, and obscure configuration settings, for just the reason you're running into.

--

Tim Wescott 
Wescott Design Services 
http://www.wescottdesign.com
Reply to
Tim Wescott

With MPLAB I put the config bits in the Header file. That way I dont' have to figure it out in the future.

Cheers

Reply to
Martin Riddle
[snip]

Thanks. I've put my little 'discoveries' in the comments.

Reply to
Randy Day

I should mention that the first "someone else" who had to work on poorly commented code that I produced was me, six months after I had put a project aside for a while.

Oh, the things we learn when we're 13 and stupid.

--

Tim Wescott 
Wescott Design Services 
http://www.wescottdesign.com
Reply to
Tim Wescott

The lab reports that they taught me how to write back in engineering school are as critical to me as charting is to a physician or dentist.

--
      __ 
   __/  \ 
  /  \__/ 
  \__/    Don Kuenz 
  /  \__ 
  \__/  \ 
     \__/
Reply to
Don Kuenz

Are you using mplabx? which PIC are you using? For what? jb

Reply to
haiticare2011
[snip]

MPLAB 8.92. I'm familiar enough with its quirks that I've resisted moving up to X.

PIC32mx150. It's my first foray into

32-bit world.
Reply to
Randy Day

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.