$10 O-Scope revisited

What are you developing?
User avatar
ahull
Posts: 1510
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: $10 O-Scope revisited

Post by ahull » Mon Jan 02, 2017 3:59 pm

- Andy Hull -

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

Re: $10 O-Scope revisited

Post by mausi_mick » Tue Jan 03, 2017 3:20 am

I have now modified the program with 2 encoders (and no buttons) and only 10nF for debouncing.
The delay I have reduced to 0.

The montage is yet provisional . :lol:
P1020612.JPG
P1020612.JPG (64.96 KiB) Viewed 238 times

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

Re: $10 O-Scope revisited

Post by mausi_mick » Tue Jan 03, 2017 8:17 am

I have mounted the second encoder on the place of the function-down button( perhaps the other button I can use for reset ( problems with triggerValue, if signal outside)).

Here the video :

https://youtu.be/LqIV3IArMCY


the newest source:
STM32-O-Scope-11.ino
(31.75 KiB) Downloaded 23 times

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

Re: $10 O-Scope revisited

Post by ThunderOwl » Tue Jan 03, 2017 8:51 am

Thank you, mausi_mick. As soon as my next chineese STM board(s) arrives, I will make some semi-permament construction, with encoders, buttons. I think second encoder for mode change is good (one encoder chooses what to change, another - does changes), as long there is info on screen, on which option i am right now.
In every man's childhood, first 40 years are the hardest

User avatar
RogerClark
Posts: 5915
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: $10 O-Scope revisited

Post by RogerClark » Tue Jan 03, 2017 8:58 am

Guys

The encoders I used (on various projects) have a push button function as well.

I depending on what functionality you want, you could probably use the same encoder for sensitivity and also for vertical position, depending on whether the button was pushed in as it was rotated, and then just use the other encoder for timebase, and possibly for function selection if it was pressed in while rotating.

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

Re: $10 O-Scope revisited

Post by mausi_mick » Tue Jan 03, 2017 9:31 am

RogerClark,

I tested it also with one Encoder and the integrated push-button,
but I think for the service it's easier with two encoders, one for the "functiuon" : 1=timeBase, 2=yPosition, ...6)
and the other for the "parameters" inside the function (different positions, for example triggerType only 3 (0,1,2) , for timeBase 15 ... 30, how you like).
In program version 11 I don't need any push button.

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

Re: $10 O-Scope revisited

Post by rexnanet » Tue Jan 03, 2017 10:11 am

RogerClark wrote:Guys

The encoders I used (on various projects) have a push button function as well.

I depending on what functionality you want, you could probably use the same encoder for sensitivity and also for vertical position, depending on whether the button was pushed in as it was rotated, and then just use the other encoder for timebase, and possibly for function selection if it was pressed in while rotating.

That was my initial proposal :) Use the switch to "switch" :D between "option select" and "value select".

I got mine to work properly... switched the interrupt edge to rising and added a period of 3ms that I ignore the edge processing. works like a charm :D

Code: Select all

 
 attachInterrupt(ENC_A, enc_a, RISING ); 
 attachInterrupt(ENC_B, enc_b, RISING );
 attachInterrupt(ENC_SW, enc_sw, RISING);

}

char enc_inc=0;
uint8_t enc_pos=0;
uint8_t enc_select=0;
uint8_t enc_sel_cnt=0;
uint32_t enc_last_time=0;
uint32_t enc_last_sw_time=0;

void enc_a(){
  if((micros() - enc_last_time) < (3*1000)){
    return;
  }else {
    enc_last_time = micros();
  }
  if(digitalRead(ENC_B) == LOW){ //if other pin is HIGH=ignore
    enc_inc=-1;
    enc_pos--;
  }
}

void enc_b(){
  if((micros() - enc_last_time) < (3*1000)){
	return;
  }else {
	enc_last_time = micros();
  }
  if(digitalRead(ENC_A) == LOW){ //if other pin is HIGH=ignore
    enc_inc=+1;
    enc_pos++;
  }
}

void enc_sw(){
  if((micros() - enc_last_sw_time) < (10*1000)){
    return;
  }else {
    enc_last_sw_time = micros();
  }
  enc_sel_cnt++;
}

brainwash
Posts: 9
Joined: Tue Dec 27, 2016 8:56 pm

Re: $10 O-Scope revisited

Post by brainwash » Wed Jan 04, 2017 8:07 am

RogerClark wrote:@brainwashed

Would this be a sort of Bluetooth scope with the display via iOS or Android ?
Or would it still retain the display ?
Sorry, just managed to get back to the thread since the holidays. I intend it to be mostly headless, but don't mind leaving the LCD or touchscreen code inside. So I would leave one in the car, one on the motorbike, one on the ebike, one for characterizing battery capacity (or just move one around).
The reasons above are also why I asked how the circuit can blow up if it's powered by battery and the input is going through a 1Meg resistor which should clamp it to the rails.

There are many more questions but I will probably find the answers myself as soon as I get the toolchain set up properly. Still looking for a 'golden goose' that will let me use a single IDE for all platforms (MSP430, Tiva C, STM32, ESP8266, ATMega328) AND provide access to the Arduino libraries, when needed.

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

Re: $10 O-Scope revisited

Post by mausi_mick » Wed Jan 04, 2017 9:09 am

hi rexnanet,

I have tested it with one encoder in pgm-version 6, but I had made it their in three steps, that was really not comfortable.
Now I have changed it like your version, it's easy use .
But I think the push-button (in the encoder) is not so good like the encoder-switches, he needs more time for debounce (about factor 10).

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

Re: $10 O-Scope revisited

Post by rexnanet » Wed Jan 04, 2017 9:19 am

mausi_mick wrote:hi rexnanet,

I have tested it with one encoder in pgm-version 6, but I had made it their in three steps, that was really not comfortable.
Now I have changed it like your version, it's easy use .
But I think the push-button (in the encoder) is not so good like the encoder-switches, he needs more time for debounce (about factor 10).
Hi mausi_mick,

I've checked mine with the logic analyser and it's more or less the same as the encoder signals.
I've used more time (10ms, also it's usually slower than the encoder signals so no worries here) but I still have a strange phenomenon, the counter counts twice when I press it... I have to double check the code :)

P.S.
I've encounter this thing which is in a good price range and it's the "same" as we are doing here... sort of....
https://pt.aliexpress.com/item/Digital- ... ryId=50502

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests