2021-09-21 08:01 AM
Hello Erwan,
thank you very much for the answers and the insight in the other thread.
Decided to start another thread, due to different topic here.
I tried to at least make the IPWM input work on eMIOS0 Ch 2 and created a little example project with channel 0 PWM output externally linked to the channel 2 input.
My new questions:
In the attached patch.xml I reworked the icu_lld.c component implementation of the flag interrupt routine according to the reference manuals information.
I setup the eMIOS channel with EMIOS_CCR_MODE_IPWM flag in icu_lld_start function.
Below you see the changed part of the icu_lld_serve_interrupt function:
if ((sr & EMIOSS_FLAG) != 0U) {
icup->emiosp->CH[icup->emios_ch].S.R |= EMIOSS_FLAGC;
if (icup->config->mode == ICU_INPUT_ACTIVE_HIGH) {
if(icup->emiosp->CH[icup->emios_ch].C.R & EMIOS_CCR_MODE_IPWM && \
(icup->config->width_cb != NULL)){
icup->pe.a2_2 = (int16_t)icup->emiosp->CH[icup->emios_ch].A.R;
icup->pe.a2_1 = (int16_t)icup->emiosp->CH[icup->emios_ch].B.R;
width = (icup->pe.a2_2 - icup->pe.a2_1);
icup->width = (uint16_t)(width);
icup->config->width_cb(icup);
}
}
....
}
Maybe somebody had the same problems while getting IPWM to work. Hope my code helps a bit.
@Mods: Please delete my last reply in How to setup IPWM on channels UC13, UC14 and UC15 with Low Level Driver component? thread, because I cannot do it myself. Thank you.
Best regards,
Christopher Seifert
2021-09-29 07:58 AM
Thank you very much for your analysis ,
i am checking with experts.
and i have created a Change request in order tol add IPWN configuration in our configuration.
we will come back to you ;)
Best Regards
Erwan