Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
11 years, 8 months ago.
Comparator on FRDM-KL25z
So I just got a FRDM-KL25z board. I read in the user-manual that there is a high-speed analog comparator on board. How might I go about using this? I can't find anything on this anywhere.
2 Answers
11 years, 6 months ago.
I just finished creating a KL25Z comparator library (initial release - probably needs improvement - comments are welcome):
Library : http://mbed.org/users/frankvnk/code/ComparatorIn/
Demo : http://mbed.org/users/frankvnk/code/ComparatorIn_demo/
mbed pinmap.h is available at https://github.com/mbedmicro/mbed/blob/master/libraries/mbed/hal/pinmap.h You probably meant pinnames.h https://github.com/mbedmicro/mbed/blob/master/libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KLXX/TARGET_KL25Z/PinNames.h
posted by 16 Oct 201411 years, 8 months ago.
The standard mbed library doesn't support it, and unless someone else already made a library for it, you will have to do it yourself. The reference manual helps with that: http://cache.freescale.com/files/32bit/doc/ref_manual/KL25P80M48SF0RM.pdf (chapter 29), and possibly with some googling you might find example programs using it.
Hey Guys,
Micro controller chips have had analog comparators for years. Even my 8 bit Atmel chips had them and they are quite useful. It really should be part of the standard library. It looks like Frank has a good start now it just needs to be generalized so it can support all the chips that have the hardware built in.
posted by 23 Mar 2016