My hardware is:
I have connected it as shown in the starting guide
I have connected the encoder directly to the pins corresponding to the enconder and I dropped (Anegated, Bnegated, Inegated). In the provided code from the application hub I've set ENCODER 1, which runs the following (in the setup part):
Siul2_Port_Ip_SetInputBuffer(NULL_PTR, NULL_PTR, 1, 54, 3U);
//this effectively functions as:
//IP_SIUL2->IMCR[54] = SIUL2_IMCR_SSS(3U);
/* Assign eMIOS0_CH7 input to TRGMUX_OUT_38 */
Siul2_Port_Ip_SetInputBuffer(NULL_PTR, NULL_PTR, 1, 55, 4U);
Then
Lcu_Ip_SyncOutputValueType EncLcuEnable[6U];
EncLcuEnable[0].LogicOutputId = LCU_LOGIC_OUTPUT_8;
EncLcuEnable[0].Value = 1U;
EncLcuEnable[1].LogicOutputId = LCU_LOGIC_OUTPUT_9;
EncLcuEnable[1].Value = 1U;
EncLcuEnable[2].LogicOutputId = LCU_LOGIC_OUTPUT_10;
EncLcuEnable[2].Value = 1U;
EncLcuEnable[3].LogicOutputId = LCU_LOGIC_OUTPUT_11;
EncLcuEnable[3].Value = 1U;
Lcu_Ip_SetSyncOutputEnable(EncLcuEnable, 4U);
and finally
AEC_VDDE_Enable(1);
When I run this without the encoder connected, the application works correctly (sensorless). When I plug in the encoder and I rerun, it goes into fault immediately. Debugging I see the following:
which corresponds to an overcurrent event
#define AEC_AE_EVENTS_STATUS_OCD_VDDE_FL_MASK (0x8U)
#define AEC_AE_EVENTS_STATUS_OCD_VDDE_FL_SHIFT (3U)
How can I fix this problem? Any advice would be appreciated.
Hello @alovi,
I understand that you are using VDDE to supply the encoder. However, the VDDE output current is limited.
Please note that 175 mA represents the maximum overcurrent detection threshold; the minimum threshold is not specified. At the same time, the VDDE pin can continuously supply up to 30 mA at 5 V.
Looking at the encoder datasheet, its current consumption can reach up to 40 mA even without load, which already exceeds the supported VDDE capability.
Best regards,
Daniel
Is there any other pin on the board that I can use to power the encoder or do I have to use an external source to power it?
Hi @alovi,
Unfortunately, only VDDE can be used to supply external devices from the internal regulator.
In this case, an external regulator is required.
Regards,
Daniel