I'm trying to write my own multiplexing code for the Tlc5940 for Teensy while looking at previous attempts by others on Arduino/AVR and need help converting some interrupts to ARM. I think I'm close, but I don't have any experience with interrupts and am a little out of my depth.
The basic gist is that I'm trying to call an intrrupt every time the BLANK pin pulses, to load in data and enable to the next row of LEDs.
I know this calls an interrupt *after* the pulse on an Arduino.
And this is the equivalent on Teensy:
Now, this is what I'm trying to do: calling an interrupt *during* the pulse, I gather it's the rising edge. This is for on an Arduino:
So what is the equivalent of this on a Teensy?
What's happening inside void ftm1_isr: I gather it's checking the overflow flag and then clears it?
I think I have to identify which flag I should care about (FTM1_CnSC maybe?) and then identify what mask I should use, and how to compare and reset it? Am I close?
The basic gist is that I'm trying to call an intrrupt every time the BLANK pin pulses, to load in data and enable to the next row of LEDs.
I know this calls an interrupt *after* the pulse on an Arduino.
Code:
ISR(TIMER1_OVF_vect)
{
Tlc5940_interrupt();
}
And this is the equivalent on Teensy:
Code:
void ftm1_isr(void)
{
uint32_t sc = FTM1_SC;
if (sc & 0x80) FTM1_SC = sc & 0x7F;
Tlc5940_interrupt();
}
Now, this is what I'm trying to do: calling an interrupt *during* the pulse, I gather it's the rising edge. This is for on an Arduino:
Code:
ISR(TIMER1_COMPA_vect)
{
Tlc5940_interrupt();
}
So what is the equivalent of this on a Teensy?
What's happening inside void ftm1_isr: I gather it's checking the overflow flag and then clears it?
I think I have to identify which flag I should care about (FTM1_CnSC maybe?) and then identify what mask I should use, and how to compare and reset it? Am I close?
Last edited: