beautypg.com

3 rc servo connectors – Digilent 410-295P-KIT User Manual

Page 12

background image

ChipKIT Pro MX4 Reference Manual

Copyright Digilent, Inc. All rights reserved.

Other product and company names mentioned may be trademarks of their respective owners.

Page 12 of 37

• BTN1 – PIN_BTN1, pin 42, RA6
• BTN2 – PIN_BTN2, pin 43, RA7
• LD1 – PIN_LED1, pin 64, RB10
• LD2 – PIN_LED2, pin 65, RB11
• LD3 – PIN_LED3, pin 66, RB12
• LD4 – PIN_LED4, pin 67, RB13

5.3 RC Servo Connectors

The ChipKIT Pro MX4 provides eight 3-pin RC hobby servo connectors, labeled S1-S8, for direct control of servos in

robotics and other embedded hardware actuator applications. The connectors share the I/O pins with Pmod

connector JC. Individual I/O pins may be accessed through the JC connector if they're not being used to control a

servo.

RC Servos use a pulse width modulated signal, PWM, to control the servo position. The 16-bit timers in the PIC32

microcontroller have the ability to generate PWM signals using the output compare registers. However, it is also

possible to use timer interrupts to accomplish this same thing. Using timer interrupts allows a single timer to be

used to control the signal timing for all eight servo connectors.

The servo connectors on the ChipKIT Pro MX4 board are intended to be driven using timer interrupts rather than

directly by the pulse width modulators in the internal timers. This frees the pulse width modulators for other uses,

such as DC motor speed control. Digilent has a reference design available that illustrates using timer interrupts to

control signal timing for the PWM signals to control RC servos.

When using the MPIDE development environment, the Servo library can be used to drive servos attached to these

connectors. The symbols PIN_S1 through PIN_S8 can be used to refer to the servo connectors being used.

The following give the correspondence between servo connector, MPIDE digital pin number, and microcontroller

I/O Port register and bit position:

• S1 – PIN_S1, digital pin 16, RG12
• S2 – PIN_S2, digital pin 17, RG13
• S3 – PIN_S3, digital pin 18, RG14
• S4 – PIN_S4, digital pin 19, RG15
• S5 – PIN_S5, digital pin 20, RG0
• S6 – PIN_S6, digital pin 21, RG1
• S7 – PIN_S7, digital pin 22, RF0
• S8 – PIN_S8, digital pin 23, RF1

There are three options for supplying power to the servo connections:

• A common power bus (BRD_VU) for the ChipKIT Pro MX4 and servos
• Separate on-board power busses for the ChipKIT Pro MX4 (BRD_VU) and the servos (VS)
• An on-board power bus for the ChipKIT Pro MX4 (BRD_VU) and an external power bus for servos

For the first case above: Install a shorting block on jumper JP1 to connect the VS servo power bus to the BRD_VU

power bus. The servo power bus is then powered from the same source as the BRD_VU power bus. Powering a

large number of servos from USB power is not recommended. Pin header jumpers and shorting blocks such as JP1