Spark Logic

$10 O-Scope revisited

Over the last few days I’ve been playing with Ray’s STM32STM32Микроконтроллеры и процессоры…Map magic glue code, ethernet compiles, just WARNING: library LwIP claims to run on [ stm32 ] architecture(s) and may be incompatible with your current board which runs on [STM32]…[STM32GENERIC] F429i Discovery Oscilloscope idea.

Image

Some preliminary results are available here..

https://github.com/pingumacpenguin/STM3 … ontruction

My take on the Scope Sketch is here..

https://github.com/pingumacpenguin/STM32-O-Scope

Its a fun little project and well worth building just for the entertainment value. Currently bandwidth is a little limited, but with a little extra effort it would be possible to make a fully functional 2MHz Scope for next to nothing. Ideal for probing i2c, audio and other low speed signals.

EDIT: We managed to squeeze the maximum speed out of the ADC, read further through the thread for details. The github code includes all of the enhancements made of the course of this thread.

Replies20

Mon Jan 16, 2017 7:39 pm

Back again with my issues. Soldered a 1.8k resistor on top of R10 (10k) bringing the equivalent resistance to 1.55k, so it’s now in spec. But the board behaves the same.
Just to be clear: 72MHz, Boot0 set to 1 while programming, 0 when booting, programming via serial. Is this correct?

If I leave serial_debug.begin() as is I first need to power the board, then connect it to USB, otherwise I get ‘unknown device’. The PC13 led blinks about 5 times/second (trigger?), I can connect to the usb serial port, type ‘s’ but nothing get received. If I type ‘h’ I expect the blinking to stop but it doesn’t. So no reply from the USB serial port.

If I do serial_debug.begin(115200) the PC13 remains lit at all times after booting, usb serial is not recognized. Same thing happens if I switch the frequency to 48 MHz.

Just to be clear, trying a simple sketch with usb serial output works.

I will try putting all TFT- and SPI-related code into #ifdef blocks.

Edit: it’s related to the serial USB (CDC) port, somehow it’s not working. Not sure what to do, I have the same problem on both boards. Driver related? Should I flash another bootloader?

Mon Jan 16, 2017 9:15 pm

brainwash wrote: Driver related? Should I flash another bootloader?

Mon Jan 16, 2017 10:07 pm

ThunderOwl wrote:brainwash wrote: Driver related? Should I flash another bootloader?

Mon Jan 16, 2017 10:16 pm

brainwash wrote:
Thank you! That did the trick, I was using the github bootload prior to this.
I still have to power the board first then plug USB (or reset board, disconnect hub from computer, reconnect to computer), but it’s a minor annoyance.

Tue Jan 17, 2017 9:53 am

mausi_mick, I would like to ask you, help me to decide: about DDS module. Order or not? :D
I mean – what are your thoughts, is this addition good enough, or maybe not worth it? I don’t know quality of those modules, is it worth those about 12 dollars? Simply your personal thoughts, please :)

Tue Jan 17, 2017 12:42 pm

Hi ThunderOwl,

I think it’s ok for this price, but I haven’t found detailed info to the board or a schematic.

Their a two sinus outputs and two for square-wave (0-1Mhz), but no signal on it ?

I want to generate from the sinus other signal-forms with a schmitt-trigger (and integrator ?).

Here I found more infos to the AD9851AD9851Аналоговые, логические и силовые компоненты…integrate Touch-functionality (URTOUCH-Lib) and test it with frequency input for DDS AD9851 : the first picture shows the Touch Panel for set frequency, the second the selected fr…DLO-138 OScope :

http://www.edn.com/design/test-and-meas … -generator

Tue Jan 17, 2017 1:09 pm

Converting a s variable-frequency square wave to sine is pretty hardcore. You need tunable filters, there are dedicated chips that do that. That is the difference between 10, 50 and 5000$ signal generators. Plus impedance and phase stability, THD, offset, protection.
For low frequencies you are better off using your phone or a computer. For low-medium frequencies I bought a FY3200SFY3200SМодули, приборы и готовые устройства…are better off using your phone or a computer. For low-medium frequencies I bought a FY3200S for ~70$. For anything else the only affordable option is second-hand lab gear. The DD…$10 O-Scope revisited for ~70$. For anything else the only affordable option is second-hand lab gear.
The DDS module is just a toy, fine if you want to play and figure out how DDS works and its limitations. It will also output a useable low-level signal if you give it the right input and the stars align. To improve it you need a strong LP filter (for sine waves) like in the linked article and a well-designed output buffer.
Just my 2c.

