Skip to main content

Questions tagged [timers]

Timers are the hardware in the processor used to count and time events. Use this tag for questions about the hardware timers.

Filter by
Sorted by
Tagged with
0 votes
0 answers
69 views

Got two boards, getting a stable counter error ratio between the two of ~0.9895 (counted ticks divided by calculated ticks). Is this not a bit too low ? With +/- 50 ppm between the two crystals I was ...
kellogs's user avatar
  • 136
1 vote
1 answer
83 views

Is it possible generate all frequencies between 5000 and 8000Hz, 1Hz in between with an ATmega328? When I create a c-program outside the Arduino IDE to calculate the frequencies with the formula ...
hennep's user avatar
  • 131
2 votes
2 answers
717 views

With Arduino Uno Rev3, I am trying to maintain a delicate timing while handling data transmission. I want to send 6 bytes at a time, which takes around ~44 us when I time Serial.write(). The time it ...
gunakkoc's user avatar
  • 123
0 votes
2 answers
104 views

This example is a simplified version of what I really need to do, but I think it demonstrates the problem (= my misunderstanding?). I need to use a timer to count microseconds; my code shows how I ...
Bryan Hanson's user avatar
2 votes
1 answer
744 views

So I wrote this code for Arduino Uno: // file qemu.ino void setup() { Serial.begin(9600); } void loop() { Serial.println(millis()); } And then compiled and uploaded it to the real ...
lch361's user avatar
  • 21
0 votes
1 answer
163 views

I'm a beginner into Arduino so I have a little problem where I'm trying to do a countdown on LCD using while loop but I'm also trying to get a key input inside that same while loop. Problem is that ...
DevChips's user avatar
1 vote
1 answer
366 views

I am using an arduino Micro to generate 8 square waves on 8 pins. The idea is as follows: on pin 13 is the main square wave. It represents a certain BPM (beats per minute). The other 7 pins should ...
Janw's user avatar
  • 294
2 votes
2 answers
641 views

I'm having difficultly using an internal timer interrupt with my Arduino Nano to properly capture a specific value from a linear potentiometer and then instantly stopping the actuator. I basically ...
wickedhurricane's user avatar
1 vote
2 answers
159 views

Do you have to upload the UNO after the applied power is disconnected? Does the UNO retain the code without any power? And when the power is disconnected, if the code is retained, will the timers ...
Woodenfish's user avatar
1 vote
1 answer
678 views

#include <PWM.h> int led = 9; void setup() { InitTimersSafe(); Serial.begin(115200); Serial.println(); variable_freq(); pinMode(A0,INPUT); } void variable_freq() { while(true) { ...
curious_direwolf's user avatar
1 vote
2 answers
627 views

I'm using the hardware timers on the 328 for phase angle control of a triac with zero-crossing detection. I am encountering some strange behavior with the "Set on Compare Match" feature not ...
saustinp's user avatar
2 votes
2 answers
297 views

I've written code for an Arduino Nano that when a button is pressed, it sends an IR command. It is set so that if no button press has been received for a period of 10 seconds, it will enter sleep mode ...
99natmar99's user avatar
-1 votes
1 answer
248 views

I have three analog sensors like voltage, temperature and pressure. I need to measure the voltage and temperature every 10 ms and I need to measure the pressure alone every 30 ms by using the timers ...
Pritha's user avatar
  • 1
-2 votes
1 answer
313 views

I have a 32.768 kHz signal at the ATmega328P input. I need to get 2 signals from this signal: 1Hz and 32Hz. How well will it work? How to do this with a ATmega328P Timer/Counter? What gain will the ...
Andre's user avatar
  • 27
0 votes
1 answer
2k views

I want to strobe 3 LEDs (at independent frequencies and duty cycles) via mosfets with a duty cycle of 0.05%-1% at a frequency range of 24-100 hz. I would like to hold 1% or better accuracy for both ...
Robb Godshaw's user avatar
1 vote
4 answers
2k views

I'm working on a battery-powered project. I'm trying to write code, which checks the battery voltage every 30 minutes and changes the color of a LED accordingly. Should I still be using millis() or is ...
Zhelyazko Grudov's user avatar
0 votes
1 answer
149 views

I'm hoping to time external events on a '328p Arduino that will occur slowly enough that they'll overflow the 16-bit counter TCNT1. In a different scenario I'd prescale the counter, but I need the ...
Jim Mack's user avatar
  • 269
1 vote
1 answer
223 views

(Arduino) Hello I don't know where I am going wrong here, please advise. In the end I want to step a bipolar motor, HIGH/LOW, using Timer0 with OCR0A and OCR0B interrupts to adjust the motors step ...
localmartian's user avatar
0 votes
1 answer
167 views

I have the following code which checks the latency of another board. int triggerPin = 13; int dataPin = 9; int ejectorPin = A0; unsigned long t_start = 0; unsigned long t_end = 0; ...
Farahi's user avatar
  • 3
1 vote
1 answer
144 views

The code I use probably has a math problem since an Arduino can only count a 16 bit integer. This problem is with the WeekDelay() function. The project is for an Aerogarden. It pumps water into the ...
alexlikesallthegamez's user avatar
-1 votes
1 answer
167 views

TCCR1A = 0; TCCR1B = 0; OCR1B = 0xFF00; TCCR1A = (1<<WGM10) ; TCCR1B = (1<<CS12) | (1<<CS10);; //set the pre-scalar as 1024 TIMSK1 = (1 << OCIE1A); This doesn't ...
Rick Dearman's user avatar
1 vote
0 answers
84 views

I have made an irrigation system using Arduino. Timer program is based on comparing the previous Millis() and current Millis(). I want to know the chance for error when the currentMillis() overflows ...
Prakash K K's user avatar
3 votes
2 answers
1k views

I was trying to get the data from MPU6050 using the Arduino library mentioned here. The following code is an edited version of the sample code given in the library folder which seems to be working ...
Lawliet's user avatar
  • 183
2 votes
0 answers
494 views

I have a code for finding the rpm of one system calling here as engine , the engine have a hall sensor output and I have tried the following Code #define SERVO_MIN 2000 #define SERVO_MAX 4000 struct ...
Lawliet's user avatar
  • 183
2 votes
0 answers
135 views

I am working on communicating 4 switch states across multiple Arduinos using only one pin. It must be as fast as conceivably possible. Currently I have a master Arduino reading all 4 switches (...
MeSo2's user avatar
  • 177

1
2 3 4 5
10