ACMP 3 Setup not outputting

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

ACMP 3 Setup not outputting

ソリューションへジャンプ
2,120件の閲覧回数
User1956
Contributor II

MCUXpresso IDE v11.4.1 [Build 6260] [2021-09-15]

SDK_2.x_MIMXRT1160-EVK: Version 2.1.0

EVK1160 PCB

I am currently trying to setup CMP3, which would be configured as so:

hpuser90_2-1643234644508.png

 

In my peripheral config tool I believe I have it setup correctly:

 

hpuser90_1-1643233315070.png

I also made sure to setup the pins:

/*
* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
BOARD_InitPins:
- options: {callFromInitBoot: 'true', coreID: cm7, enableClock: 'true'}
- pin_list:

- {pin_num: K17, peripheral: CMP3, signal: 'IN, 3', pin_signal: GPIO_AD_30}
- {pin_num: J17, peripheral: CMP3, signal: 'IN, 4', pin_signal: GPIO_AD_31}
- {pin_num: L16, peripheral: CMP3, signal: OUT, pin_signal: GPIO_AD_19, pull_up_down_config: Pull_Up}

* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
*/

 

So at this point I expected the comparator to be functional. I have 3.3V at K17 (non-inverting input) and the DAC ref down as low as it will go. But I don't see L16 go high. Is there any additional setup needed for the comparator to work? 

 

0 件の賞賛
1 解決策
1,832件の閲覧回数
User1956
Contributor II

So to actually see the change state of any ACMP output pin you need to set the output as a pullup or it wont work. Is there any documentation that would explain why that is? As that is very confusing and based on the GPIO pad configuration it shouldn't need to be pulled up. 

元の投稿で解決策を見る

5 返答(返信)
1,833件の閲覧回数
User1956
Contributor II

So to actually see the change state of any ACMP output pin you need to set the output as a pullup or it wont work. Is there any documentation that would explain why that is? As that is very confusing and based on the GPIO pad configuration it shouldn't need to be pulled up. 

2,009件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @User1956 ,

  Sorry for my later reply because of Chinese Spring Festival.

  Could you please tell me why you need to use R14 if you are using ACMP3? Do you mean the demo code?

  If yes, the R14 is GPIO_AD_01, it is the ACMP1_IN2 pin.

kerryzhou_0-1644208993657.png

As the SDK demo code is using:

#define DEMO_ACMP_MINUS_INPUT 2U

So, the demo code using r14:

kerryzhou_1-1644209088500.png

But, to your ACMP3, you need to select the related input pin:

kerryzhou_2-1644209121444.png

 

Now, your main issues is the ACMP3 no output in the output pin, right?

Please give me more details about your issues, then I will find time to help you to test it.

Best Regards,

Kerry

 

 

0 件の賞賛
2,098件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @User1956 ,

  Please run this code SDK code for the ACMP at first:

SDK_2_11_0_MIMXRT1160-EVK\boards\evkmimxrt1160\driver_examples\acmp\polling\cm7

Whether it works or not?

  Then, use your own CFG code, in the main, also use the printf:

while (true)
{
GETCHAR();
statusFlags = ACMP_GetStatusFlags(DEMO_ACMP_BASEADDR);

/* Check the comparison result. */
if ((kACMP_OutputAssertEventFlag == (statusFlags & kACMP_OutputAssertEventFlag)))
{
PRINTF("The analog input is LOWER than DAC output\r\n");
}
else if ((kACMP_OutputAssertEventFlag != (statusFlags & kACMP_OutputAssertEventFlag)))
{
PRINTF("The analog input is HIGHER than DAC output\r\n");
}
else
{
/* The input state has no change. */
}
}

 

About the  GPIO_AD_19 L16 , do you configure the pinmux?

kerryzhou_0-1643348802921.png

This is the ALT1, you need to configure the pinmux, select the pin as the ACMP3_OUT

IOMUXC_SetPinMux(
IOMUXC_GPIO_AD_19_ACMP3_OUT, 
0U);

Then test it again.

Wish it helps you!

Best Regards,

Kerry

0 件の賞賛
2,052件の閲覧回数
User1956
Contributor II

Any additional thoughts to my follow up?

0 件の賞賛
2,085件の閲覧回数
User1956
Contributor II

Hello Kerry,

 

So I tried the example that you recommended and yes, it seems to work as described. But it actually has me much more confused as pin R14 (pin for the voltage signal) is not linked to any CMP peripheral. In fact the pinmux does not even show that pin set as anything in the examples pinmux and yet it somehow works. 

Also, yes, i enabled the output to GPIO_AD_19 L16.

So how does this example apply to what I am doing as I am using an actual comparator in the Processor and the example seems like it is just a logical comparator  with no configuration setup?

0 件の賞賛