Skip to main content
sjenyart
Associate II
October 1, 2012
Question

Question about continuous sampling of multiple ADC channels

  • October 1, 2012
  • 13 replies
  • 3059 views
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
This topic has been closed for replies.

13 replies

Tesla DeLorean
Guru
December 18, 2012
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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
terence-b
Associate III
December 20, 2012
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

Tesla DeLorean
Guru
December 20, 2012
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 (See Profile) Up vote any posts that you find helpful, it shows what's working..