- What this example do?
- How I must configure my ORbit16™ to work with this example?
- Where I can learn more about this?
- Download this example!
In this example we’ll Timer 2 and Output Compare 1 to drive 6 servo using interrupts.
Signal for servo must to be connected to ports BP0, BP1, BP2, BP3, BP15, BP14. Most of servo need to be powered at 6V. DO NOT power servo using the 5V from ORbit16: Servo can draw a lot of current, use a separate power supply. GND of servo power supply and GND of ORbit6 must to be connected together.
In the main, after you’ve done all your settings, call ServoOpen() function. Now you can set the position of servo X at Y milliseconds using function: ServoSet(X,Y);
X is the number of the servo (from 1 to 6) and Y are the milliseconds (from 500 to 2500). Please note that not all servos can handle the value near to the limits (500…499…498 … 2500…2499…2498). So if you hear some noise at some value, stop first of reach this value or servo/power supply/ORbit16 can be damaged.
My advice is to read the following free documents:
- PIC24F Family Reference Manual – Sec.35 Output Compare with dedicated Timers (english language)
- Generare segnali PWM con i moduli Output Compare sui PICmicro a 16 e 32 bit – Ebook (italian language)
- Come funziona un servocomando (italian language)