Maker Pro
Maker Pro

555 timer ic problem

samwitch

Mar 22, 2021
4
Joined
Mar 22, 2021
Messages
4
Hey everyone,

I have a project with an LM555 timer and need to calculate how much time it takes for an input to go from LOW to HIGH and then to LOW again.

Basically, I want to know the period of a square wave generated by the LM555 timer.

I did it with Arduino using the function Pulseln. But I need to do this using a Beaglebone and programming in C++ (Using QtCreator).

Is there a way to "open" the function PulseIn so I know what it does?

Thank you in advance.
 
Last edited by a moderator:

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
The title is seemingly misleading.
Insufficient information.
Do you want to calculate the period of the 555 timer? Or do you want to measure the period of the timer using the beaglebone?
What is your circuit setup? We can help only on the basis of information you provide.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
Is there a way to "open" the function PulseIn so I know what it does?
You could look it up in the Arduino libraries.
But probably unnecessary. You can measure an interval using several methods:
  • interrupt driven: The edge of the timer signal triggers an interrupt, the interrupt routine saves the current time, When the same edge appears one period of the timer later, the interrupt is triggered again . Now the interrupt routine saves the new time. The difference between the two timestamps is the period of the timer. This method should be pretty accurate as the interrupt will be handled (almost) immediately regardless of the cpu load.
  • by polling: Your program constantly polls the input where the timer is connected. When the program detects an edge (rising or falling, which one is irrelevant), it stores the current time. When the program next detects the same edhe (again rising or falling, must be the same as before), it saves the new time and calculates the period from the difference in the two times. This method is less accurate than the interrupt method as the delay between two polls of the input pin may depend on the cpu load.
 

samwitch

Mar 22, 2021
4
Joined
Mar 22, 2021
Messages
4
You could look it up in the Arduino libraries.
But probably unnecessary. You can measure an interval using several methods:
  • interrupt driven: The edge of the timer signal triggers an interrupt, the interrupt routine saves the current time, When the same edge appears one period of the timer later, the interrupt is triggered again . Now the interrupt routine saves the new time. The difference between the two timestamps is the period of the timer. This method should be pretty accurate as the interrupt will be handled (almost) immediately regardless of the cpu load.
  • by polling: Your program constantly polls the input where the timer is connected. When the program detects an edge (rising or falling, which one is irrelevant), it stores the current time. When the program next detects the same edhe (again rising or falling, must be the same as before), it saves the new time and calculates the period from the difference in the two times. This method is less accurate than the interrupt method as the delay between two polls of the input pin may depend on the cpu load.
Thanks so much Harald,really useful
 

WHONOES

May 20, 2017
1,217
Joined
May 20, 2017
Messages
1,217
It's easy enough to calculate the period using the sums on page 10 of Texas Instruments Datasheet. See link below for the sheet.
Don't forget that the value of C in the calculations is expressed in Farad's.

Alternatively you could use an oscilloscope to measure the period(s) of your circuit.

LMC555 CMOS Timer datasheet (Rev. M)
 

Audioguru

Sep 24, 2016
3,656
Joined
Sep 24, 2016
Messages
3,656
There is a huge difference between an old LM555 and a new Cmos LMC555.
 

The555Guy

Oct 2, 2021
1
Joined
Oct 2, 2021
Messages
1
Hey everyone,

I have a project with an LM555 timer and need to calculate how much time it takes for an input to go from LOW to HIGH and then to LOW again.

Basically, I want to know the period of a square wave generated by the LM555 timer.

I did it with Arduino using the function Pulseln. But I need to do this using a Beaglebone and programming in C++ (Using QtCreator).

Is there a way to "open" the function PulseIn so I know what it does?

Thank you in advance.

Your Post have many different questions. I will try to answer them one by one.
  1. I think you want to calculate the time period of the Astable Multivibrator Circuit. Which you can calculate using many online calculator available. Such as this [By the way it is the one I made :) myself]
  2. You are looking for the code of PulsIn function, well I found it on https://forum.arduino.cc/t/pulsein-function-source-code/10299
 

HANKMARS

Jul 28, 2019
498
Joined
Jul 28, 2019
Messages
498
Hey everyone,

I have a project with an LM555 timer and need to calculate how much time it takes for an input to go from LOW to HIGH and then to LOW again.

Basically, I want to know the period of a square wave generated by the LM555 timer.

I did it with Arduino using the function Pulseln. But I need to do this using a Beaglebone and programming in C++ (Using QtCreator).

Is there a way to "open" the function PulseIn so I know what it does?

Thank you in advance.
Rise time and fall time of output typically 100ns. In monostable mode duration of high out pulse = 1.1 x R x C seconds. In astable mode output high = 0.693 (Ra + Rb) C seconds. Output low = 0.693 (Rb) C seconds. Total period = t1 + t2.
 
Top