# Lowering PIC Clock Frequency

How do I lower the clock frequency of a PIC18F2550 and recalculate the peripheral dividers?

I'm trying to make it run cooler. Currently, it runs at 12MIPs/48mhz (USB-CDC-ACM).

If you're currently running at 48 MHz, you're using an external crystal. You can decrease the frequency by changing bits 2:0 in the PLLDIV register, but we'd need to know the external crystal frequency and what peripherals you want to adjust. Is it just the USB subsystem you need to use?

Looks like you can get it down to 5 MHz with no hardware changes. Take a look at Table 2-3 the datasheet. Switch clock mode to disable the PLL and set CPUDIV1:0 to 11 and you'll get a 4x divider down to 5 MHZ.

• It's an IR receiver circuit (dangerousprototypes.com/docs/USB_Infrared_Toy_schematic_and_partlist). It has an IR receiver, an IR LED, and a 20MHz crystal. The heat comes from the PIC, near the USB connector.
– OIO
Aug 24, 2010 at 14:34

Depending on your application, you may want to try putting the PIC to sleep and using an interrupt with an RC circuit to wake it up periodically.

• The PIC18 has a number of power management modes including an idle mode which allows the timer (and interrupts) to continue running while the processor isn't executing. Therefore, the RC circuit shouldn't be necessary. I agree that managing power with sleep/idle/run states is a great idea, but it would be hard to put your proposed circuit on this board. Aug 24, 2010 at 19:33

That's a weird place to have the board get hot. It could definitely be warm at the other end, near R4, T1, and the TX LED, but there's nothing happening on the end which you say is warm! (Schematic, layout)

According to the datasheet (p. 363), the power dissipated in your PIC should be:

Pdis = VDD x {IDD – Σ IOH} + Σ {(VDD – VOH) x IOH} + Σ(VOL x IOL)

This uses the Power = Voltage * Current equation to say that the total power dissipated is the sum of the power consumed by the chip's operation (not including driven outputs) plus any power dissipation on the current sourcing transistors, plus any power dissipation on the current sinking transistors. See page 375 for data on output voltages and currents. However, it looks like there should be only minimal power dissipation according to this equation.

Three things I would look at:
- The next page has a voltage/max frequency graph. It shows that you're only allowed to operate at 48MHz when you're running above 4.2V. Is this the case when you're operating off of your ICSP header? Running out of spec here might cause issues by not switching the transistors fast enough, and developing shoot-through currents.
- That micro includes an onboard 3.3V LDO for the USB. If you're drawing any current off of this pin, you will dissipate power in the micro. If you're not communicating over USB all the time, you can disable this regulator with the VREGEN configuration bit in the CONFIG2L register.
- You got it hot once, it may now have a weak internal short. Try a different microcontroller or board. This is unlikely, but possible.

• The problem is when the device is enclosed in a case, then the PIC gets warmer.
– OIO
Aug 24, 2010 at 20:23