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

Tue Dec 27, 2016 9:21 pm

Hi, new user here, registered just for this project.

I’ve read the entire topic and at some time there was at least one report of the board being blown up because of a high input voltage. I don’t understand how this can happen, there is a a 1Meg input impedance which at 12V would let 12nA of current, well within the (built-in) ESD clamping diodes’ specifications. Though I haven’t been able to find the hard specs in any technical reference. Obviously this only applies if the series resistor is used.

Another topic which might be interesting: has anyone characterized the reading accuracy? I know it forms a voltage divider with the internal input impedance of the ADC stage (tens-hundreds of kiloohms) but does anyone have a real figure when using a 1MO resistor? Do these figures differ much between boards and/or input pins?

What’s the current consumption of the board (without LCD backlight) when running at max speed?

My final goal is to have a remote ‘disposable’ oscilloscope (like the Mooshimeter) to leave in the car/motorbike, paired with a BT serial module (HC05) or perhaps some cheap BLE module (for compatibility with iOS).

I’ll probably choose the HC05 since I have a few of those and I know it works well with PCs and Android phones, it has the required bandwidth (115kbaud should be ok) and is cheap (3-5$). My idea is to do the triggering on the board and feed the triggered data via serial. Best case scenario is 115200 / 10 baud (per byte of data) / 320px = 36 fps, I’d be happy with anything above 2 fps.

Tue Dec 27, 2016 10:34 pm

@brainwashed

Would this be a sort of Bluetooth scope with the display via iOS or Android ?
Or would it still retain the display ?

Tue Dec 27, 2016 11:09 pm

ThunderOwl wrote:ahull wrote:… but if you fancy doing the work in such a way that you can define the display type and automagically include the correct libs, then feel free to give it a go.

Tue Dec 27, 2016 11:22 pm

ThunderOwl wrote:ahull wrote: If you figure out the cause of your Windows serial woes …

Wed Dec 28, 2016 3:47 am

The reassignment of serial ports has never made much sense to me. I believe that Serial1 should always point to the UART1 pins.

I usually define my own serial port:
#define mySerial Serial1

Wed Dec 28, 2016 6:44 am

Thank You, Andy, those are amazing informative answers! Thanks for having a patience for me. And, thanks, fredbox – for your hints about serial definitions.

Wed Dec 28, 2016 9:43 am

ThunderOwl wrote:Thank You, Andy, those are amazing informative answers!

Wed Dec 28, 2016 2:32 pm

ahull wrote:
For stm32duino
USBSerial is defined in …/cores/MapleMapleОтладочные и вычислительные платы…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…Linux Journal /usb_serial.cpp and refers to the USB Conm port that libmaple provides.
The other serial ports are defined in ../cores/MapleMapleОтладочные и вычислительные платы…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…Linux Journal /HardwareSerial.h (the pin designations are defined in that file as far as I recall).

Wed Dec 28, 2016 2:58 pm

Since “Serial1” is already defined in the core lib, you should have:
#define serial_debug Serial1

Wed Dec 28, 2016 3:34 pm

ThunderOwl wrote:ahull wrote:
For stm32duino
USBSerial is defined in …/cores/MapleMapleОтладочные и вычислительные платы…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…Linux Journal /usb_serial.cpp and refers to the USB Conm port that libmaple provides.
The other serial ports are defined in ../cores/MapleMapleОтладочные и вычислительные платы…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…Linux Journal /HardwareSerial.h (the pin designations are defined in that file as far as I recall).

Wed Dec 28, 2016 3:50 pm

Thanks a lot for all the help. I will continue experiments later tonight (GMT+2 here, Latvia), but, so far I can say this:
I tried stevestrong suggestion, by my own logic I added baudrate (line in original code was serial_debug.begin(), I made it serial_debug.begin(9600)), and the fact is, if I put something like:

serial_debug.print(“Hello Thunder O-Scope”);
serial_debug.println(“Super Thunder O-Scope”);