Tue Jan 17, 2017 1:29 pm

This (attached) looks like chinese module schematics. In any case, chip is basically generating just a sine wave, and that square wave option is just feeding sine wave to one of internal comparator inputs, and setting DC value (threshold, kinda) to other input. To compare. There is a pot for that DC level. Check connections around comparator pins, also maybe just pot is in one of min or max positions.
Some tutorials suggest you better use some higher quality external comparator to form square wave, if needed.

Tue Jan 17, 2017 1:43 pm

brainwash wrote:Converting a s variable-frequency square wave to sine is pretty hardcore.

Tue Jan 17, 2017 2:30 pm

Hi,
with the HC14 it’s ok for lower frequency (20MHz?), but you have something to do with the duty ratio:
ST M32_O_Scope_AD9851AD9851Аналоговые, логические и силовые компоненты…integrate Touch-functionality (URTOUCH-Lib) and test it with frequency input for DDS AD9851 : the first picture shows the Touch Panel for set frequency, the second the selected fr…DLO-138 OScope _HC14_Schmitttriger.JPG
ST M32_O_Scope_AD9851AD9851Аналоговые, логические и силовые компоненты…integrate Touch-functionality (URTOUCH-Lib) and test it with frequency input for DDS AD9851 : the first picture shows the Touch Panel for set frequency, the second the selected fr…DLO-138 OScope _HC14_Schmitttriger.JPG (37.76 KiB) Viewed 1501 times

Wed Jan 18, 2017 11:05 am

Hey, everyone! I just found another osci project (again, in enormously wide fields of russian-speaking DIY-ers), and, in some ways, it is eerily similar to our “O-Scope” – It is mostly just STM32STM32Микроконтроллеры и процессоры…Map magic glue code, ethernet compiles, just WARNING: library LwIP claims to run on [ stm32 ] architecture(s) and may be incompatible with your current board which runs on [STM32]…[STM32GENERIC] F429i Discovery “Bluepill” board, and it has option to use DDS module AD9851AD9851Аналоговые, логические и силовые компоненты…integrate Touch-functionality (URTOUCH-Lib) and test it with frequency input for DDS AD9851 : the first picture shows the Touch Panel for set frequency, the second the selected fr…DLO-138 OScope . Weird, eh? … But, what is different – it is Bluetooth/USB connection device, and has Android APK, and also Windows GUI. I sure added it to my GLODS (Giant List Of Diy Scopes):
I just found another one, and it is STM32STM32Микроконтроллеры и процессоры…Map magic glue code, ethernet compiles, just WARNING: library LwIP claims to run on [ stm32 ] architecture(s) and may be incompatible with your current board which runs on [STM32]…[STM32GENERIC] F429i Discovery , and really simple and interesting – I am definetely going to build it! Well, not much to actually “build” there, really. It is this one in list:
S-14-(RU) STM32F103STM32F103Микроконтроллеры и процессоры…19.html . ag123 Sat Apr 28, 2018 5:54 pm come to think of it blue pill / maple mini ( stm32f103 ) is an *ideal* keyboard controller, the scanning can be done with assistance of sh…[SOLVED] generic blue pill clone as USB keyboard , Bluetooth, Android, Windows
https://www.youtube.com/watch?v=dQIyseS2jts (corrected wrong link, good now)
http://forum.easyelectronics.ru/viewtop … 17&t=27404
Archives in forum has schematics, ready .HEX, ready .APK, ready Windows .EXE
Last forum entry is october 2016, so now I am going to join a discussion, say “Boljshoe Spasibo”, and ask is there advances planned, and maybe sources shared. There is one important thing that we (O-Scopists) could adapt from that device: input stage with cheap programmable gain OpApm (MCP6S21MCP6S21Аналоговые, логические и силовые компоненты…pists) could adapt from that device: input stage with cheap programmable gain OpApm ( MCP6S21 ). Other opamp (any Rail-to-Rail) in that schematics is for moving displayed graphic…$10 O-Scope revisited ). Other opamp (any Rail-to-Rail) in that schematics is for moving displayed graphic up/down.
Well, I am exited about this finding. Gonna try it very soon. And looks like I really need some DDS module(s)…
EDIT jaunary 22:
My initial tests, without input circuit:
http://bildites.lv/a/7cup2kep#2k6sm4rg
tested on two different china STM32STM32Микроконтроллеры и процессоры…Map magic glue code, ethernet compiles, just WARNING: library LwIP claims to run on [ stm32 ] architecture(s) and may be incompatible with your current board which runs on [STM32]…[STM32GENERIC] F429i Discovery modules (shown in pics)

