I am generating a PWM in and connecting it to another through TRGMUX in an S32K358 with RTD 4.0.0, but the other emios channel doesnt duplicate the signal.
In another post I saw it being mentioned the emios inputmux not being set automatically, so I have enabled that too using a modified function for changing corresponding IMCR state. But the EMIOS channel still doesnt take any input.
Interrupts and Notifications are enabled for both channels.
PFA the design file
Solved! Go to Solution.
Sorry, I didn't read carefully the discussion of Routing signals to EMIOS channel from Trgmux (S32k3) you mentioned before, so I didn't understand the problem you encountered.
After your prompt, I checked your project again and made the following modifications:
Your project configures channels other than eMIOS0_CH3\CH7 as Emios_Pwm. Since (signal output of eMIOS) eMIOS_n_ipp_do_emios_ch[ ] is not the output of TRGMUX.
Your project configure eMIOS0_CH7 as eMIOS_Icu, so I chose eMIOS0_CH7 for demonstration. TRGMUX_IP_INPUT_LCU0_LC0_OUT_I1 -> TRGMUX_IP_OUTPUT_EMIOS0_CH5_9_IPP_IND_CH7
// Siul2_Port_Ip_SetTrgMUXInput(564,PORT_INPUT_MUX_ALT3);
Siul2_Port_Ip_SetInputBuffer(NULL, 0, FALSE, 567-512, PORT_INPUT_MUX_ALT4);//eMIOS0_CH7 IMCR567 to 0x4 (TRGMUX_INT_OUT38)
Now, eMIOS will get signals from internal rather than external pins. That is what you mentioned: My input to EMIOS is LCU_OUT.
Hi
Sorry, I may not understand your question. Please correct me if I understand wrong.
While you connect the external PWM signal to eMIOS0_CH7, do you also want to connect the signal to eMIOS0_CH3 through the internal TRGMUX or LCU?
Through the project you attached, I saw:
You configure eMIOS0_CH3 to SAIC ICU_FALLING_EDGE and ICU_MODE_SIGNAL_EDGE_DETECT. Then call Emios_Icu_Ip_GetDutyCycleValues(INSTANCE_0, CHANNEL_7, &get_dc) in the Notification of eMIOS0_CH3, which is Driver_Fault;
But why not call Emios_Icu_Ip_GetDutyCycleValues(INSTANCE_0, CHANNEL_7, &get_dc); directly in the interrupt of eMIOS0_CH7?
Please see if the method of calling Emios_Icu_Ip_GetDutyCycleValues in S32K344_Example_Emios_Icu_IPWM_measurement_DS34_RTD_100_v2 with EMIOS_1_ch_1 (IPWM mode) meets your needs:
Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi Robin,
"While you connect the external PWM signal to eMIOS0_CH7, do you also want to connect the signal to eMIOS0_CH3 through the internal TRGMUX or LCU?" -- Yes, that is the intention.
The given code is a dummy I made to demonstrate the issue I was having, it is close to but not the actual logic I am implementing. In this code, the LCU is the middleman just to demonstrate that the problem is arising when an emios channel is the trgmux output and is fine when emios is the trgmux input. The problem I am having here is to route an signal to the emios through trgmux. I have referred to the following post (https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Routing-signals-to-EMIOS-channel-from-T...) but have not been successful in replicating it in S32DS (i am not using MBDT or ebtresos).
Regards,
RChatterjee
Hi RChatterjee,
I hope this can be explained clearly.
Hi Robin,
Yes, I am familiar with that. I am not sure if you have gone through the code or even the issue I have described, but this is not what I have problem with or require support with.
So, I am going to be extremely clear once again and restate my issue. I have followed the recommendations for the implementation as the RTD documents have described, but EVEN AFTER CONFIGURING THE EMIOS INPUT AS TRGMUX OUTPUT, I do not detect any output on the board. The code is identical to the one attached in my original post.
What is the difficulty you are facing to understand this, please let me know.
My input to EMIOS is LCU_OUT. I have shared the image here. This configuration doesn't return me any output at EMIOS0_4. I am not linking EMIOS input to EMIOS output.
Also, from the diagram you shared, do I need to do any additional configuration for EMIOS_0_4 channel? Because I am not sure if I need to call it in the code in some way, I am directly routing LCU_OUT to it and then taking it at pin output.
Regards,
Rounak Chatterjee.
Sorry, I didn't read carefully the discussion of Routing signals to EMIOS channel from Trgmux (S32k3) you mentioned before, so I didn't understand the problem you encountered.
After your prompt, I checked your project again and made the following modifications:
Your project configures channels other than eMIOS0_CH3\CH7 as Emios_Pwm. Since (signal output of eMIOS) eMIOS_n_ipp_do_emios_ch[ ] is not the output of TRGMUX.
Your project configure eMIOS0_CH7 as eMIOS_Icu, so I chose eMIOS0_CH7 for demonstration. TRGMUX_IP_INPUT_LCU0_LC0_OUT_I1 -> TRGMUX_IP_OUTPUT_EMIOS0_CH5_9_IPP_IND_CH7
// Siul2_Port_Ip_SetTrgMUXInput(564,PORT_INPUT_MUX_ALT3);
Siul2_Port_Ip_SetInputBuffer(NULL, 0, FALSE, 567-512, PORT_INPUT_MUX_ALT4);//eMIOS0_CH7 IMCR567 to 0x4 (TRGMUX_INT_OUT38)
Now, eMIOS will get signals from internal rather than external pins. That is what you mentioned: My input to EMIOS is LCU_OUT.