User`s manual
ROBOT . HEAD to TOE
Product User’s Manual – SD02B
Created by Cytron Technologies Sdn. Bhd. – All Rights Reserved
15
a. Sample schematic on above shows a PIC16F877A interface to SD02B. No restriction
to what type or brand of microcontroller can be used, as long as it has UART
peripheral.
b. User needs to connect the RX and TX pin to microcontroller. These two pins should
be cross connected to microcontroller. In other words, RX on SD02B should be
connected to microcontroller’s transmitter pin (TX), while TX on SD02B should be
connected to microcontroller’s receiver pin (RX). For details connection, please refer
to sample schematic above.
c. To begin, users have to choose either *Vin or Vmotor power supply at voltage
selector. Then, connect Vmotor and/or *Vin and Gnd to power supply at a voltage
according to the specification of the stepper motor used and make sure the voltage is
within the voltage range of SD02B Vmotor and/or *Vin. Please refer to section 3,
Product Specification and Limitations for details.
d. Power up the microcontroller board and SD02B. Once the power is supplied to
SD02B, the 3mm green LED should light ON
e. The hardware interface for SD02B to microcontroller is ready! However, in order to
control stepper motor from microcontroller, user is required to write a program for the
microcontroller to send commands through its UART according to SD02B UART
protocol.
f. User may refer to PIC18F4520 sample program provided to control two SD02B (thus,
two stepper motors) through one hardware UART and one software UART using
Microchip MPLAB C18 C Compiler Libraries. Since most midrange PICs only have
one hardware UART, so one software UART is used for the second UART interface.
This sample code shows how to generate an additional UART using software
approach.