Wed Jan 18, 2017 2:10 pm

The video link is the wrong one, it points to an FPGA based o-scope…

I have that MCP6S21MCP6S21Аналоговые, логические и силовые компоненты…pists) could adapt from that device: input stage with cheap programmable gain OpApm ( MCP6S21 ). Other opamp (any Rail-to-Rail) in that schematics is for moving displayed graphic…$10 O-Scope revisited /2 addition in my “to-do” list already :) but still to do…

Thu Jan 19, 2017 12:06 am

Hi everybody!
I’ve finished a scope based on the original STM32STM32Микроконтроллеры и процессоры…Map magic glue code, ethernet compiles, just WARNING: library LwIP claims to run on [ stm32 ] architecture(s) and may be incompatible with your current board which runs on [STM32]…[STM32GENERIC] F429i Discovery -o-scope and it works great! However, I’d like to know how to implement frequency measure, so we could see both waveform and frequency. Any ideas?

Thu Jan 19, 2017 12:25 am

For that, you should find peaks high and low, and then calculate the delta in time, you will then be able to display frequency.
Maybe you will need to average that value and refresh display of that value only once in while in case it is drifting too much, otherwise, it will be difficult to read.

Thu Jan 19, 2017 4:04 pm

I found this library for Arduino and TeensyTeensyОтладочные и вычислительные платы…true ide.contributions.boards.support.urls.wiki= ide.create_platforms_from_boardsTXT. teensy =build.core vm.debug=true software=ARDUINO ssh.user.name=root ssh.user.default.passwor…Blue pill reading Winbond 25Q80 SPI flash https://www.pjrc.com/teensy/td_libs_FreqCount.html that counts cycles during a reference time, but it seems to write to registers directly, so I don’t know how to do it in STM32STM32Микроконтроллеры и процессоры…Map magic glue code, ethernet compiles, just WARNING: library LwIP claims to run on [ stm32 ] architecture(s) and may be incompatible with your current board which runs on [STM32]…[STM32GENERIC] F429i Discovery .

Thu Jan 19, 2017 8:04 pm

Vitorbnc wrote:I found this library for Arduino and TeensyTeensyОтладочные и вычислительные платы…true ide.contributions.boards.support.urls.wiki= ide.create_platforms_from_boardsTXT. teensy =build.core vm.debug=true software=ARDUINO ssh.user.name=root ssh.user.default.passwor…Blue pill reading Winbond 25Q80 SPI flash https://www.pjrc.com/teensy/td_libs_FreqCount.html that counts cycles during a reference time, but it seems to write to registers directly, so I don’t know how to do it in STM32STM32Микроконтроллеры и процессоры…Map magic glue code, ethernet compiles, just WARNING: library LwIP claims to run on [ stm32 ] architecture(s) and may be incompatible with your current board which runs on [STM32]…[STM32GENERIC] F429i Discovery .

Thu Jan 19, 2017 11:27 pm

Thanks for all the help, after a bit of research it is working! The solution I found was using another pin for frequency counting and connect it to the scope input. I’ll attach the code I wrote in case anyone is interested ;)

Thu Jan 19, 2017 11:59 pm

OK that is a much smarter way of doing this I suspect. :D

Post a reply