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).
已解决! 转到解答。
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:
Hope it helps you.
Have a nice day!