madias wrote:Interesting project!
I own a DSO nano (also STM32 powered) with benq firmware and the tools is really useful (I use it for audio data).
It would be interesting if there is a possibility to get 2 (or more) channels out of it (with half speed or so).
I have seen the DSO nano and indeed almost bought one, but opted instead to buy a second hand analog scope, with 40MHz bandwidth...
I couldn't really justify a big spend on something that would only get occasional use, since I have access to a couple of scopes in my office, so that meant second hand, and since my background is electronics I opted to pick up a broken one and repair it. Details of my repair are here http://www.badcaps.net/forum/showthread.php?t=42768
and here http://www.electro-tech-online.com/threads/repairing-a-metrix-ox-8050-digital-oscilloscope.142398/
The DSO nano uses a better approach to both sampling and triggering, which I may adopt. As it currently stands, the Arduino sketch uses possibly the least effective method, a polling loop of analogRead() and thus is limited in both bandwidth and triggering ability.
See the manual in the firmware download for more details of how the DSO manages the 1MHz bandwidth and triggering tricks. http://www.seeedstudio.com/forum/viewto ... 1793#p5965
My idea was to demonstrate the abilities of the Arduino for STM32 port, rather than to produce a DSO nano clone. I am however now hooked on the idea of improving the current sketch to see what is possible. If I can get 2 x 1 MHz sampling I'll be happy.
The DSO uses the STM32F103VBT6 - and the BenF firmware is open source so in theory you should be able to run the firmware on a STM32F103VBT6 dev board. Equally it should be possible to adopt or adapt the ADC methods used and port them to the STM32F103C8XX
My next target is therefore likely to be ADC Reading + DMA - with an eye on getting 2 x 1MHz or 1 x 2MHz sampling and better triggering - assuming I can find the time. If anybody else has any suggestions feel free to post them.
Currently by unwrapping the analogRead() function and using the "how it works" of this to spin a tight adc_read() loop I can manage 6000 samples in 41152 us or around 145,793 samples per second which gives a theoretical bandwidth of 72,900 Hz and although this is pretty good, (plenty for audio work) we can do better.
Edit: Actually I'm grabing 1024*6 = 6144 samples so that actually equates to 149,300 samples/sec or 6.6979 us per sample for a theoretical bandwidth of 74,650 Hz ... or to put it another way about 15% of the theoretical maximum... we can certainly do better.