Routing Comparator(LPCMP) Output to eMIOS (IPWM Mode) for Frequency Measurement

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

Routing Comparator(LPCMP) Output to eMIOS (IPWM Mode) for Frequency Measurement

Jump to solution
1,525 Views
GaneshBhagwat
Contributor IV

Hi all,

I'm trying to route the output of the comparator to an eMIOS channel configured in IPWM mode, with the goal of measuring the frequency of the comparator's output. I’ve set up the TRGMUX configuration as shown below, but I’m not seeing any response on eMIOS channel 1 as expected.

Could someone please help me identify what might be missing or guide me on how to properly achieve this setup?

Thank you in advance!

GaneshBhagwat_0-1745231672484.png

 

0 Kudos
Reply
1 Solution
1,469 Views
GaneshBhagwat
Contributor IV

Hi,

I've tested the IPWM module separately and successfully generated the CMP output to the LCU. This output was then routed and verified—I've attached the corresponding waveform below.

I also tried configuring IPWM as an interrupt source via TRGMUX, but I didn’t receive any interrupt events. Interestingly, when I connect the signal directly to the pin, IPWM reads the values correctly(so there is no issue in the IPWM).

However, I believe I found a workaround for the TRGMUX issue. By configuring the LCU output again as an eMIOS input pin, I’m able to retrieve the desired signal as required.

That said, I’m facing a problem when trying to measure the period. It works fine when the measurement mode is set to DutyCycle, but when I switch to Period mode (IP → IPWM), I don’t get any values.

Currently, I'm using the Emios_Icu_Ip_GetDutyCycleValues() function, since the GetPulseWidth() function doesn’t return any values. How can I retrieve the period value when the channel is configured in IP mode using eMIOS_ICU?

Would appreciate your help on this.

 

**I’ve attached the comparator output, along with a reference to the `Emios_Icu_Ip_GetPulseWidth()` function. Since this function doesn’t return a value, could you please clarify how it’s intended to be used? Is it updating any internal register or buffer that we should access separately?

GaneshBhagwat_0-1745402522021.pngGaneshBhagwat_1-1745402572591.jpeg

 

View solution in original post

0 Kudos
Reply
3 Replies
1,492 Views
_Leo_
NXP TechSupport
NXP TechSupport

Hi,

Thank you so much for your interest in our products and for using our community.

Please try the following steps:

  • Ensure IPWM measurement works with an external signal connected directly to a pin configured as eMIOS.
  • Route the CMP out signal to an external pin (through TRGMUX) to ensure the desired signal, for debugging purposes.

Hope it helps you. Please let me know your results.

Have a nice day!

0 Kudos
Reply
1,470 Views
GaneshBhagwat
Contributor IV

Hi,

I've tested the IPWM module separately and successfully generated the CMP output to the LCU. This output was then routed and verified—I've attached the corresponding waveform below.

I also tried configuring IPWM as an interrupt source via TRGMUX, but I didn’t receive any interrupt events. Interestingly, when I connect the signal directly to the pin, IPWM reads the values correctly(so there is no issue in the IPWM).

However, I believe I found a workaround for the TRGMUX issue. By configuring the LCU output again as an eMIOS input pin, I’m able to retrieve the desired signal as required.

That said, I’m facing a problem when trying to measure the period. It works fine when the measurement mode is set to DutyCycle, but when I switch to Period mode (IP → IPWM), I don’t get any values.

Currently, I'm using the Emios_Icu_Ip_GetDutyCycleValues() function, since the GetPulseWidth() function doesn’t return any values. How can I retrieve the period value when the channel is configured in IP mode using eMIOS_ICU?

Would appreciate your help on this.

 

**I’ve attached the comparator output, along with a reference to the `Emios_Icu_Ip_GetPulseWidth()` function. Since this function doesn’t return a value, could you please clarify how it’s intended to be used? Is it updating any internal register or buffer that we should access separately?

GaneshBhagwat_0-1745402522021.pngGaneshBhagwat_1-1745402572591.jpeg

 

