Comparator CMP0_OUT no pad/pin output

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

Comparator CMP0_OUT no pad/pin output

Jump to solution
872 Views
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).

Tags (4)
0 Kudos
Reply
1 Solution
835 Views
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.

View solution in original post

0 Kudos
Reply
2 Replies
836 Views
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 Kudos
Reply
846 Views
_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!