Strange. for some reason TCTRL0 and TCTRL1 have non-zero values (power on should set them to 0). I haven't yet found where in the core those registers are set. here is my test sketch
Code:
#define PRREG(x) Serial.printf(#x" 0x%x\n",x);
IntervalTimer t1, t2, t3, t4;
volatile uint32_t t1c, t2c, t3c, t4c;
void t1isr() {
t1c++;
}
void t2isr() {
t2c++;
}
void t3isr() {
t3c++;
}
void t4isr() {
t4c++;
}
void setup() {
Serial.begin(9600);
while (!Serial);
CCM_CCGR1 |= CCM_CCGR1_PIT(CCM_CCGR_ON);
PRREG(PIT_TCTRL0);
PRREG(PIT_TCTRL1);
PRREG(PIT_TCTRL2);
PRREG(PIT_TCTRL3);
// PIT_MCR = 1;
PIT_TCTRL0 = 0;
PIT_TCTRL1 = 0;
// PIT_TCTRL2=0;
// PIT_TCTRL3=0;
t1.begin(t1isr, 500000);
t2.begin(t2isr, 200000);
t3.begin(t3isr, 100000);
t4.begin(t4isr, 1000);
}
void loop() {
Serial.printf("%d %d %d %d\n", t1c, t2c, t3c, t4c);
delay(1000);
}
I confirm setting TCTRL0 and TCTRL1 to 0 allow all 4 PIT timers to be used in IntervalTimer ... more research required.
Production T4 (1062) using 1.8.8 1.47 or 1.8.9 1.47
EDIT: PIT registers should be 0 at power on/reset, but for T4 (1062), regs are
Code:
PIT_MCR 0x2
PIT_TCTRL0 0x1
PIT_TCTRL1 0x5
PIT_TCTRL2 0x0
PIT_TCTRL3 0x0
PIT_LDVAL0 0xffffffff
PIT_LDVAL1 0xffffffff
PIT_LDVAL2 0x0
PIT_LDVAL3 0x0
It looks like PIT was configured for 64-bit cycle counting (channel 1 chained to channel 0). I still don't know why regs aren't all 0.
FWIW, see https://github.com/manitou48/teensy4...t_micros64.ino