Hey guys, I'm using all three timers on the arduino and I've successfully synced timer0 and timer1. I basically 'eyeballed' the syncing by dimming two l.e.d. lights and checking to make sure they were dimming at the same rate. like i said, timer0 and timer1 are synced. Now I'm trying to sync timer2 to the other two timers and i'm not getting the results i want. I know that timer2 uses milliseconds as opposed to microseconds, like the first 2. I've tried dividing by a 1000 to convert millis to micros but its not working. Does anyone know how to get timer 2 counting in microseconds instead of milliseconds?
thanks yall
There are too many details missing from your description to provide any guidance. Post your Sketch.
Hey man thanks for reading my post. I'm using the 'MsTimer2' class. It uses milliseconds to count. I, however, need it to count in microseconds. Is there a way to get this class to count in microseconds? Do you know of another class for timer2 that counts in microseconds. Like i said earlier I'm already using the other two timers so they are not an option. Timer 2 is my only hope.
thanks
Is there a way to get this class to count in microseconds?
I suspect there is. Give it a try. If you get stuck, I suspect someone here will be able to help.
Do you know of another class for timer2 that counts in microseconds?
Sorry, no.
None of the timers really count in microseconds or milliseconds. All the timers count in time with the system clock with a divisor.
Another key difference is Timer0 and Timer2 are 8-bit counters. They roll-over at 255. Timer1 is a 16-bit Timer... it rolls-over at 65535.
Inherent to your question is seemingly a misunderstanding of Timers on the Arduino. Can I encourage you to post your problem in a little more detail? There is probably another approach to arrive at a solution.
Mitch, thanks so much. You're right I don't have a solid understanding of timers on microcontrollers in general. Know of any good tutorials that would help me understand? I'll post my code tonight after my day job.
Tutorials?... no. But the atmega datasheets are excellent reference.
But I suspect you might not need to go that deep once we understand your application. We'll see once you get back to work at your evening job 