0 Kudos
Reply
1,366 Views
GaneshBhagwat
Contributor IV
I have resolved this issue. can close the same
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2083829%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERouting%20Comparator(LPCMP)%20Output%20to%20eMIOS%20(IPWM%20Mode)%20for%20Frequency%20Measurement%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2083829%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20all%2C%3C%2FP%3E%3CP%3EI'm%20trying%20to%20route%20the%20output%20of%20the%20comparator%20to%20an%20eMIOS%20channel%20configured%20in%20IPWM%20mode%2C%20with%20the%20goal%20of%20measuring%20the%20frequency%20of%20the%20comparator's%20output.%20I%E2%80%99ve%20set%20up%20the%20TRGMUX%20configuration%20as%20shown%20below%2C%20but%20I%E2%80%99m%20not%20seeing%20any%20response%20on%20eMIOS%20channel%201%20as%20expected.%3C%2FP%3E%3CP%3ECould%20someone%20please%20help%20me%20identify%20what%20might%20be%20missing%20or%20guide%20me%20on%20how%20to%20properly%20achieve%20this%20setup%3F%3C%2FP%3E%3CP%3EThank%20you%20in%20advance!%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22GaneshBhagwat_0-1745231672484.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22GaneshBhagwat_0-1745231672484.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F334062iF5699A8BA88F338C%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22GaneshBhagwat_0-1745231672484.png%22%20alt%3D%22GaneshBhagwat_0-1745231672484.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2089500%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Routing%20Comparator(LPCMP)%20Output%20to%20eMIOS%20(IPWM%20Mode)%20for%20Frequency%20Measurement%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2089500%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EI%20have%20resolved%20this%20issue.%20can%20close%20the%20same%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2085373%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Routing%20Comparator(LPCMP)%20Output%20to%20eMIOS%20(IPWM%20Mode)%20for%20Frequency%20Measurement%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2085373%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI've%20tested%20the%20IPWM%20module%20separately%20and%20successfully%20generated%20the%20CMP%20output%20to%20the%20LCU.%20This%20output%20was%20then%20routed%20and%20verified%E2%80%94I've%20attached%20the%20corresponding%20waveform%20below.%3C%2FP%3E%3CP%3EI%20also%20tried%20configuring%20IPWM%20as%20an%20interrupt%20source%20via%20TRGMUX%2C%20but%20I%20didn%E2%80%99t%20receive%20any%20interrupt%20events.%20Interestingly%2C%20when%20I%20connect%20the%20signal%20directly%20to%20the%20pin%2C%20IPWM%20reads%20the%20values%20correctly(so%20there%20is%20no%20issue%20in%20the%20IPWM).%3C%2FP%3E%3CP%3EHowever%2C%20I%20believe%20I%20found%20a%20workaround%20for%20the%20TRGMUX%20issue.%20By%20configuring%20the%20LCU%20output%20again%20as%20an%20eMIOS%20input%20pin%2C%20I%E2%80%99m%20able%20to%20retrieve%20the%20desired%20signal%20as%20required.%3C%2FP%3E%3CP%3E%3CSPAN%3EThat%20said%2C%20I%E2%80%99m%20facing%20a%20problem%20when%20trying%20to%20measure%20the%20%3C%2FSPAN%3E%3CSPAN%3Eperiod%3C%2FSPAN%3E%3CSPAN%3E.%20It%20works%20fine%20when%20the%20measurement%20mode%20is%20set%20to%20%3C%2FSPAN%3E%3CSPAN%3EDutyCycle%3C%2FSPAN%3E%3CSPAN%3E%2C%20but%20when%20I%20switch%20to%20%3C%2FSPAN%3E%3CSPAN%3EPeriod%3C%2FSPAN%3E%3CSPAN%3E%20mode%20(IP%20%E2%86%92%20IPWM)%2C%20I%20don%E2%80%99t%20get%20any%20values.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ECurrently%2C%20I'm%20using%20the%20%3C%2FSPAN%3E%3CSPAN%3EEmios_Icu_Ip_GetDutyCycleValues()%3C%2FSPAN%3E%3CSPAN%3E%20function%2C%20since%20the%20%3C%2FSPAN%3E%3CSPAN%3EGetPulseWidth()%3C%2FSPAN%3E%3CSPAN%3E%20function%20doesn%E2%80%99t%20return%20any%20values.%20How%20can%20I%20retrieve%20the%20period%20value%20when%20the%20channel%20is%20configured%20in%20IP%20mode%20using%20eMIOS_ICU%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EWould%20appreciate%20your%20help%20on%20this.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E**I%E2%80%99ve%20attached%20the%20comparator%20output%2C%20along%20with%20a%20reference%20to%20the%20%60Emios_Icu_Ip_GetPulseWidth()%60%20function.%20Since%20this%20function%20doesn%E2%80%99t%20return%20a%20value%2C%20could%20you%20please%20clarify%20how%20it%E2%80%99s%20intended%20to%20be%20used%3F%20Is%20it%20updating%20any%20internal%20register%20or%20buffer%20that%20we%20should%20access%20separately%3F%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22GaneshBhagwat_0-1745402522021.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22GaneshBhagwat_0-1745402522021.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F334473iA1D9BFC59542365C%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22GaneshBhagwat_0-1745402522021.png%22%20alt%3D%22GaneshBhagwat_0-1745402522021.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22GaneshBhagwat_1-1745402572591.jpeg%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22GaneshBhagwat_1-1745402572591.jpeg%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F334474iB6AA6817542CF74B%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22GaneshBhagwat_1-1745402572591.jpeg%22%20alt%3D%22GaneshBhagwat_1-1745402572591.jpeg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2084077%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Routing%20Comparator(LPCMP)%20Output%20to%20eMIOS%20(IPWM%20Mode)%20for%20Frequency%20Measurement%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2084077%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3EThank%20you%20so%20much%20for%20your%20interest%20in%20our%20products%20and%20for%20using%20our%20community.%3C%2FP%3E%0A%3CP%3EPlease%20try%20the%20following%20steps%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EEnsure%20IPWM%20measurement%20works%20with%20an%20external%20signal%20connected%20directly%20to%20a%20pin%20configured%20as%20eMIOS.%3C%2FLI%3E%0A%3CLI%3ERoute%20the%20CMP%20out%20signal%20to%20an%20external%20pin%20(through%20TRGMUX)%20to%20ensure%20the%20desired%20signal%2C%20for%20debugging%20purposes.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EHope%20it%20helps%20you.%20Please%20let%20me%20know%20your%20results.%3C%2FP%3E%0A%3CP%3EHave%20a%20nice%20day!%3C%2FP%3E%3C%2FLINGO-BODY%3E