under the
void loop()
{ …
then I am getting continuous output on terminal, so port definition is okay. But, none of O-Scope interactions is working. So, I guess I have to look what is not started, or maybe that SerialCommand library isn’t working. Will post my further results.

Wed Dec 28, 2016 10:39 pm

Success! I got serial interaction working, with default USB “MapleMapleОтладочные и вычислительные платы…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…Linux Journal serial” port (onboard USB socket). Problem was one line, that is present in original github INO file, and also later in INO file for fancy miniature TFT. This line (under “void setup”):
serial_debug.begin();
To get my serial working, I have to make it like this:
serial_debug.begin(115200);
or, even comment it out altogether works, for some magic reason!
So, my wild guess – maybe it makes working binary with that original line on “non-windows” systems, but gives surprise under Windows? Anyway, I am screamingly glad I got this working, it was eating my mind (but in a good way, kinda, it is interesting).
What would be proper way to tell about it on wiki or something?
And, when this is sorted out – I sure better have some physical control, like encoder, or buttons. New worm to drill my mind :-D Common, wormie… come here… ;)

P.S.: I am using terminal program “Termite 3.2”, COM port speed 115200, Flow control DTR/DSR, Append CR-LF.

Thu Dec 29, 2016 12:13 am

ThunderOwl wrote:Success! I got serial interaction working, with default USB “MapleMapleОтладочные и вычислительные платы…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…Linux Journal serial” port (onboard USB socket). Problem was one line, that is present in original github INO file, and also later in INO file for fancy miniature TFT. This line (under “void setup”):
serial_debug.begin();
To get my serial working, I have to make it like this:
serial_debug.begin(115200);
or, even comment it out altogether works, for some magic reason!
So, my wild guess – maybe it makes working binary with that original line on “non-windows” systems, but gives surprise under Windows? Anyway, I am screamingly glad I got this working, it was eating my mind (but in a good way, kinda, it is interesting).
What would be proper way to tell about it on wiki or something?
And, when this is sorted out – I sure better have some physical control, like encoder, or buttons. New worm to drill my mind :-D Common, wormie… come here… ;)

P.S.: I am using terminal program “Termite 3.2”, COM port speed 115200, Flow control DTR/DSR, Append CR-LF.

Thu Dec 29, 2016 7:33 am

We should post this on Wiki, for others with “unapropriate operation systems” :)
Andy, are you also going to try coding for encoders/touch control, or should I just dig mausi_mick work?

EDIT: about that solved problem, I sure did try before (while that line was “serial_debug.begin()”) every imaginable combination of baudrates and flow and text settings in several terminal programs (not just Termite), nothing.
Later I will do some experiments with hardware Serial1 too, will post how it goes there.

Thu Dec 29, 2016 9:22 am

ThunderOwl wrote:We should post this on Wiki, for others with “unapropriate operation systems” :)

Fri Dec 30, 2016 3:13 am

Hi ThunderOwl,

here my last code with touch, I prefere this version compared to the with the encoder(s).
I can use the encoders for other things, perhaps it’s possible to integrate an DDS (AD9850AD9850Аналоговые, логические и силовые компоненты…l be difficult to make 16.55Mhz from this board, I recommend you by something like a AD9850 board to generate your 16.55Mhz signals Flycatcher Fri Jul 28, 2017 3:15 pm Hi Roger! T…GD32F103RGT6 custom board /1) changing frequency with the encoder.

(36.73 KiB) Downloaded 204 times

Fri Dec 30, 2016 9:04 am

Hello all,
here is edited Andy’s original file, it is now working good with serial interaction (Windows 7 64-bit), using “BluePill” onboard USB (“MapleMapleОтладочные и вычислительные платы…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…Linux Journal Serial”):
P.S.: it is really just changing “serial_debug.begin()” to “serial_debug.begin(115200)”, nothing else (except comments).

Fri Dec 30, 2016 9:06 am

mausi_mick wrote:
here my last code with touch, I prefere this version compared to the with the encoder(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 -O-Scope-05.ino

Fri Dec 30, 2016 10:52 am

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 – aka “The Pig Scope”
PIGOL.JPG
PIGOL.JPG (21.63 KiB) Viewed 1264 times

Fri Dec 30, 2016 11:09 am

Yeah, we wish Pig-O-Scope to grow as a top most recognizable and loved scope in 2017 !! 8-)

Post a reply