This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: Code Composer Studio
Hello,
I have read through these forums as well as the user guide on interrupts (sprugl8c.pdf) extensively but am unable to find a solution to trigger a stable periodic ISR in Lab11d. There is a lot of information for control suite but no concrete examples for MOTORWARE other than timer.c as mentioned below.
What I am trying to do is trigger a lower priority ISR at around 10 milliseconds which does not interfere with the execution of motor1_ISR and motor2_ISR of Lab11d. I tried to use the included timer0ISR to accomplish this but this 5ms period seems to cause timing issues with the other 2 ISRs - I think that this is because it is linked to the TINT0 interrupt which is of higher priority than the ADC1 and ADC2 interrupts used to trigger motor1_ISR and motor2_ISR by default.
What I would like to know is - can you tell me if and how it would be possible to change the priority of TINT0 to below ADC1 and ADC2 - or alternatively replace TINTO with ADC3 (I tried this but was unable to succesfully trigger an ADC3 interrupt by modifying hal_2mtr.c) which I understand should be of lower priority than ADC1 and ADC2 by default. Is my assumption correct that this would fix the timing issues? Could you direct me to a concrete example for doing this in motorware?
Thanks in advance!
Steven
Steven,
If you look at the PIE table, you'll see that it is possible to map ADCINT1 and ADCINT2 interrupts to a higher priority than TINT0 (1.1 & 1.2 vs 1.7). The way to accomplish this in Motorware would be to change some lines of code in HAL_enableAdcInts()
That should be the steps to mapping the motor1_ISR and motor2_ISR to the highest possible priority for the PIE chart
Sean