- This topic has 1 reply, 2 voices, and was last updated 7 years, 10 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
|
Microcontroller › AVR › what is capture mode in atmega 16
how to use this type of mode to control servo motors?
Hi Rajesh
You can use capture mode to control servo motor using a 16 bit timer i.e. TIMER-1.
For example:
Most of the servo motors work on a 20 ms pulse, out of which the time given to a logic 1 decides its position. For this you can select mode 14 in fast-PWM operation (refer datasheet, pages 110-116) and store 20,000 value in ICR1. Then according to the desired servo motor position, set the value in OCR1A/B, generally from 1000 to 2000 (for 1 ms to 2 ms). The output pulse will be generated on pin OC1A/B (PIND 5/4). Make sure to select non-inverting mode of operation and declare these pins as output.
This might help