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.
Hello folks,
we have treid to move the encoder calculation of speed and position from CPU1 to CPU2.
On CPU1 everything is working fine according the TI-example "eqep_pos_speed_cpu01".
Seeking to transfer the operation to CPU2 we did the following:
1. in GPIO.c of CPU1 of the TI-example we changed
GPIO_SetupPinMux(20, GPIO_MUX_CPU1, 0);
to
GPIO_SetupPinMux(20, GPIO_MUX_CPU2, 0);
and accordingly for channel B(Pin21), C(Pin22) and Reset(Pin23)
2. during initialization we added
DevCfgRegs.CPUSEL2.bit.EQEP1 = 1; // 0 for CPU1 and 1 for CPU2
3. POSSPEED_Init and POSSPEED_calc are called from CPU2
However speed and position on CPU2 are always zero.
Is there anythong else we have to do for POSSPEED calculation on CPU2.?
We are thankful for any hint and advice.
nk
Hi Nirav,
both CPU´s are running fine. They can axchange data and do their normal job. It´s only the EQEP-Registers, that don´t show reasonable results on CPU2.
Regards
Hi Nokla,
Ok, good. Did you try debugging the code and making sure the eQEP is configured properly by CPU2 as it is done by CPU1?
Regards,
Nirav
Hi Nirav,
the probelm could be solved by adding the enabling of the peripheral clock for EQEP1 on CPU2.
We added
CpuSysRegs.PCLKCR4.bit.EQEP1 = 1
in Init.c of CPU2.
The function InitPeripheralClocks() of the system file F2837xD_SysCtrl.c enables only the peripheral clock if CPU1 is defined.
Regards
nokla