CPU Clock speed for Teensy 3.0

Status
Not open for further replies.

frgl

Member
Im trying to lower the CPU clock speed for the Teensy 3.0, when I use the code as per the Teensy website for CPU Clock Speed I get an error, but when I run it on the teensy 2.0 it compiles. Can someone explain this or let me know what I have to do. Its the last part f the project so Im hoping to get this sorted asap.
Thanks.
 
Yes, Im using a 3.7volt 110mAh Lithium battery and I only need the clock speed at roughly 1 Mhz to do what I need. please say you have an easy solution?
 
Sorry,
When I add the code as per the PJRC website to my code and try compile it I get the following.
 screenshot.png

However when I compile the code selecting the Teensy 2.0 board the code will work but not for my board which is the Teensy 3.0.
How do I alter the speed for the 3.0 version?
 
that won't work, two different beasts. Teensy 3.0 is arm chip, take a look at my Low-Power library, I have code for scaling the processor speed, look at the CPU function in the LowPower_Teensy3.cpp that uses mcg.c file. Its complicated so be warned but it should get you started. You also can use the library but right now it is in flux and I don't have an example for CPU scaling currently but its pretty easy just call the CPU(speed) function; the configured speeds are 2,4,8,16,24,48,96 MHz.

One warning is that if you plan to use anything lower than 24MHz, USB will not work and also the Teensy core is not configured for anything lower. I have ported some stuff over to use slower clock rates but there is still lots that will not work as expected. I'm working on getting the most used features ported now but it's not that easy.

duff
 
Sorry,
When I add the code as per the PJRC website to my code and try compile it I get the following.
View attachment 1481

However when I compile the code selecting the Teensy 2.0 board the code will work but not for my board which is the Teensy 3.0.
How do I alter the speed for the 3.0 version?

I am having the same problem. I am using Teensy 3.1, and have no idea how to change the clock speed in arduino.
The same error, clkpr not defined. Wonder how to change the CPU clock speed in arduino
 
I suggest the strategy for power conservation on ARMs and Teensy is to code for sleeping and low power state for 90% or more of the time, on average.
 
problem.PNG

I am using Teensy 3.1, simply try to use 16MHz for clock speed. The program is simply a blink one, to test the clock speed.
The error is CLKPR not declared.

I am running Teensyduino on Windows 7.

Does this function only work on C + makefile? Or can I include a header file to make this work on a Teensyduino
 
That's AVR-only code. It's also code that generally is meant for stand-alone use, without Arduino.

Teensyduino makes this very easy. Just use the Tools > CPU Speed menu.

On Teensy 3.1, the minimum speed is 24 MHz.
 
That's AVR-only code. It's also code that generally is meant for stand-alone use, without Arduino.

Teensyduino makes this very easy. Just use the Tools > CPU Speed menu.

On Teensy 3.1, the minimum speed is 24 MHz.

I am just to confirm. So that using Arduino, the Teensy is working by default at a clock speed of 96 MHz?
 
Yes, the menu defaults to 96 MHz.

Sorry to hijack thread, but is it possible to go higher on the overclock? Would this affect the PWM peripheral hardware, or is that locked to a separate clock? I'm keen to get the resolution of the PWM up a bit, with very successful test of 8bit, 15Khz audio playback running the PWM at around 32Khz, it would be fun to try and aim for something a bit higher quality.
 
Will a selection of 72Mhz for the Teensy 3.1 be added soon? Or will the 96Mhz setting work? If the point of the 3.1 is the added speed, it would be a shame to limit it to 48Mhz.
 
Will a selection of 72Mhz for the Teensy 3.1 be added soon?

If you consider "soon" about 4-5 months, then yes.

Or will the 96Mhz setting work?

Yes, 96 MHz works fine. I develop and test everything for Teensy 3.1 at 96 MHz.

Technically it's overclocking. But all these K20 chips are made on the same 90 nm process, and all the I/O still runs at 48 MHz when the CPU is at 96 MHz.


If the point of the 3.1 is the added speed, it would be a shame to limit it to 48Mhz.

If you need the speed, just use it. But 48 MHz and 24 MHz consume less power, and they're still plenty fast enough for many applications.
 
Teensy 3.1 8Mhz

If you consider "soon" about 4-5 months, then yes.



Yes, 96 MHz works fine. I develop and test everything for Teensy 3.1 at 96 MHz.

Technically it's overclocking. But all these K20 chips are made on the same 90 nm process, and all the I/O still runs at 48 MHz when the CPU is at 96 MHz.




If you need the speed, just use it. But 48 MHz and 24 MHz consume less power, and they're still plenty fast enough for many applications.

Hi Paul, I configured the CPU speed at 8 MHz of my Teensy 3.1 and now it doesn't work more, what I can do to revive it?
 
Status
Not open for further replies.
Back
Top