ROBOT . HEAD to TOE
Product User’s Manual –
SD02C
6.2 Sample Program for dsPIC30F4013
Driving stepper motor is common necessity in most robotic project based on the embedded system
which uses microcontroller. Considering this reason, Cytron Technologies has also developed
the sample source code for PIC30F microcontroller using MPLAB C30 C Compiler. This
sample program is developed for PIC30F4013. If user uses different PIC microcontroller, user
may need to modify the sample program based on that particular microcontroller by referring
to its datasheet released by Microchip Technology Inc.
The sample program will control two SD02Cs. Since this PIC has two hardware UART, we will
use two hardware UART to control the second SD02C.
a. The sample program can be downloaded from Cytron website, (www.cytron.com.my),
in SD02C product page.
b. Download the file named “SKds40A Sample Code”.
c. There are 4 files available for the user;
4013
.mcp
(MPLAB project
file).,
4013
.mcw
(MPLAB workspace file),
4013.c
(source code in C language)
and
4013
.hex
(HEX file). For immediate
testing, user may load
4013
.hex to dsPIC30F4013 and plug into
microcontroller board which was being completed in step c.
d. The sample program is based on SKds40A startup kit. We will discuss about how to
control two SD02Cs and two stepper motor using a SKds40A through UART interface.
e. Ensure the hardware interface for microcontroller to SD02C is setup properly. Besides,
the power for stepper motor is also needed. Please refer to section 5.4 for example
connection of SD02C to microcontroller through UART interface.
f. Power indicator LED on SD02C will turn ON when power is supply to microcontroller
board.
g. Please refer to
4013
.c
for details on method to send/receive
command to SD02C.
h. User must install MPLAB and C18 Compiler if user wants to modify and compile this
sample program. The free MPLAB and C30 Compiler can be obtained from
Microchip official website.
Created by Cytron Technologies Sdn. Bhd. – All Rights Reserved