Systick priority defaults to 32.
Just sent your interrupt to 16 or 0.
OK Paul, thanks for that. The teensy system code takes a while to digest and understand.
As I understand it, "systick" is built into the ARM CPU and has special registers associated with it, so it is not quite a normal interrupt.
It took a while to find this code, so I am trying..
Code:
SYST_CSR = SYST_CSR_CLKSOURCE; // disable SYSTICK interrupts
as a temporary way to disable the "systick" interrupt, so as to not disturb my floppy data stream.
At the end of the track capture I re-enable the "systick" interrupt. Just freezing "systick" probably does the same.
Code:
SYST_CSR = SYST_CSR_CLKSOURCE | SYST_CSR_TICKINT | SYST_CSR_ENABLE; // re-enable SYSTICK
It took me a while to understand interrupts. For my PORTD I/O pin, I worked out the IRQ number. Here's how to
1) change the priority
2) disable the interrupt
3) enable the interrupt
4) clear any pending interrupts
Code:
const byte fromFDDreadPin = 21; // PORT-D IRQ #43
const byte fromFDDreadPinIRQ = 43; // IRQ_PORTD = 43, // kinetis.h (Teensy 3.0)
NVIC_SET_PRIORITY(fromFDDreadPinIRQ, 0); // 0 is the HIGHEST priority
NVIC_DISABLE_IRQ(fromFDDreadPinIRQ);
NVIC_ENABLE_IRQ(fromFDDreadPinIRQ);
NVIC_CLEAR_PENDING(fromFDDreadPinIRQ);
I post the above in case anyone else was looking for information about interrupts. These macros can be found in ...\Arduino\hardware\teensy\avr\cores\teensy3\kinetis.h . I haven't seen any reference to them elsewhere.
Also in the afore mentioned file, look for "enum IRQ_NUMBER_t" to find out which IRQ number to use. For Teensy3.0 you will find the relevant line " IRQ_PORTD = 43,". My I/O pin 21 is found on PORT D.
NOTE that they go from 0 to 45. There also appears to be 16 other
special CPU interrupts, of which "systick" is one. At least in one posting there was an offset of "+16" added, but in that posting I think it was incorrect, however that's where the 16 came from just in case you see this and are puzzled, like I was. There also appears to be a set of interrupt vector RAM locations which go from 0 to whatever, the first 16 are the CPU special and the rest of the interrupts from the enum. In another posting I saw that you can change number 15 which holds the vector for "systick" (but I haven't tried or confirmed this). I hope this helps!
regards...
--badsector