Note that timers are based on 32-bit int microsecond counters, so can only time up to a maximum of 2^31-1 microseconds i.e. 30 minutes. They are designed for times between microseconds and seconds. For longer times, you should consider the time()/Real time clock.
Implementation
The timer used to implement this functionality is:
On the LPC1768: Timer 3 (LPC_TIM3)
On the LPC11U24: 32-bit Counter/Timer B1 (LPC_CT32B1)
Using Timer usually doesn't impact the main programs. I'm using Timer to flash the 4 LEDS for 50 ms one after the other. Not perfect, close enough. At much slower time of 500 ms, the 4 LEDS do not flash in succession, more like random. Can someone explain Timer more fully and it's limits?
Thanks, donde
Using Timer usually doesn't impact the main programs. I'm using Timer to flash the 4 LEDS for 50 ms one after the other. Not perfect, close enough. At much slower time of 500 ms, the 4 LEDS do not flash in succession, more like random. Can someone explain Timer more fully and it's limits?
Thanks, donde
Well, the newest revisions of the mbed library doesn't work with timer.
I have some software reading the timer output after it's been stopped, but it always returns 0...
Tried to revert to 27, but this doesn't change anything.
Well, the newest revisions of the mbed library doesn't work with timer.
I have some software reading the timer output after it's been stopped, but it always returns 0...
Tried to revert to 27, but this doesn't change anything.
Well, the newest revisions of the mbed library doesn't work with timer.
I have some software reading the timer output after it's been stopped, but it always returns 0...
Tried to revert to 27, but this doesn't change anything.
It works, you just have to pay attention to the return type. The hello world above works because the return type of read() is float; if you want to use read_ms() or read_us(), you need to change the specifier in printf() from "f" to "d" because they both return integer type.
<<quote Lerche>>
Well, the newest revisions of the mbed library doesn't work with timer.
I have some software reading the timer output after it's been stopped, but it always returns 0...
Tried to revert to 27, but this doesn't change anything.
<</quote>>
It works, you just have to pay attention to the return type. The hello world above works because the return type of read() is float; if you want to use read_ms() or read_us(), you need to change the specifier in printf() from "f" to "d" because they both return integer type.
I need a interface like "timer" but with nanosecond resolution (hundreds of nanoseconds). Where I can find information about LPC1768 timer register and interruption to create the interface?
thanks in advance for helps
Dario
Hi all.
I need a interface like "timer" but with nanosecond resolution (hundreds of nanoseconds). Where I can find information about LPC1768 timer register and interruption to create the interface?
thanks in advance for helps
Dario
hi I want to design a controller to lower the speed of a motor if it exceeds a preset value. that means I have to know the know the current speed and compare with the set value. I tried to use an interruptin to count the number of pulses from a shaft encoder attached to the dc motor. but it wasn't working. can anyone help me with the cide that count the number of pulses in a second; hence determine the speed of the motor? .Thanks
hi I want to design a controller to lower the speed of a motor if it exceeds a preset value. that means I have to know the know the current speed and compare with the set value. I tried to use an interruptin to count the number of pulses from a shaft encoder attached to the dc motor. but it wasn't working. can anyone help me with the cide that count the number of pulses in a second; hence determine the speed of the motor? .Thanks
Posting new comments for this page has been disabled
Please login to post comments.