Spark Logic

$10 O-Scope revisited

ahull Sat May 09, 2015 12:56 pm

Over the last few days I’ve been playing with Ray’s STM32 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.

Replies

ahull Fri Jun 05, 2015 12:02 am

I connected up the touch screen, and thanks to some good advice from Matthias I now have some rudimentary touchy feely pigscopery.
Changes pushed to git for those who want to join the party.

victor_pv Fri Jun 05, 2015 2:48 am

ahull wrote:I connected up the touch screen, and thanks to some good advice from Matthias I now have some rudimentary touchy feely pigscopery.
Changes pushed to git for those who want to join the party.

Rick Kimball Fri Jun 05, 2015 2:52 am

ahull wrote:I connected up the touch screen, and thanks to some good advice from Matthias I now have some rudimentary touchy feely pigscopery.
Changes pushed to git for those who want to join the party.

ahull Fri Jun 05, 2015 8:27 am

Rick Kimball wrote:ahull wrote:I connected up the touch screen, and thanks to some good advice from Matthias I now have some rudimentary touchy feely pigscopery.
Changes pushed to git for those who want to join the party.

RogerClark Fri Jun 05, 2015 8:56 am

Well, The VS1003 lib works playing MP3 for me

I just need to find an Oink.mp3

ahull Fri Jun 05, 2015 9:10 am

RogerClark wrote:Well, The VS1003 lib works playing MP3 for me

I just need to find an Oink.mp3

ahull Sat Jun 06, 2015 10:06 pm

I’m thinking of rewriting the Pigscope code to use the UTFT and UTouch libraries, does anybody have any thoughts on this before I head off down this path? Is UTFT likely to be slower or quicker than the Adafruit library for example?

RogerClark Sat Jun 06, 2015 10:13 pm

Andy

Are you intending to use the same display ?

btw.what display are you currently using ?

I suspect that a parallel display using UTFT will be much better for a scope (if you are using SPI the update rate would be a bit low wouldn’t it ?)

Ps. I have a parallel display I was thinking of trying on one of my larger boards
Bt I suppose the F103C boards will struggle to have enough pins,

Ie I think my display is 16 bit address / data, plus 4 control lines

ahull Sat Jun 06, 2015 10:38 pm

RogerClark wrote:Andy

Are you intending to use the same display ?

RogerClark Sat Jun 06, 2015 11:48 pm

Andy

Ok about your display. Yes. Plotting a few points, probably won’t be that much faster on parallel

Re: Parallel on C series

It has touch as well, but I suspect there won’t be enough pins for all of that on a C8 :-(

Looking at at my Red Pill board, it doesn’t have all 16 pins on the same port broken out, (either A or B), which would impact performance, as you’d need to split stuff up, perhaps 8 bits on port A and 8 on port B, and if you had to do individual bit manipulation and not even do banks of 8 bits, the performance is likely to end up lower than using SPI :-(

I think perhaps the parallel displays are best suited to the bigger R, V or Z series boards

JensEP Sun Jun 07, 2015 7:26 pm

RogerClark wrote:

I think perhaps the parallel displays are best suited to the bigger R, V or Z series boards

ahull Sun Jun 07, 2015 7:38 pm

I think I got my touch screen issues more or less ironed out. I still need to write my own built in calibration routine, but I now understand a lot more about the UTouch routine, and the controller itself. As a result, I am now getting pretty good, accurate and fast results from the touch screen.

Image

Image

If nothing else I now have my very own Etch-a-sketch. :D
EDIT: If you want to play with this as it currently stands, I have pushed my changes to github. You will need the IDE serial monitor running to use it as an etch-a-sketch, because it spits out the co-ordinates on the serial debug as it runs, so eventually it will stop plotting if the serial monitor is not running.

For the record, I currently have these calibration values in my UTouchCD.h but once the pigscope touch calibration routine is written I’ll store over-rides in nvram.

// PIGSCOPE AGAIN
#define CAL_X 0x0388C10FUL
#define CAL_X 0x004E0D7AUL
#define CAL_S 0x000EF13FUL

victor_pv Mon Jun 08, 2015 12:34 am

And still under $10 :)

mrburnette Mon Jun 08, 2015 12:40 am

victor_pv wrote:And still under $10 :)

madias Mon Jun 08, 2015 8:36 am

Nice to see, that everything is working!
But hey! Maybe this is a market niche: A DSO with on screen notepad function! :)

ahull Fri Jun 26, 2015 10:34 pm

I’ve not had much time to play with this recently, I’ve had visitors, work commitments and a couple of nasty bouts of flu, but I’ve still got a number of improvements in mind.

The first is frequency analysis (FFT). I intend to start with something along these lines unless someone has a better suggestion. The “Numerical Recipes in C” mentioned on that page is available here.

RogerClark Fri Jun 26, 2015 11:00 pm

Andy

My Rigol scope has some excellent Measurement features, which would probably be easier to implement than FFT.

I cant remember the full list, but it does Frequency and Time measurements (assuming the waveform is periodic), and will measure the time of the low or high parts of the waveform

it also measures voltage, VRMS and peak to peak etc

I find these quite handy

you could also add cursors, e.g. measure delta T or delta V etc

ahull Tue Jul 21, 2015 7:50 pm

Well.. I hinted at this before, but it seems someone beat me to the punchline…

http://hackaday.com/2015/07/21/fast-adc-for-laser-lab/

It seems that with a little touch of smoke and mirrors we might get circa 48MHz of squealing pig bandwidth (on repeating signals of course) out of our 1MHz ADC… potentially even 72Mhz or even higher if the STM32 variant has ADC has three or more channels.

All I need now is a little of that magic missing ingredient .. spare time to tinker… unless someone else beats me to the punchline again of course.

Even if I/we never get around to trying this, the HAD article and the writeup is well worth a read.

gdenton61 Fri Jul 24, 2015 1:42 am

Hey guys,
Trying to compile the sketch with IDE 1.6.5 on Win7 but it fails – it says the functions called from setup() and loop() haven’t been declared before they are called.
I can get around this by declaring the functions first or by moving setup() and loop() to the bottom but surely I shouldn’t have to do either.

Any ideas?

RogerClark Fri Jul 24, 2015 2:04 am

What do you get if you try to compile an empty / default sketch with just setup() and loop()

Sign in to reply