2019-05-13 01:58 AM
Solved! Go to Solution.
2019-05-14 11:23 AM
Well, I can think of at least a dosen of ways to do that - you will have to be more explicit if you want an answer.
Depending on the MCU you have, you could use the ADC in continuous conversion mode, where the ADC scans multiple channels and the DMA transfers automatically the results into SRAM. Than, in the DMA interrupt you can process your results. This is a very efficient solution, and a great thing on an 8-bit MCU.
Reading and understanding the Reference Manual would be the best thing for you to do, like this you get a good idea of what you could do and how.
2019-05-14 11:23 AM
Well, I can think of at least a dosen of ways to do that - you will have to be more explicit if you want an answer.
Depending on the MCU you have, you could use the ADC in continuous conversion mode, where the ADC scans multiple channels and the DMA transfers automatically the results into SRAM. Than, in the DMA interrupt you can process your results. This is a very efficient solution, and a great thing on an 8-bit MCU.
Reading and understanding the Reference Manual would be the best thing for you to do, like this you get a good idea of what you could do and how.
2019-05-15 05:05 AM
Thanks for reply
i use stm8s003 controller
i want use ADC for voltage and current measurement.
so we required example code which read TWO adc channel read continuously on interrupt .
Please provide example code step of multiple ADC channel read on interrupt based.
2019-05-19 02:32 AM
Hi!
The STM8S003 does not have a DMA controller, so you'll have to manually handle each ADC conversion result (or set of results).
You can use it in single scan mode, or continuous scan mode - probably the continuous scan mode is appropriate if you want to monitor voltage and current.
You ask for sample code: this is not easy to get, as it depends a lot on the programming environment you use and how you want your software to work, but it's all very easy: setup the ADC in continuous conversion mode with the enabled channels that you need, enable the ADC interrupt and start the conversion. Than, the interrupt informs you when a new conversion set is ready.
Try reading and understanding the RM0016 manual, write your own code and if you encounter problems, just ask.
2019-05-21 04:30 AM
Thanks so much for provide a guidance.
we use two ADC channel 5 and 6 but i confuse how to read buffer
and how to clear interrupt flag.
i required sample code only read multiple channel in continuous mode on interrupt based if it have this type of sample please provide us