Using Teensy++ 2.0, Arduino Style, Windows...
I can generate an 8MHz square wave on PB7 (27) using timer0 CTC mode:
This sets up OCOA on PB7. I would like to do the same thing with OC1C from Timer1.
(To allow some flexibility when also using Arduino delays, etc.)
Seems possible from the datasheet but I can't get it to work. Any suggestions would be greatly appreciated.
Thanks in advance....
I can generate an 8MHz square wave on PB7 (27) using timer0 CTC mode:
Code:
const byte timer0OutputA = 27;
void setup() {
pinMode (timer0OutputA, OUTPUT);
TIMSK0 = 0; // no interrupts
OCR0A = 0; // 0 - 8MHz, 1 - 4MHz, 2 - 2.66MHz, 3 - 2.0MHz
TCCR0A = 0;
TCCR0B = 0;
TCCR0A |= _BV(COM0A0) | _BV(WGM01); //Toggle OCOA
TCCR0B |= _BV(WGM02) | 1; //Prescaler 1
}
This sets up OCOA on PB7. I would like to do the same thing with OC1C from Timer1.
(To allow some flexibility when also using Arduino delays, etc.)
Seems possible from the datasheet but I can't get it to work. Any suggestions would be greatly appreciated.
Thanks in advance....