$10 O-Scope revisited

What are you developing?
mausi_mick
Posts: 137
Joined: Fri Aug 12, 2016 1:40 pm

Re: $10 O-Scope revisited

Post by mausi_mick » Sun Jan 01, 2017 4:59 pm

here some pictures:

textsize(2) for update-fields:
STM32_O_Scope_func_par_txt(2).JPG
STM32_O_Scope_func_par_txt(2).JPG (117.72 KiB) Viewed 512 times

montage / backside:
STZM32_O_Scope_montage.JPG
STZM32_O_Scope_montage.JPG (128.01 KiB) Viewed 512 times
debounce switches / encoder:
STM32_O_Scope_debounce_switches.JPG
STM32_O_Scope_debounce_switches.JPG (89.54 KiB) Viewed 512 times

User avatar
ThunderOwl
Posts: 135
Joined: Fri Oct 28, 2016 6:04 am
Location: Riga, Latvia
Contact:

Re: $10 O-Scope revisited

Post by ThunderOwl » Sun Jan 01, 2017 5:12 pm

Thank You, mausi_mick! I think I will try your code later tonight, or, tomorrow, at work.
Edit: and, here is some new toy I got to play now :)
http://bildites.lv/a/sn5wkzax#ers3t9uf
http://bildites.lv/a/7npmye3q#ytm6u5ku
In every man's childhood, first 40 years are the hardest

bianchifan
Posts: 78
Joined: Sun Oct 18, 2015 1:27 pm
Location: W'tal, Germany

Re: $10 O-Scope revisited

Post by bianchifan » Mon Jan 02, 2017 10:36 am

mausi_mick wrote:here some pictures:...
I do not understand all those efforts, absolutely.. :geek:
It's a 10$-cheape-o-scope.. those toggles I used at last in the early 8ies, roundabout.
Today's tactiles cost 1$@100psc and you can debounce in soft.

For a cheap-o-scope I would prefer always touchscreen, small&smart

HAppy new year from Wuppertal

mausi_mick
Posts: 137
Joined: Fri Aug 12, 2016 1:40 pm

Re: $10 O-Scope revisited

Post by mausi_mick » 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...

User avatar
ahull
Posts: 1578
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: $10 O-Scope revisited

Post by ahull » Mon Jan 02, 2017 1:17 pm

bianchifan wrote:
mausi_mick wrote:here some pictures:...
I do not understand all those efforts, absolutely.. :geek:
It's a 10$-cheape-o-scope.. those toggles I used at last in the early 8ies, roundabout.
Today's tactiles cost 1$@100psc and you can debounce in soft.

For a cheap-o-scope I would prefer always touchscreen, small&smart

HAppy new year from Wuppertal
I must admit I quite like the retro look of those switches, and de-bouncing with resistors/caps takes load from the microcontroller (assuming the de-bouncing works as intended of course). The touchscreen is a nice option, but the cheaper displays don't have one (nor does the tiny 1.4" display I was playing with recently). Furthermore most of us already have a bunch of switches in the junk box.

I wonder what the cheapest, functional version we can build would be.

Minimum ebay BOM I have so far
CPU (£1.62)- bluepill(unless there is an even cheaper option)
Display (£2.86)- 2.0" TFT (with touch)
Scope Probe (£3.19)- P6100 100MHz Oscilloscope Scope Clip Probe 100MHz
BNC Connector (£0.99/5)- 5 off BNC Connectors.
1 Meg resistor.(£1.19/300) - 300 resistors assorted values
Add in a battery of some sort and some wire to hook it all up you are ready to build. :D
- Andy Hull -

mausi_mick
Posts: 137
Joined: Fri Aug 12, 2016 1:40 pm

Re: $10 O-Scope revisited

Post by mausi_mick » 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).

User avatar
rexnanet
Posts: 201
Joined: Wed Mar 16, 2016 10:34 am

Re: $10 O-Scope revisited

Post by rexnanet » Mon Jan 02, 2017 2:29 pm

I've made some teste yesterday with my KY-040 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

User avatar
ThunderOwl
Posts: 135
Joined: Fri Oct 28, 2016 6:04 am
Location: Riga, Latvia
Contact:

Re: $10 O-Scope revisited

Post by ThunderOwl » Mon Jan 02, 2017 3:12 pm

rexnanet wrote: Also working on a new layout :) pictures latter on
Exciting, looking forward for your work :)
I am thinking to make O-Scope assembly more permament, now it is just BluePill, TFT, and dupont wires. I still have less displays than count of different projects, so it will be "semi-permament", where I can take TFT screen quickly for other tests. Need to wait for new batch of BluePills to arrive, because I don't want to waste my current modules two-sided pins. See the pic, maybe this is inspiration for someone for tests "on wires": two sided pins solve usual need for GND and Vcc splitting, without using any bredboard.
Attachments
O-Scope_Wires_02.jpg
O-Scope_Wires_02.jpg (31.53 KiB) Viewed 435 times
O-Scope_Wires_01.jpg
O-Scope_Wires_01.jpg (30.68 KiB) Viewed 435 times
Last edited by ThunderOwl on Mon Jan 02, 2017 3:17 pm, edited 3 times in total.
In every man's childhood, first 40 years are the hardest

mausi_mick
Posts: 137
Joined: Fri Aug 12, 2016 1:40 pm

Re: $10 O-Scope revisited

Post by mausi_mick » 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 Stm32F103 Pins and the switches.

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

Code: Select all


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);
  
}

and on the start of the loop():

I show the functions , parameters and values on the tft-display and

set s_enc, s_but_18 and s_but_19 to 0.

There is also a delay from 150 ms, It's quick enough.

mausi_mick
Posts: 137
Joined: Fri Aug 12, 2016 1:40 pm

Re: $10 O-Scope revisited

Post by mausi_mick » 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:

Code: Select all

//#######################################################################################
// 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 Reply

Who is online

Users browsing this forum: No registered users and 1 guest