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

Fri Dec 30, 2016 11:39 am

Pito wrote: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

Fri Dec 30, 2016 11:48 am

rexnanet wrote:
I’ve just received mt encoders and I’m going to work on mt vision of the encoder option.
I think that using the touch ou such a small screen is not very practical…

Fri Dec 30, 2016 4:57 pm

I think with the small displays it’s not so comfortable with the touch, but with the 2.8″ it’s not godd, but possible.
But I will test with two encoders next year.

Fri Dec 30, 2016 8:05 pm

hey guys

FINALLY got my screen after two months and uploaded a working version of the oscilloscope. Hooooooowever if I try to change the settings (over the Arduino serial monitor) nothing happens. Could it perhaps be that I’m usb to TTL to upload and read from the 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 ? (I’m using one that looks like this http://www.ebay.com/itm/Replace-Pl2303- … SwHaBWi4TV )

I have it hooked up to PA9 and PA10 to upload the data (and later read it), with normal sketches at least. With the oscilloskope sketch, I get nothing on the Serial monitor, but the oscilloscope itself (aka display) seems to be working properly.

I’ve only tried the original version without the rotary switches.

Does anyone know how to solve my problem? Also…should I just buy some rotary switches and hook it up that way? How’s the speed on that version (and also bugs?)

Fri Dec 30, 2016 8:35 pm

See my recent posts. Got serial interaction working only on onboard USB-Serial port (“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” in Windows device manager). On hardware serial (A9,A10) experiments are unsuccesful, so far.

Sat Dec 31, 2016 11:21 pm

HaPPy NeW YeAr !! 8-)

Sun Jan 01, 2017 1:55 pm

Happy New Year from Munich !

I make a ne version, changing functions with two switches (interrupt) and parameters with one rotary encoder.

I have at the moment realized it for function timeBase (=1) and yPosition(02).

P1020605.JPG
P1020605.JPG (100.16 KiB) Viewed 1213 times

Sun Jan 01, 2017 3:07 pm

Great, mausi_mick! Give to Santa your code and more pictures of construction, so he can bring us this present! :)

Sun Jan 01, 2017 4:13 pm

Hi ThunderOwl,

I have changed the code a liitle bit, I think there was to much code in the isr-functions.
Now the isr and the encoder-functions are smaller, I moved the tft-code on the start of the loop().

And changed the tft.text-size to 2.
And have some more functions realized !

If there are some errors, perhaps it is because of the short night (from 3 to 8) :lol:

(32.38 KiB) Downloaded 75 times

Sun Jan 01, 2017 4:59 pm

here some pictures:

textsize(2) for update-fields:

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_func_par_txt(2).JPG
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_func_par_txt(2).JPG (117.72 KiB) Viewed 1379 times

Mon Jan 02, 2017 10:36 am

mausi_mick wrote:here some pictures:…

Mon Jan 02, 2017 12:07 pm

hi bianchifan,

Happy New Year greetings to Wuppertal, I stood there in early October, only for a few hours.

I think the switches are old, but can be mounted easily.

I have a SW-debounce in the program too, but I think in the isr it’s not so good to wait long…

Mon Jan 02, 2017 1:17 pm

bianchifan wrote:mausi_mick wrote:here some pictures:…

Mon Jan 02, 2017 1:52 pm

I Think one big advantage of the version with the encoder ( and the 2 switches) is, that you can see directly the effect of the parameter changes on the screen. With the touch you need a lot of screen-space (of a small screen) for editing or a separate menu and you have to close the menu for looking for the effect.
Furthermore encoder and switches are workings with isr and not with polling (I don’t know how touch / URtouch works).

Mon Jan 02, 2017 2:29 pm

