cancel
Showing results for 
Search instead for 
Did you mean: 

Question about continuous sampling of multiple ADC channels

sjenyart
Associate II
Posted on October 01, 2012 at 21:54

I would like to continuously sample multiple (~5) channels, preferably with no CPU triggering after the initial setup.  I had been thinking that we would just set up a continuous regular group and then pass back pointers to the the data registers and/or copy the conversions back in the IRQs on a per-channel basis for provision to the application on demand.

However, browsing the docs, my understanding is that all channels in the regular channel group will write their conversions to the same data register meaning that each channel will overwrite the previous channel's conversion and an EOC will occur with only the last regular channel in the SQR having data stored.

I am new to ARMs but this seems odd to me. I would expect to have a data register for each channel or perhaps a queued DR buffer. Am I missing something?

It looks like the best option, given what I would like to do, will be to set up only a single channel in the regular group and then chain up to 4 injected channels to that EOC by  setting CONT and JAUTO (Auto-injection, since the injected group has a DR for each channel in the group).

Any thoughts?

#adc
13 REPLIES 13
terence-b
Associate II
Posted on December 18, 2012 at 16:51

It seems that for the M4 it also works. However, I think the ADC is not giving the correct value. It would be better if I have some sort of interface by which to communicate with the MCU, instead of relying on the 'break' command for observing the ADC values. I know that such interface tools do exist. Can you suggest any communication tools for the STM32F4 please?

Posted on December 18, 2012 at 17:25

The forum is for all STM32 parts.

If your design is head-less (ie no LCD), the easiest why to get telemetry from the board would be to use one of the USARTs and attach a serial terminal.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
terence-b
Associate II
Posted on December 20, 2012 at 10:01

Hi 

I was going to use the Virtual Com Port. I obtained the HyperTerminal from Windows XP onto Windows 7. Then, I tried to install the virtual com port driver from the ST website. This driver was found under the  

STM32L152C6

.

However, I'm using the STM32F4Discovery and in the Control Panel/Device Manager - Ports, the Virtual Com Port does not appear.

I realise that the virtual com port was not initially intended for the Discovery. Is there a way I can go around this? 

I tried to follow the Virtual Com Port Demo in UM0424, but I'm confused a lot.

I would greatly appreciate any help.

Thanks in advance,

Terence

Posted on December 20, 2012 at 13:59

The VCP examples in the USB library have to be ported to the STM32F4-Discovery board as they target the EVAL series boards.

You'd connect a second USB cable to the A-B port on the Discovery board.

I've ported the VCP example to the STM32F4-Discovery and have it forwarding to/from a USART, with projects for GNU/GGC and Keil. You'd need to tailor it to you specific needs/application.

https://docs.google.com/open?id=0B7OY5pub_GfIeVpqZXZLWEVrNWc

https://docs.google.com/open?id=0B7OY5pub_GfIdnREeExyRWNXbFE

http://www.st.com/internet/com/SOFTWARE_RESOURCES/SW_COMPONENT/SW_DRIVER/stm32_vcp.zip

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..