S32K3 TRGMUX example

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K3 TRGMUX example

Jump to solution
2,867 Views
abemat
Contributor III

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);

 

0 Kudos
1 Solution
2,794 Views
abemat
Contributor III

Turned out there was a problem when declaring the Motor_OutputList: The LogicOutputId should be the logical value (0 and 1), which is the ID of the LC output instance, instead of the physical value (channel 8 and 9) (screenshot attached).
After modified as above capture, I could be able to see the generated pulse in PTC12 (LCU_1 ch9) and PTC13 (LCU_1 ch8).

View solution in original post

0 Kudos
5 Replies
2,380 Views
kyf
Contributor V

Hello @abemat . I'm sorry for the late response.

I've succeeded into replicating the block diagram above. I'm attaching a file that I've received from NXP techs. I think that this will help you to create complimentary signals with rise/fall filter.

 

Kind regards,

kyf

0 Kudos
2,530 Views
kyf
Contributor V

Hello abemat,

Did the example "LcuControlMotor" help you with complementary signals ?

I'm trying to figure out how to setup the LCU driver in order to create complimentary PWM signals fed from 1 eMIOS channel. Did you find any other documentation regarding LCU configuration except S32K3xx ref manual ?

I'm trying to create the set-up from S32K3xx RM :

kyf_0-1659446524242.png

 

 

0 Kudos
2,448 Views
abemat
Contributor III

I have not implemented it yet, but this was the idea I originally wanted to pursue. Did you succesfully make complementary PWM yet?

 

NXP_PWM_LCU_Complementary_2.drawio.png

0 Kudos
2,795 Views
abemat
Contributor III

Turned out there was a problem when declaring the Motor_OutputList: The LogicOutputId should be the logical value (0 and 1), which is the ID of the LC output instance, instead of the physical value (channel 8 and 9) (screenshot attached).
After modified as above capture, I could be able to see the generated pulse in PTC12 (LCU_1 ch9) and PTC13 (LCU_1 ch8).

0 Kudos
961 Views
zeyu__1
Contributor I

Can you share a copy of your project? I would like to try to reproduce it as a learning, thank you very much

0 Kudos