Questions tagged [timer]

Circuit to generate a signal at a specific time after a trigger event. The timing can be defined by an RC time constant, or by clock pulses from an oscillator.

One way to implement a timer is as a digital counter incremented on a fixed clock frequency, allowing for generation of periodic or non-periodic timed events. It is one of the most basic and common internal peripherals found on micro-controllers, and can be used for a wide range of tasks like interrupt generation, time measurement, PWM generation, etc.

1069 questions
41
votes
4 answers

How to synchronize two microcontrollers to micro-second accuracy?

I need to synchronize two micro-controllers so that they can measure the speed of propagating waves. The time delay measurements need have microsecond accuracy (error less that 1/2 of a microsecond). I have two micro-controllers (ATmega328) which…
Kevin
  • 513
  • 1
  • 4
  • 6
30
votes
4 answers

Why would a modern digital clock rely on mains frequency?

I am in the military, stationed in Djibouti, Africa. We generate 240V/50Hz power on base, but some buildings also have 120V outlets, which I assume is transformed somewhere else on base, probably at the diesel generating station. I also assume…
Chris Gregg
  • 431
  • 4
  • 11
22
votes
5 answers

Astable 555 circuit not oscillating

I'm a complete beginner to electronics, but I'm trying to follow Ben Eaters video series "Building an 8-bit computer". I tried to do the first part of an astable 555 timer, but the LED does not oscillate and on top of that the timer draws A LOT of…
Mr Filp
  • 223
  • 2
  • 6
17
votes
4 answers

Why are 555 timers so prevalent?

I've noticed is that 555 ICs seem to be extremely common. Why is the 555 so prevalent, or ubiquitous; what about it so useful?
voices
  • 1,039
  • 1
  • 15
  • 29
15
votes
9 answers

How would I go about getting a small oscillator running at precisely 31,891,269,116 µHz?

I am looking to build an RTC module for Arduino that runs on Mars time. The conversion factor is 1.0274912510 Earth seconds to 1 Mars second. Whilst I have managed to accomplish this programmatically with a <2 second resolution (which is not exactly…
renegadeds
  • 195
  • 1
  • 8
15
votes
6 answers

STM32: Timer interrupt works immediately

This is code for timer in my project on STM32F429: //timer initialization void timerInit() { uwPrescalerValue2 = (uint32_t) ((SystemCoreClock / 2) / 100000) - 1; RS485Timer.Instance = TIM5; RS485Timer.Init.Period = 67400000; // high value to…
user54506
12
votes
2 answers

Are my theoretical power consumptions of this avr correct?

After being inspired by a simple ATMEGA 168 based darkness alarm that has a theoretical life span of 3 years on batteries utilising sleep mode, I had decided to make something similar of my own (a wakeup alarm, using the oscillator for roughly okay…
Kenny Robinson
  • 445
  • 2
  • 7
  • 18
11
votes
5 answers

Monitor clock cycles for code on arduino/AVR?

Is it possible to monitor a block of code and determine the number of processor clock cycles that code took on an Arduino and/or AVR atmel processor? or, should I rather monitor microseconds passed before and after code run? Note: I'm not concerned…
cyphunk
  • 602
  • 1
  • 6
  • 12
11
votes
4 answers

Low power, low voltage, slow (0.1Hz) oscillator?

I had the opportunity to analyze a very interesting circuit today using a programmable unijunction transistor as a timer. The power supply varies, and the circuit must operate on under 10uA of current (not counting charging the cap). It triggers an…
Adam Davis
  • 20,339
  • 7
  • 59
  • 95
11
votes
4 answers

555 timer: how to set values to take an hour

I'm new (and novice) in electronics. I came to seek your knowledge to see if someone can help me with a very basic circuit. It is a 555 chip, which should light a LED (for about 1/2 second) every hour. I managed to make the circuit diagram with a…
Xavi Gómez Canals
  • 157
  • 1
  • 1
  • 10
10
votes
1 answer

Missing Q11 output on 4060

Is there any reason why Q11 is left out on 4060 IC? I've read it was done to extend the max pulse time (highest clock divider) but why was it done on Q11? Why not Q12 and therefore have a full 8-bit counter (Q4-Q11)?
Szymon Bęczkowski
  • 2,595
  • 15
  • 21
10
votes
4 answers

Can I achieve a one shot button without a 555?

I have a complex circuit, but my problem only relates to one small part. I have a relay, which is energised by pulling the low side low using an NPN. I would like a pushbutton to operate the transistor (and therefore the relay) for a time (500ms…
Jon
  • 715
  • 2
  • 8
  • 17
10
votes
2 answers

Need help understanding AVR ATMEGA / ATTINY timer mirrored output

I am trying to use Timer1 of Atmel AVR microcontroller, either AtMega328 as used in the Arduino, or the ATTiny85, to output two clock signals which are mirror images of each other. The frequency I am trying to generate is a variable 1 MHz to 2 MHz…
ExcitingProjects
  • 672
  • 7
  • 19
10
votes
3 answers

Watch Dog Timer + Arduino

How do I setup a hardware watch dog timer with an Arduino?
littlebirdceo
  • 4,697
  • 8
  • 41
  • 61
9
votes
1 answer

arduino : delaymicroseconds()

How does the delayMicroseconds() function works. From what I understood the prescaler of timer0 is set to 64. For a 16MHz clock gives 4.0uS per count. I am a bit confused on the math to get to 1uS interval?
Hawk_08
  • 115
  • 1
  • 1
  • 5
1
2 3
71 72