Guoqiang Yang

How can run the S12ZVML-MINIBRD_BLDC_Sensorless_CW_IDE project

Discussion created by Guoqiang Yang on Jul 4, 2016
Latest reply on Jul 7, 2016 by Radek Sestak

Hi,EveryOne,

I purchased a S12ZVML-MINIBRD.When I try to   develop software with S12ZVML-MINIBRD_BLDC_Sensorless_CW_IDE project, i can not import the S12ZVML-MINIBRD_BLDC_Sensorless_CW_IDE project with CW10.6 because there is no any .MCP file in the  folder 'S12ZVML-MINIBRD_BLDC_Sensorless_CW_IDE' . Then I create a project, add all necessary file and load .elf file. Unfortunately the  program does not work at all.

 

when I comment the code following, it works,

.......

initCPMU();

    initGPIO();

    initTIM();

    initPMF();

    initPTU();

    initADC();

    initSCI();

    initGDU();

//    initInt();

......

 

The I step into the code of  initInt which is listed,

// set PTU Trigger 1 ISR (0x0E0) priority to 6

    // 0xE0 / 4 = 0x38 => reg. value = 0x38 + offset 0

    INT_CFADDR = 0x38;

    INT_CFDATA0 = 6;

 

    // set ADC 0 done ISR (0x184) priority to 6

    // 0x184 / 4 = 0x61 => reg. 0x60, offset 1

    INT_CFADDR = 0x60;

    INT_CFDATA1 = 6;

 

    // set Commutation ISR (0x1CC) priority to 5

    // 0x1CC / 4 = 0x73 => reg. value = 0x70 + offset 3

    INT_CFADDR = 0x70;

    INT_CFDATA3 = 5;

 

    // set Speed control loop ISR (0x1C0) to 4

    // 0x1C0 / 4 = 0x70 => reg. value = 0x70 + offset 0

    INT_CFADDR = 0x70;

    INT_CFDATA0 = 4;

 

I am so confused: there is no 0x184 interrupt vector number according to the mc9s12zvml128.h file.

The max. interrupt vector number is 123.

 

When I read the datasheet, i am confused the  interrupt priority configuration,

Interrupt Request Configuration Data Register Select Bits — These bits determine which of the 128

configuration data registers are accessible in the 8 register window at INT_CFDATA0–7.

The hexadecimal value written to this register corresponds to the upper 4 bits of the vector number

(multiply with 4 to get the vector address offset).

If, for example, the value 0x70 is written to this register, the configuration data register block for the 8

interrupt vector requests starting with vector at address (vector base + (0x70*4 = 0x0001C0)) is selected

and can be accessed as INT_CFDATA0–7.

 

If the hexadecimal value written to this register is the vector number with 4,  then INT_CFDATA4–7 is unneccesary!

 

How can I make the project work?

 

Thanks a lot!

Outcomes