I am having difficulties attaching eMIOS signals to LCU with TRGMUX. Therefore, I have three questions:
- Are there examples utilizing TRGMUX (preferably attaching signals to LCU)?
- Are there examples outputting signals from the LCU (as far as I know Lcu_Ip_LcuControlMotor_S32K344 does not output any signals)?
- If there are no examples, does something look wrong in the attached block diagram (fully set up using S32DS ConfigurationTool with RTD_4.4_1.0.0_D2110)?
- To use LCU1_LC2_input0 the LUTCTRL value was set at 0x5555, I have also tried 0xAAAA instead in case I am wrong in the bit order.
- The output of my measurements is attached. The output shows that the eMIOS is configured correctly, and that the inverted signal set up in the LCU is reflected in the output pins.
- Perhaps the LCU is not started yet (OUTEN is set to 1, FORCEOUT is read as 0). When setting LUTCTRL to 0x0000, 0x0001, or 0xFFFF the output does not change (but LCOUT does).
Lastly, the initialization code:
/* Initialize clock () */
Clock_Ip_Init(&Mcu_aClockConfigPB[0]);
/* Initialize all pins using the Port driver */
Siul2_Port_Ip_Init(NUM_OF_CONFIGURED_PINS0, g_pin_mux_InitConfigArr0);
/* Initialize LCU for complementary signal */
Lcu_Ip_ReturnType ret_lcu = Lcu_Ip_Init(&Lcu_Ip_xLcuInitPB);
if (ret_lcu != LCU_IP_STATUS_SUCCESS)
{
exit_code = 1u;
}
/* TRGMUX: connect eMIOS to LCU */
Trgmux_Ip_StatusType ret_trgmux = Trgmux_Ip_Init(&Trgmux_Ip_xTrgmuxInitPB);
if (ret_trgmux != TRGMUX_IP_STATUS_SUCCESS)
{
exit_code = 1u;
}
/* OPWMB */
/* - Initialize Emios_Mcl driver */
/* WATCH OUT: AbeMat: Instance hard coded*/
Emios_Mcl_Ip_Init(1U, &Emios_Mcl_Ip_1_Config_BOARD_INITPERIPHERALS);
/* - Initialize Chargepump: Emios_Pwm_Ip driver */
Emios_Pwm_Ip_InitChannel(EMIOS_PWM_IP_BOARD_InitPeripherals_I1_CH12_CFG, &Emios_Pwm_Ip_BOARD_InitPeripherals_I1_Ch12);