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:

The STM32F746G-DISCO discovery board (32F746GDISCOVERY) is a complete demonstration and development platform for STMicroelectronics ARM® Cortex®-M7 core-based STM32F746NGH6 microcontroller.

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 Patrick McNamara 21 Jul 2016

Well 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 Erik - 22 Jul 2016