TimerOne and TimerThree setup pin 0 to output high on Teensy 3.6

Status
Not open for further replies.

JHamond

New member
Hello world,
I'm trying to use TimerOne ( TimerThree behaves the same) to trigger an interrupt at a programmable time interval, which works fine.

The problem is that Serail1 Rx pin 0 is now set to output high, which breaks the serial input of course. disablePwm( 0 ) doesn't seem to have any impact. I had a quick scan through the library files but found nothing that would explain the issue.

The offending code:

Timer1.initialize( TIMER1_DELAY_US );
Timer1.attachInterrupt( isrFunction );
Timer1.disablePwm( 0 ); // attempt to prevent IO collision with Serial1 Rx

Thoughts appreciated.
 
Paul has done a great job of documenting it here:

https://www.pjrc.com/teensy/td_libs_TimerOne.html

Not to mention it does function, just with the added easter egg mentioned above. That said, I'll try interval timer also, thanks for the suggestion. One thing that wasn't clear in the TimerOne example was whether or not I can set interrupt priorities, tis didn't work:

NVIC_SetPriority(TC1_IRQn, 1);

and I couldn't find a vector table to set me straight.

***********UPDATE

I found in the interval timer a reference stating that TimerOne is recommended for Teensy 2.0:

" For Teensy 2.0 and Teensy++ 2.0, the TimerOne & TimerThree and FlexiTimer2 libraries provide similar capability. "

Thanks again for the help.
 
Last edited:
Status
Not open for further replies.
Back
Top