I’ve made some teste yesterday with my KY-040KY-040Датчики, энкодеры и камеры…12 Encoder_1 B13 Encoder_1 B6 TEST_WAVE The program runs stable, the encoders (EC11, KY-040 ) have no problems with bouncing. Now I have to build the input amplifiers (with MC6S22…DLO-138 OScope encoder but with little success.
I’ve added the decoupling capacitors (tried 1uF and 100nF) and I’ve seen more bouncing noise with the 1uF on the rising edges probably due to the slow rising time.

Image

I’m trying the interrupt approach. Added one interrupt to each falling edge of each pin.
The issue is that I get false triggers on the noise from the rising edges.
And due to the fast refresh speeds I get lots of pulses from this noise…

Any ideas?

I might try mausi_mick’s encoder code (haven’t done it yet… :) ) to see if there’s any improvement.

Also working on a new layout :) pictures latter on

Mon Jan 02, 2017 3:12 pm

rexnanet wrote:
Also working on a new layout :) pictures latter on

Mon Jan 02, 2017 3:13 pm

Hi Rexnanet,

I have only 10 nF ceramic directly on the encoder-pins, on the switches/buttons I have a RC-combination:

On the Input-Pin ST32F103 a 100nF (and a 1 µF (only for test)) and a 4.99 kOhm between 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 Pins and the switches.

But for the encoder I have changed the code a little bit :

void encCnt() {

if (s_enc == 1) return;
if (digitalRead(encA_16) && !digitalRead(encB_17)) {

if (encoderpos <  maxp[actFunc]) {

encoderpos++;

actPos = encoderpos;

s_enc = 1;

}

}

if (digitalRead(encA_16) && digitalRead(encB_17))  {  // subtract 1 from count for CCW
if (encoderpos > minp[actFunc]) {

encoderpos--;

actPos = encoderpos;

s_enc = 1;

}

}
if (s_enc == 1) setValue(actPos);

}

Mon Jan 02, 2017 3:42 pm

I have now on the switches/buttons 100nF and 5kOhm and reduced the delay to 140ms. That’s ok.
The encoder-counts are limited with the SW dependent of the function over a table:
//#######################################################################################

// functions:

//

//=========== functions ===============================

// 6 - Triggertype:  ---------------------------------6

// 5 - Triggervalue/position ----------------------5  |

// 4 - xZoomfactor ----------------------------4   |  |

// 3 - yZoomfactor ------------------------3   |   |  |

// 2 - yPosition -----------------------2  |   |   |  |

// 1 - timeBase----------------------1  |  |   |   |  |

//                                   |  |  |   |   |  |

//                                   V  V  V   V   V  V

volatile int16_t fold[8] =       {0, 1, 2, 3,  4,  5, 6, 0}; // old values

volatile int8_t const maxp[8] =  {0,19,13, 2, 19, 15, 2, 0}; // max. switch positions

volatile int8_t const minp[8] =  {0, 0, 1, 0,  0,  0, 0, 0}; // minimal switch position

volatile int8_t const stpw[8] =  {0, 1, 1, 1,  1,  0, 0, 0}; // step-width (not used)

volatile int8_t curp[8] =        {0, 1, 6, 1,  0,  6, 0, 0}; // current switch position

volatile uint32_t const  t_time[20] = {100,200,300,400,500,600,700,800,900,1000,1100,1200,1300,1400,1500,1600,1700,1800,1900,2000};

volatile int16_t  const  t_ypos[13] = {-240,-200,-160,-120,-80,-40,0,40,80,120,160,200,240};

volatile uint32_t const  t_triv[16] = {256,512,768,1024,1280,1536,1792,2048,2304,2560,2816,3072,3328,3584,3840,4096};

volatile int16_t  const  t_trty[3]  = {0,1,2};

volatile int16_t  const  t_yzfa[3]  = {100,200,300};

volatile int16_t  const  t_xzfa[20] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};  // ???

volatile uint8_t s_but_18=0; // 0=function fixed, 1=decrement function
volatile uint8_t s_but_19=0; // 0=function fixed, 1=increment function
volatile uint8_t s_enc = 1;

//############################################################################################################

Post a reply