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.

CCS/LAUNCHXL-F28069M: Problems with setting up low priority interrupts service routines in Motorware - using lab11d as a base

Part Number: LAUNCHXL-F28069M
Other Parts Discussed in Thread: MOTORWARE

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()

    • In proj_lab11d.c, find HAL_enableAdcInts()
    • Control click on this function to follow it to it's instantiation - it should be located in hal_2motors.c
    • In the HAL_enableAdcInts function, change the parameter of PIE_enableAdcInt() from ADC_IntNumber_1 to ADC_IntNumber_1HP
    • Also, change the parameter of PIE_enableAdcInt() from ADC_IntNumber_2 to ADC_IntNumber_2HP
    • If you haven't already, enable the CPU interrupt for CPU_IntNumber_1 (you should already have done this somewhere in your code if the CPU has INT1.7 enabled for TINT0)
    • In proj_lab11d.c, find HAL_initIntVectorTable() and control click to open it's instantiation in hal_2motors.h
    • Change the pie pointer from ADCINT1 to ADCINT1_HP; do the same for ADCINT2 to ADCINT2_HP

    That should be the steps to mapping the motor1_ISR and motor2_ISR to the highest possible priority for the PIE chart

    Sean