I think there's an issue with my IRQ priorities for my Teensy4.1 based lathe controller. Seems that the ILI9341 display updates are the same priority as everything else. At least for my motor controlling, that's not good, as I am getting synchronization errors. Anyways, I'm researching how to better manage IRQ's. I wrote a brute force script to output the existing IRQ settings, at the end of setup. Basically everything is set to 128. I thought I read the USBSerial is 112? Why doesn't that show up? Why is IRQ_FLEXPWM2_0 = 48? I've never touched FLEXPWM, I've never used it. Does USBSerial get set to 112 later? Will a Interrupt of a higher priority get blocked for considerable time by USBSerial? How long could it be?
My plan is to make my encoder interrupts the highest priority, followed by motor pulsing, and other timers, then finally SPI, which is the interface to the ILI9341. I can set the priority for the timers fairly easily, as well as the pins (I believe). What might be any pitfalls of this approach? I understand that Teensy is set up for fast IO (6789), as I read it in imxrt.h. The encoder ISR sets a pin and triggers a oneshot timer. The oneshot timer resets the pin. The other timer is just for a convenient 50ms clock to calculate motor RPM and to schedule display updates.
I'm using EncoderTool, TimerTool, and ILI9341_t3n, as my basic libraries for my controller.
My plan is to make my encoder interrupts the highest priority, followed by motor pulsing, and other timers, then finally SPI, which is the interface to the ILI9341. I can set the priority for the timers fairly easily, as well as the pins (I believe). What might be any pitfalls of this approach? I understand that Teensy is set up for fast IO (6789), as I read it in imxrt.h. The encoder ISR sets a pin and triggers a oneshot timer. The oneshot timer resets the pin. The other timer is just for a convenient 50ms clock to calculate motor RPM and to schedule display updates.
I'm using EncoderTool, TimerTool, and ILI9341_t3n, as my basic libraries for my controller.