Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

[SOLVED] issue doing clock division with PIC24FJ64G004

Status
Not open for further replies.

siongboon

Advanced Member level 1
Joined
Jan 24, 2006
Messages
423
Helped
45
Reputation
88
Reaction score
10
Trophy points
1,298
Location
Singapore
Activity points
4,075
Hi,

I have a problem changing the clock cycle for pic24fj64004.
I have tried the following code to play around with CLKDIV register,

CLKDIVbits.RCDIV=0x0000;

CLKDIVbits.RCDIV=0x0500;

and also

CLKDIVbits.RCDIV2=1;
CLKDIVbits.RCDIV1=0;
CLKDIVbits.RCDIV0=0;


I see that most example begins the code at the beginning of main().
Try either way but the clock cycle just doesn't change at all.
I have wrote the instruction to generate an output pulse,
checking on the pulse width to determine the clock cycle.

The clock cycle is struck at the default clock cycle as indicated on the datasheet.
I cannot manage to change the clock cycle through CLKDIV register.

Is there any other configuration that I may have missed out?

Thank you very much for your any advise.

Best Regards,
Siong Boon
 

Did you understand, where RCDIV is applied in the clock scheme? It's only effective in FRCDIV mode. DOZE can be
used to reduce the clock speed for all modes.
 

    siongboon

    Points: 2
    Helpful Answer Positive Rating
Ho... no wonder.

From the diagram in the datasheet, it seems that all clock
output will have to pass through the CLKDIV block
, and finally the clock is used to drive the CPU.
I am still thinking the clock can be changed.

The default is divide by two.
....
...
..

After studying the datasheet carefully again,
I see what you mean.
Thank you.

I should use DOZE, not RCDIV in the CLKDIV register.
This is what I actually wanted.

Thank you very much.
Siong Boon
 

What's the applied clock mode? As said, RCDIV only works for internal oscillator with post-divider.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top