[SOLVED]Timing diagram

Thread Starter

Pushkar1

Joined Apr 5, 2021
416
Hello Respected members,

I want to learn how to draw timing diagram to solve the problem. The timing diagram shows what happens over time.

I want to draw timing diagram for debouncing a pushbutton to read stauts of button on input pin of microcontroller.

I have already visited tutorials and ling but I am not getting any clear idea

I have two axes, one shows time and the other shows voltage. After this, how does the button debouncing and how the button status is changed, how to understand all process through the timing diagram

Warm regards
Puskar
 

Thread Starter

Pushkar1

Joined Apr 5, 2021
416
hi pushkar,
There is once again, lots of well written documentation on the web for this Topic.
https://creately.com/lp/timing-diagram-software/
Hi E
I was not asking for software tools in my last thread and I am still not asking software tools to draw timing diagram. I have paper and pencil to draw the timing diagram. My question is that I have to understand button bouncing through timing diagram. I want to create my own timing digram to understand the debouncing to read logic on microcontroller pin
 

click_here

Joined Sep 22, 2020
548
I've only used timing diagrams to documenting network flow.

For something like the program that you are describing, I'd say that a flow diagram would be more appropriate to document the timing. The reason is that you have "while button is not pressed" as a core part of the algorithm.

That being said, what have you got so far?
 

Deleted member 115935

Joined Dec 31, 1969
0
A timing diagram, is just as you say a representation of how something changes over time.

So you start off with a line showing the input to a system,
in your case, a switch input,
starts of at say '1', at some time of your choosing, it goes to '0'.
A bounce, is this switch changing , i.e. its op going up / down a few times.
 

Thread Starter

Pushkar1

Joined Apr 5, 2021
416
For something like the program that you are describing, I'd say that a flow diagram would be more appropriate to document the timing. The reason is that you have "while button is not pressed" as a core part of the algorithm.

That being said, what have you got so far?
off topic I'm a little disappointed today
It has nothing to do with the that program. In that post I was just converting the flowchart into the code. This question is totally different

A timing diagram, is just as you say a representation of how something changes over time.

So you start off with a line showing the input to a system,
in your case, a switch input,
starts of at say '1', at some time of your choosing, it goes to '0'.
A bounce, is this switch changing , i.e. its op going up / down a few times.
I have drawn timing diagram for button bouncing.

Bounc.jpg


Diagram clearly explain that voltage between 5-3v would consider as logic High and voltage between 3-0V consider as logic low. Diagram show switch pressed at T1 and bounce stop at T11. Switch goes into stable state (High) after T11. This is my understanding that I have explained.

My question how do we check if switch is in a stable state using periodic timer for microcontroller.
 

JohnInTX

Joined Jun 26, 2012
4,787

crutschow

Joined Mar 14, 2008
34,285
My question how do we check if switch is in a stable state using periodic timer for microcontroller.
The simplest way is to just add a delay longer than the typical switch-bounce time (perhaps 10-20ms) until you check the switch position again after the first change in voltage.
That's how it's typically done with analog techniques.
 
Last edited:

Deleted member 115935

Joined Dec 31, 1969
0
off topic I'm a little disappointed today
It has nothing to do with the that program. In that post I was just converting the flowchart into the code. This question is totally different



I have drawn timing diagram for button bouncing.

View attachment 246511


Diagram clearly explain that voltage between 5-3v would consider as logic High and voltage between 3-0V consider as logic low. Diagram show switch pressed at T1 and bounce stop at T11. Switch goes into stable state (High) after T11. This is my understanding that I have explained.

My question how do we check if switch is in a stable state using periodic timer for microcontroller.

Ok, the diagram is a good start,
you say "clear" that 3 to 5v would be considered '1',
nothing clear there, you would have to make a note to that,

For a switch, also note that the time form say t1 to t2 , is not going to be the same as say t2 to t3,
a timing diagram would normally show that,

But apart form that nick pick,
I think you have answered the question in this post,

You now go on to a new question about debouncing techniques,
I'd suggest a new post for that as it not a timming diagram question, so no one else would find this thread if they were looking to solve de bouncing.
 

click_here

Joined Sep 22, 2020
548
off topic I'm a little disappointed today
It has nothing to do with the that program. In that post I was just converting the flowchart into the code. This question is totally different



I have drawn timing diagram for button bouncing.

View attachment 246511


Diagram clearly explain that voltage between 5-3v would consider as logic High and voltage between 3-0V consider as logic low. Diagram show switch pressed at T1 and bounce stop at T11. Switch goes into stable state (High) after T11. This is my understanding that I have explained.

My question how do we check if switch is in a stable state using periodic timer for microcontroller.
Oh I see

The way that you document that is to use an oscilloscope and run some tests.

You will end up with 3 different sections: Button is up, level toggling, and button is down.

You can then use your long forgotten probability maths to work out what a reasonable delay is going to be. Or just add some time to your worse case scenario
 
Top