Comparator CMP0_OUT no pad/pin output

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

Comparator CMP0_OUT no pad/pin output

ソリューションへジャンプ
783件の閲覧回数
grizzly76
Contributor I

With the FRDM-KV10 evaluation board I am able to check the operation of the CMP0 comparator by scanning the CMP0_SCR_COUT bit (switching of the FRDM-KV10 red LED) which validates the configuration of the inputs and the operation of the comparator.

BUT I can't get the comparator output to the PTC5 pin (which is frustrating when you want to have hysteresis set by external resistors).

Is this 3 instructions enough to have the output on PTC5 :

  ldr r0,=0x4004B014 //Pin Control Register n (PORTC_PCR5)
  ldr r1,=0x00000640 //PTC5 alt6 CMP0_OUT
  str r1,[r0]

Please see the "very little" assembler attached source file (I had to change the .S extension of the file for it to be attached).

タグ(4)
0 件の賞賛
返信
1 解決策
746件の閲覧回数
grizzly76
Contributor I

Yes, you must also put CMP0_CR1_OPE=1 to have the output redirected to a PAD/PIN. Now it works. Thank you for your attention.

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
747件の閲覧回数
grizzly76
Contributor I

Yes, you must also put CMP0_CR1_OPE=1 to have the output redirected to a PAD/PIN. Now it works. Thank you for your attention.

0 件の賞賛
返信
757件の閲覧回数
_Leo_
NXP TechSupport
NXP TechSupport

Hi,

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

Unfortunately we do not have an SDK example that shows how to use the Comparator Output (CMPO), there is just the cmp_interrupt and cmp_polling examples.

However to set the CMPO you just need to use the following registers:

_Leo__0-1712097500247.png

Hope it helps you.

Have a nice day!