Teensy 2.0++ seems to be running at 2MHz and not 16MHz.

Status
Not open for further replies.

JimK

Member
In the past I used an Arduino ATMega 2560 board programmed with Studio 6. It ran at 16 MHz. right out of the box.

Now I am just starting to use the Teensy 2.0++ board, programming with Studio 6 and loading the resuling HEX file with the Teensy Loader version 1.06.
I programmed the following blink program and found that I have to set the F_CPU to 2000000UL in order for _delay_ms(1000) to toggle the LED at a one second rate.
That means my Teensy 2.0++ board is only running at 2MHz instead of the 16 MHz I expected.

Why doesn't this board run at 16MHz from the outset?
It's no biggie if I need to set some registers to boost the speed.
But I need to be pointed in the right direction.

I hope I don't have to burn fuses to make this happen.


Here's the program that toggles the LED at 1sec. ON....1sec. OFF:
*****************
#ifndef F_CPU
#define F_CPU 2000000UL // or whatever may be your frequency
#endif

#include <avr/io.h>
#include <util/delay.h> // for _delay_ms()

int main (void)
{
DDRD |= 1<<6; // initialize port D6 for output
while(1) // Loop Forever
{
PORTD ^= 1<<6; // toggle port 6
_delay_ms(1000); // wait 1000 milliseconds (1 second)
}
}
 
Status
Not open for further replies.
Back
Top