Comparator CMP0_OUT no pad/pin output

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Comparator CMP0_OUT no pad/pin output

跳至解决方案
939 次查看
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 解答
902 次查看
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 回复数
903 次查看
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 项奖励
回复
913 次查看
_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!