Example Of Ttl Output Control And S34Con Configuration - UIrobot UIM2842 User Manual

Can2.0b instruction control, miniature integrated stepper motor controller (closed-loop) v1.0
Table of Contents

Advertisement

Miniature Integrated Stepper Motor Controller(

10.5 Example of TTL Output Control and S34CON Configuration

Writing to the S34CON is realized through instruction SCFG. Before writing to the S34CON,
user needs to first fill every bit of the S34CON according to the information provided in
previous sections, and then affixes the suffix code 0001 (binary). An example is provided
below.
System Description
A reciprocating mobile platform
Requirements
1.
When motor moves forward, P4 outputs 5V.
2.
When motor moves backward, P4 outputs 0V.
3.
Need RTCN every time P4 changes.
Realization
1.
First stop the motor by sending OFF;
2.
Set MCFG<P4IE>=1, get:
MCFG = 0000 0000 0000 1000 (binary) = 0x8 (hex)= 8 (decimal)
3.
Send instruction: MCF 8;
4.
Set P4EVENT <2:0>=010, link to direction event
5.
Set P4LVL=1, so when motor moves forward, P4 will output 5V
6.
Fill the S34CON with above bits, get: S34CON = 0000 1010 0000 0000 (binary)
7.
Affix the suffix-code 0001 to S34CON, get:
SCFG =0000 1010 0000 0000 0001 (binary)=0xA001 (hex)=40961 (decimal)
8.
Send instruction: SCF xA001; or SCF 40961;
9.
Send instruction: ENA;
10. Run the motor. There are numerous ways to run the motor. The easiest way is using
SPD;
During the motion, once actual direction (NOT desired direction) is plus, P4 will output 5V
and RTCN. Vice verse.
UI Robot Technology Co. Ltd.
M4220170607EN
)
Closed-loop
Page 57

Advertisement

Table of Contents
loading

Table of Contents