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.
7 years, 9 months ago.
Comparator?
Hey guys, I'm trying to implement a voltage comparator. I think the best solution would be to use RTOS and a thread for sampling the ADC channels I decide to choose. Anyone have another idea? I don't think I can use the hardware layer of the comparators since I have not seen any mbed support for them.
Question relating to:
1 Answer
7 years, 9 months ago.
You can always use the hardware comparator if they exist on your MCU, however you either will need to write the code yourself, or search if another user already wrote something. Besides the mbed code you can always use 'regular' code for the MCU.
Yeah, it's the 'regular' code that I was hoping to avoid completely. mbed was nice because it abstracted everything for me and I could focus on coding instead of hardware set up and writing drivers myself.
posted by 21 Jul 2016Well you can indeed that way make a poor mans comparator. You can use a thread and RTOS, but if you want to do that depends on the rest of your program: If you use RTOS anyway, sure go ahead. If you don't just put it either in your main loop or in a Ticker. Don't get RTOS just for that.
posted by 22 Jul 2016