0
votes

After searching for a veeery long time (more then 3 months) in all the main places where to get info and reading the datasheet of the chip I would like to ask the STM32 specialists inhere if there is a example for using the ADC maybe with DMA from the arduino IDE. I did see some incomplete parts inhere and for other compiler/IDE environments. But maybe i did not strike the good luck of finding the right info (that even i can understand) yet for what i need. Your help is much appreciated.

I want to sample audio data, one channel 30KHz plus, 12 bits and each time 16 samples are taken an interrupt to handle the data that is in an array.

I have seen the pigOscope code (it uses analogread) and the info about analogread where there is stated this command is not meant for higher sampling speeds So that got me sort of into conflict with myself .... Who can break me out of my endless brainloop .....?;

Greetings ... Eric.

1
Instead of searching just read the Reference Manual and write the code using the registers directly. It will be about 30 lines of code including clock initialization, calibration and the DMA interrupt routine0___________
PS and forget about aruino IDE. It is the worst possible choice.0___________
just read the Reference Manual and write the code using the registers directly – P__J__ ( thanks – P__J__ for your response .. that is just what i will do ........ )( what is your choice of ide ?)Eric
Install atollic studio0___________
for deeper understanding you can try write your own Makefile(you will find out different compiler flags, linker and other stuff) . You can use any text editor(vim,sublime,atom or any other, even notepad).David.O

1 Answers

1
votes

I have seen the pigOscope code (it uses analogread)

I wrote the Pig-o-scope code, with a lot of input from others at stm32duinocom and if you take the time to read the code, which I will grant you is somewhat simplistic, you will discover that analogRead is only used to trigger. The code uses DMA to do the high speed transfer.

I completely agree with the comment that you dont't need the Arduino IDE, you could "borrow" the DMA code and tailor it to your needs. However if you want a quick and dirty coding and prototyping environment, then there is nothing wrong with using the Arduino IDE. Take a trip to the stm32duino.com site, and you will see that I along with a lot of the other developers use the Arduino IDE, and Eclipse, and Atollic, and roll our own batch files, use vi, etc etc. It all depends on what you are trying to do, and in many cases using the Arduino IDE gets you to working result a lot faster than learning an entire new IDE, just for one task.

But then again, I'm firmly on the side of vi in the vi/emacs wars, so what the heck do I know. Just don't use nano. ;¬)