Hi,
I am using MC9S12ZVML1128 controller. I have implemented,
1. 50us interrupt-PMF reload interrupt in which motor control handler is called
2. 1ms interrupt-Timer Channel 3 interrupt in which PI loop executes.
While motor rotates in close loop, 50us interrupt is missing when 1ms interrupt comes even though I have given highest priority to 50us interrupt.
/* set PMF_reload Interrupt (0x0D0) priority 7*/
/* 0xD0/4=0x34 => reg. value = 0x30 + offset 4 */
INT_CFADDR = 0x30;//0x34;
INT_CFDATA0 = 7;
/* set Timer channel 3 ISR (0x1C0) to 6 */
/* 0x1C0 / 4 = 0x70 => reg. value = 0x70 + offset 0 */
INT_CFADDR = 0x70;
INT_CFDATA4 = 6;
Please provide me solution for the above question as early as possible.
Hi
You have wrong Configuration Data Registers
It should be
/* set PMF_reload Interrupt (0x0D0) priority 7*/
D0/4 = 0x34
INT_CFADDR = 0x30; // 0x34 [7-4] = 0x30
INT_CFDATA4_ PRIOLVL = 0x07; // 0x34 [3-0] = 0x4 … 4th register INT_CFDATA4_ PRIOLVL
/* set Timer channel 3 ISR (0x1C0) to 6 */
1C0/4 = 0x70
INT_CFADDR = 0x70; // 0x70 [7-4] = 0x70
INT_CFDATA0_ PRIOLVL = 0x06; // 0x70 [3-0] = 0x0 … 0th register INT_CFDATA0_ PRIOLVL
I don’t know if it is only here or it is in your project as well
Regards
Daniel
Thanks Danial !
If there is more than one interrupt with same offset like,
Timer channel 3 ISR(1C0/4=0x70,offset=0)
PTUTrigger 1 Done ISR(0xE0/4=0x38,offset=0)
then which one data register is used for Timer channel 3 and PTU Trigger 1 Done Interrupt ?
Hi
In this case, use the INT_CFDATA0 register for both of them:
INT_CFADDR = 0x70;
INT_CFDATA0_ PRIOLVL = INTERRUPT_PRIORITY_TIM3;
INT_CFADDR = 0x30;
INT_CFDATA0_ PRIOLVL = INTERRUPT_PRIORITY_PTU1;
Regards
Daniel