TRINAMIC TMC423_1

TMC423 Data Sheet – (V1.13 / June 20th, 2007)
1/22
TMC 423 – Datasheet
VCCI
EXT_RES
CLK
NC
VCCA
GND
PRA/IO
NINT
NSCS428
SDO428
NSCS
SCK
SDI
SDO
TCK
Serial Triple Incremental
Encoder Interface
GND
COLUMN_PIN(0)
TDI
COLUMN_PIN(1)
ENC1_A
COLUMN_PIN(2)
ENC1_B
COLUMN_PIN(3)
ENC1_N
ENC2_A
TMS
GND
VCCI
VKS (GND)
GND
VPP (VCCA)
ENC2_B
ENC2_N
SW_ROW_PIN(0)
ENC3_A
TRINAMIC Motion Control GmbH & Co. KG
Sternstrasse 67
D – 20357 Hamburg
GERMANY
WWW.TRINAMIC.COM
SW_ROW_PIN(1)
TMC423
TQFP-100 Package
ENC3_B
ENC3_N
SW_ROW_PIN(2)
SW_ROW_PIN(3)
STEP1
SW_ROW_PIN(4)
TRST
SW_ROW_PIN(5)
LED_ROW_PIN(0)
DIR1
VCCI
VSV (VCCA)
VCCI
LED_ROW_PIN(1)
STEP2
LED_ROW_PIN(2)
DIR2
LED_ROW_PIN(3)
LED_ROW_PIN(4)
STEP3
LED_ROW_PIN(5)
DIR3
TDO
STOPL(2)
STOPL(1)
STOPL(0)
VCCI
STOPR(2)
STOPR(1)
REF(2)
TMC423 Main Features
STOPR(0)
REF(1)
REF(0)
GND
NC
GND
VCCA
PRB/IO
NSCS_D
SDI_D
SCK_D
SDO_D
GND
The TMC423 is a triple incremental encoder input chip, which interfaces to any SPITM compatible
controller. The TMC423 can especially be used in conjunction with the TMC428 triple stepper motor
controller to provide position verification or stabilization using some additional software. It integrates
24 bit counters for each encoder to provide a high position resolution without CPU interaction.
Further it allows dynamic resolution adaptation to allow direct comparison of encoder counters with
motors using different micro step resolution. All encoder counters can be latched synchronously, or
whenever a null channel event occurs, providing a position on strobe holding function. The TMC423
also provides a step / direction output with programmable signal shaping for the TMC428 as an
optional function. A multiplexer function is also integrated for the TMC428 reference switches.
Furthermore control and drive of a LED and switch matrix is implemented. All functions can also be
used in conjunction.
Applications
•
•
•
•
•
Stepper Motor Position Verification
Position Maintenance
Incremental Encoder Interface Readout
Step / Direction conversion for TMC428 systems
Control of LED 6 x 4 Matrix and Switch 6 x 4 Matrix
Features
•
•
•
•
•
•
•
•
•
•
Supports 2 and 3 channel incremental encoders with a wide range of resolutions
Allows step / direction signal extraction from TMC428 output data stream
Programmable pulse shaping for step / direction interface
24 bit integrated position resolution
Programmable prescaler for Incremental Encoder Interface
4-times evaluation of encoder signals
Fast 32 bit SPITM interface
Can share SPITM interface with TMC428 and supplies separate interrupt output
Integrates Reference Switch Multiplexers
Package: TQ100
Note: SPI is Trademark of Motorola, Inc.
Copyright © 2004 TRINAMIC Motion Control GmbH & Co. KG
TMC423 Data Sheet – (V1.13 / June 20th, 2007)
2/22
Revision History
Version
Comment
Initial Version
Date
Name
November 22, 2002
Technical Department
0.4
Corrected Array Switching Frequency
January 23, 2003
Technical Department
0.5
First Customer Release
January 24, 2003
Technical Department
0.6
Minor corrections
March 11, 2003
Technical Department
0.6
Changes concerning new company TRINAMIC
Motion Control GmbH & Co. KG
October 1st, 2004
Technical Department
th
Corrected Reset input in diagram, added
supply spec
December, 15 ,
2004
March, 15th, 2005
Technical Department
1.1
Added Application Environment examples
March, 9th, 2007
Technical Department
1.1
Added encoder timing
Apr, 4th, 2007
Dw
1.2
S/D Appl. corrected, added TMC428 SPI
datagram for S/D
Figure 4 and Figure 5: TMC423 clock input
corrected; more detailed flag description
June 6th, 2007
HC
June 20th, 2007
HC, Dw
0.7
Corrected Pinning: Position of CLK pin
1.0
1.3
Copyright © 2004 TRINAMIC Motion Control GmbH & Co. KG
Technical Department
TMC423 Data Sheet – (V1.13 / June 20th, 2007)
3/22
Table of Contents
1
Pinout .............................................................................................................................................................................. 5
1.1
Pin Description .................................................................................................................................................... 6
1.2
Recommended Operating Conditions........................................................................................................... 7
1.3
Electrical Characteristics.................................................................................................................................... 7
2
Block Diagram ............................................................................................................................................................... 8
3
Application Environment ........................................................................................................................................... 9
3.1
Application Description..................................................................................................................................... 9
3.1.1 Application with TMC236 Stepper Motor Driver................................................................................... 9
3.1.2 Application with Step / Direction Power Stage ................................................................................... 9
3.2
Application Examples.......................................................................................................................................10
3.2.1 Application with TMC236 Stepper Motor Driver.................................................................................10
3.2.2 Application with Step / Direction Power Stage .................................................................................10
4
Dynamic Resolution Adaptation ............................................................................................................................11
5
Serial Peripheral Interface (SPI) with 32-bit Register .....................................................................................12
5.1
Description and Specification........................................................................................................................12
5.2
32-bit SPI Datagram Structure ......................................................................................................................13
5.3
SPI 32-bit Datagram Specification ...............................................................................................................13
5.3.1 Overview........................................................................................................................................................13
6
Incremental Encoder .................................................................................................................................................14
7
Configuration Datagrams.........................................................................................................................................15
7.1
Encoder Interface Prescaler and Null Event Configuration ..................................................................15
7.2
Encoder Interface Hold Register Operation ..............................................................................................16
7.3
Timer Logic Step Pulse Length and Delay ................................................................................................17
7.4
Control Register and Interrupt Control ......................................................................................................17
7.5
Switch Matrix Read...........................................................................................................................................17
7.6
LED Matrix Write................................................................................................................................................17
8
SPI-Protocol for Interface with 6-bit Register ...................................................................................................18
8.1
Step and Direction Pulse conversion..........................................................................................................18
9
LED and Switch Matrix..............................................................................................................................................19
10 Package dimensions..................................................................................................................................................20
Copyright © 2004 TRINAMIC Motion Control GmbH & Co. KG
TMC423 Data Sheet – (V1.13 / June 20th, 2007)
4/22
List of Figures
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
1: Pinout TMC423 5
2: Block diagram of the TMC423 8
3: Application Environment
9
4: Example for Application with TMC236 Stepper Motor Driver
5: Example for Application with Step / Direction Power Stage
6: TMC423 Application
11
7: Timing diagram of the Serial Interface 12
8: Structure 32-Bit Interface
13
9: Overview TMC423 Registers
13
10: Encoder Output and Evaluation
14
11: Crosstalk on Encoder Wire
14
12: Step Direction conversion
18
13: Connection to the matrix
19
14: 100-Pin TQFP Top View
20
15: 100-Pin TQFP Side View
20
16: 100-Pin TQFP Side View Detail A
20
10
10
List of Tables
Table
Table
Table
Table
Table
Table
Table
Table
Table
Table
Table
Table
Table
Table
Table
1: TMC423 Pinout 7
2: Operating Conditions 7
3: Operating Conditions 7
4: Prescaler factors for different motors and encoders
11
5: Interrupt Flags 13
6: SPI Datagram Prescaler 16
7: SPI Datagram Hold Register
16
8: SPI Datagram Step-/Dir logic 17
9: SPI Datagram Control Register 17
10: Switch Matrix Read
17
11: LED Matrix Write
17
12: SPI Datagram Step / Direction Converter
18
13: Datagram example and RAM contents for three step-direction drivers 18
14: TMC423 LED Matrix Pins
19
15: TQFP Dimensions
21
Copyright © 2004 TRINAMIC Motion Control GmbH & Co. KG
TMC423 Data Sheet – (V1.13 / June 20th, 2007)
5/22
VCCI
EXT_RES
CLK
NC
VCCA
GND
PRA/IO
NINT
NSCS428
SDO428
NSCS
SCK
SDI
SDO
TCK
1 Pinout
GND
COLUMN_PIN(0)
TDI
COLUMN_PIN(1)
ENC1_A
COLUMN_PIN(2)
ENC1_B
COLUMN_PIN(3)
ENC1_N
ENC2_A
TMS
GND
VCCI
VKS (GND)
GND
VPP (VCCA)
ENC2_B
SW_ROW_PIN(0)
ENC2_N
ENC3_A
SW_ROW_PIN(1)
TMC423
TQFP-100 Package
ENC3_B
ENC3_N
SW_ROW_PIN(2)
SW_ROW_PIN(3)
STEP1
SW_ROW_PIN(4)
TRST
SW_ROW_PIN(5)
LED_ROW_PIN(0)
VCCI
DIR1
VSV (VCCA)
VCCI
LED_ROW_PIN(1)
STEP2
LED_ROW_PIN(2)
DIR2
LED_ROW_PIN(3)
LED_ROW_PIN(4)
LED_ROW_PIN(5)
STEP3
GND
Figure 1: Pinout TMC423
Copyright © 2004 TRINAMIC Motion Control GmbH & Co. KG
TDO
STOPL(2)
STOPL(1)
STOPL(0)
STOPR(2)
VCCI
STOPR(1)
REF(2)
STOPR(0)
REF(1)
REF(0)
GND
NC
GND
VCCA
PRB/IO
NSCS_D
SCK_D
SDI_D
SDO_D
DIR3
TMC423 Data Sheet – (V1.13 / June 20th, 2007)
1.1
6/22
Pin Description
Pin
Location
Dir
GND
In
Ground
ENC1_A
ENC1_B
ENC1_N
1, 9, 36, 39, 51, 68,
69, 91
3
4
5
In
In
In
ENC2_A
ENC2_B
ENC2_N
6
10
11
In
In
In
ENC3_A
ENC3_B
ENC3_N
12
13
14
In
In
In
TDI
TMS
TRST
TDO
TCK
VCCI
VCCA
GND
CLK
EXT_RES
NC
PRA / IO
PRB / IO
Step 1
Dir 1
Step 2
Dir 2
Step 3
Dir 3
SDO_D
SDI_D
SCK_D
NSCS_D
REF0
REF1
REF2
STOPR0
STOPR1
STOPR2
STOPL0
STOPL1
STOPL2
COLUMN_PIN0
COLUMN_PIN1
COLUMN_PIN2
COLUMN_PIN3
SW_ROW_PIN0
SW_ROW_PIN1
SW_ROW_PIN2
SW_ROW_PIN3
2
7
16
49
100
8, 20, 44, 58, 82
35, 57, 67, 90
39
88
87
37, 89
92
34
15
18
21
22
24
25
26
27
28
29
40
41
42
43
45
46
47
48
50
75
74
73
72
65
64
63
62
Incremental Encoder Interface 1 Channel A
Incremental Encoder Interface 1 Channel B
Incremental Encoder Interface 1 Channel N
(Connect to +5V if not used)
Incremental Encoder Interface 2 Channel A
Incremental Encoder Interface 2 Channel B
Incremental Encoder Interface 2 Channel N
(Connect to +5V if not used)
Incremental Encoder Interface 3 Channel A
Incremental Encoder Interface 3 Channel B
Incremental Encoder Interface 3 Channel N
(Connect to +5V if not used)
Connect to Ground
Connect to 5 Volt via Pull-Up Resistor
Connect to 5 Volt via Pull-Up Resistor
To be left open
Connect to Ground
Positive Power Supply 5 Volt
Positive Power Supply 2.5 Volt
Unused input: Connect to Ground
System Clock 16MHz
External Reset Low Active
Connect to Ground
To be left open
To be left open
Step/Direction Interface – Step Output Motor 1
Step/Direction Interface – Direction Output Motor 1
Step/Direction Interface – Step Output Motor 2
Step/Direction Interface – Direction Output Motor 2
Step/Direction Interface – Step Output Motor 3
Step/Direction Interface – Direction Output Motor 3
Step / Direction SPI MISO
Step / Direction SPI MOSI
Step / Direction SPI SCK
Step / Direction SPI NSCS
Reference switch output 1
Reference switch output 2
Reference switch output 3
Right Stop Switch Motor 1
Right Stop Switch Motor 2
Right Stop Switch Motor 3
Left Stop Switch Motor 1
Left Stop Switch Motor 2
Left Stop Switch Motor 3
Column Drive Pin 0
Column Drive Pin 1
Column Drive Pin 2
Column Drive Pin 3
Switch Matrix Pin 0
Switch Matrix Pin 1
Switch Matrix Pin 2
Switch Matrix Pin 3
In
In
In
In
In
In
Out
Out
Out
Out
Out
Out
Out
In
In
In
Out
Out
Out
In
In
In
In
In
In
Out
Out
Out
Out
In
In
In
In
Description
Copyright © 2004 TRINAMIC Motion Control GmbH & Co. KG
TMC423 Data Sheet – (V1.13 / June 20th, 2007)
SW_ROW_PIN4
SW_ROW_PIN5
LED_ROW_PIN0
LED_ROW_PIN1
LED_ROW_PIN2
LED_ROW_PIN3
LED_ROW_PIN4
LED_ROW_PIN5
SDO
SDI
SCK
NSCS
SDO428
NSCS428
NINT
61
60
59
56
55
54
53
52
99
98
97
96
95
94
93
7/22
In
In
Out
Out
Out
Out
Out
Out
Out
In
In
In
In
In
Out
Switch Matrix Pin 4
Switch Matrix Pin 5
LED Matrix Drive Pin 0
LED Matrix Drive Pin 1
LED Matrix Drive Pin 2
LED Matrix Drive Pin 3
LED Matrix Drive Pin 4
LED Matrix Drive Pin 5
SPI MISO
SPI MOSI
SPI SCK
SPI NSCS
SPI MISO Pin of TMC428
SPI NSCS Pin of TMC428
Interrupt Output (low active)
Table 1: TMC423 Pinout
Note: Pins which are not marked in Figure 1: Pinout TMC423 on page 5 must be left open.
1.2
Recommended Operating Conditions
Parameter
Clock Frequency (1)
Temperature
2.5 V Power Supply
5.0 V Power Supply
Value
16
0 … + 70
2.25 … 2.75
4.50 … 5.50
Unit
MHz
°C
VCCA
VCCI
Table 2: Operating Conditions
1 – slower frequencies are also supported. Please take care about the timing information in this datasheet, since they are
based on 16MHz Clock Frequency.
1.3
Electrical Characteristics
Parameter
Supply Current 2.5V
Supply Current 5.0V
(Output current = 0)
LED driver current per pin
Input voltage level Low
Input voltage level High
Encoder input pulse length
Encoder count rate
Min
Max
100
10
Unit
mA
mA
20
0.8
mA
V
V
2.4
2 tCLK
Table 3: Operating Conditions
Copyright © 2004 TRINAMIC Motion Control GmbH & Co. KG
fCLK
TMC423 Data Sheet – (V1.13 / June 20th, 2007)
8/22
2 Block Diagram
LED
5:0
SW
5:0
COL
3:0
EXT
RES
ENC1
A
Prescaler factor 10 bit
1/16, 2/16, ... 64
or 1/5, 2/5, ... 64
ENC1
B
Matrix
Control
prescaler+1
ENC1
N
Power On
Reset
+
NSCS
ENC2
A
SCK
Encoder
signal
decoder
ENC2
B
Encoder Counter
24+4 bit
SPI Interface
with 32 bit Reg
SDI
ENC2
N
M
U
X
Control register
ENC3
A
Encoder Hold
24 bit
Flag register
*Common Hold
command
*Interrupt enable
*Clear on N event
*Hold on N
*N polarity
ENC3
B
ENC3
N
SDO
SDO
428
NSCS
428
3 x Encoder Interface
INT
Logik+
Latch
STEP
1
NINT
NSCS
_D
DIR1
SPI Interface
with 6 Bit reg
SCK
_D
STEP
2
Timer logic
SDI
_D
Step pulse
length
8 bit
DIR2
STEP
3
DIR3
Step pulse
delay after dir
change 10 bit
SDO
_D
3 x Step / Direction converter
REF
MUX
CLK
VCC
GND
STOP
R3
STOP
R2
STOP
R1
STOP
L3
STOP
L2
STOP
L1
Figure 2: Block diagram of the TMC423
Copyright © 2004 TRINAMIC Motion Control GmbH & Co. KG
REF3
REF2
REF1
TMC423 Data Sheet – (V1.13 / June 20th, 2007)
9/22
3 Application Environment
TMC423 as Incremental Encoder Interface
TMC
236
TMC
236
TMC
236
TMC423 as Step / Direction converter
and Incremental Encoder Interface
Incremental
Encoder
Motor
Step/
Dir
Power
Stage
Motor
Incremental
Encoder
Step/
Dir
Power
Stage
Motor
Incremental
Encoder
Step/
Dir
Power
Stage
Motor
Incremental
Encoder
Incremental
Encoder
Motor
Incremental
Encoder
Motor
SPI-Interface
TMC
428
SPI-Interface
TMC
428
Step / Direction Interface
for up to three power stages
TMC
423
TMC
423
SPI-Interface
SPI-Interface
µC
µC
Figure 3: Application Environment
3.1
3.1.1
Application Description
Application with TMC236 Stepper Motor Driver
A complete close-loop motion control system consists of the TMC428 three-axis motion controller, the
powerful TMC236 stepper motor driver and the TMC423 Encoder Interface. The system is controlled by
an inexpensive microcontroller.
The main advantage of the system is that time critical communication to the TMC236 driver is
performed by the TMC428. The main purpose of the inexpensive microcontroller is to parameterize the
TMC428 and TMC423 and to send motion parameters like maximum speed or target position to the
TMC428. Position validation is done by reading the actual position of the TMC428 and the TMC423.
3.1.2
Application with Step / Direction Power Stage
Another possibility to built a close loop motion control system is to use the TMC423 as encoder
interface and also as a step direction converter. Thereto the TMC423 converts the SPITM datagrams
sent by the TMC428 into parameterizeable step and direction pulses. For parameterizing both the
TMC428 and TMC423 have to be connected via SPITM interface to an inexpensive microcontroller.
Copyright © 2004 TRINAMIC Motion Control GmbH & Co. KG
TMC423 Data Sheet – (V1.13 / June 20th, 2007)
3.2
10/22
Application Examples
3.2.1
Application with TMC236 Stepper Motor Driver
This example illustrates the encoder connection and the use of reference switches with the TMC423
and additionally the SPI interface connections between TMC423, TMC428 and a microcontroller. The
communication to the drivers (e.g. TMC236) is performed via SPI by the TMC428 motion control chip.
+5V
16MHz
16MHz
CLK
RESET
REF1
REF2
REF3
10k each
Connect to encoders
ENC1_A
ENC1_B
ENC1_N
SDI
SCK
SDO
NSCS
ENC2_A
ENC2_B
ENC2_N
ENC3_A
ENC3_B
ENC3_N
+5V
10k
SDI_D
SCK_D
NSCS_D
TRST
TMS
to nSCS_D
of TMC423
µC
GND1 - GND8
SW_ROW0 - SW_ROW5
Notes:
1. Application without LED and Switch matrix.
2. If the NSCS428 pin is not in use it has to be tied to +5V.
3. NSCS_D activates the reference switches (inputs
STOPRx/STOPLx and outputs REFx).
NC2
NC1
TCK
TDI
STOPR0 - STOPR2
STOPL0 - STOPL2
10k
SPI
to
Drivers
TMC423
VCCA1 - VCCA4
6x Reference Switch
Inputs (active high)
GND
SDI_S
SCK_S
SDO_S
nSCS_S
SDI_C
SCK_C
SDO_C
nSCS_C
SDO428
NSCS428
VCCI1 - VCCI5
from nSCS_S
of TMC428
470nF
Test
GND
TMC428
+5V
+2.5V
V5
V33
CLK
REF1
REF2
REF3
SS423
SS428
MISO
SCK
MOSI
+5V
10k
GND
GND
Figure 4: Example for Application with TMC236 Stepper Motor Driver
3.2.2
Application with Step / Direction Power Stage
Additionally to the previous example the use of the TMC423 as step/direction converter is shown. The
reference switches can be used as above.
SS423
MISO
SS428
SCK
MOSI
µC
+5V
16MHz
CLK
RESET
10k each
Connect to encoders
ENC1_A
ENC1_B
ENC1_N
+5V
+2.5V
VCCI1 - VCCI5
VCCA1 - VCCA4
+5V
SDI_D
SCK_D
SCK_C
SDI_C
SDO428
NSCS428
SDO_C
nSCS_C
SDI_D
SCK_D
SDO_D
NSCS_D
SDO_S
SCK_S
SDI_S
nSCS_S
STEP1
DIR1
STEP2
DIR2
STEP3
DIR3
Step/DIR
to
Drivers
TRST
TMS
STOPR0 - STOPR2
STOPL0 - STOPL2
16MHz
V33
TMC423
GND1 - GND8
10k
+5V
V5
CLK
ENC2_A
ENC2_B
ENC2_N
ENC3_A
ENC3_B
ENC3_N
TMC428
NSCS
SDO
SCK
SDI
GND
Notes:
1. Application without LED/switch matrix and
reference switches.
2. If the NSCS428 pin is not in use, it has to be tied
to +5V.
SW_ROW3 - SW_ROW5
NC2
NC1
TCK
TDI
GND
GND
Figure 5: Example for Application with Step / Direction Power Stage
Copyright © 2004 TRINAMIC Motion Control GmbH & Co. KG
470nF
Test
GND
TMC423 Data Sheet – (V1.13 / June 20th, 2007)
11/22
4 Dynamic Resolution Adaptation
The dynamic resolution adaptation is needed to link stepper motors and encoders with different
resolutions. The characteristics of the connected hardware must provided to the TMC423 by sending
the corresponding SPI telegram. (See 5.3.1 Overview on page 13 in this issue). The TMC423 multiplies
the encoder counter by a user selectable value in the range 1..1024, and then divides it by 16. When
using incremental encoders with N channel it is also possible to select between different behaviors
when the N channel is triggered.
Encoder:
Resolution: e.g.: 1000 steps / rotation
Stepper
motor
TMC423
Stepper Motor:
Resolution: e.g.: 12800 steps / rotation
SPI Interface
TMC423:
Prescaler = 3.2 -> 1000* 4 * 3.2 = 12800
Figure 6: TMC423 Application
Table 4 shows a number of prescaler factors for possible combinations of micro step resolution and
encoder resolution. Note: The given number of pulses have to be multiplied by four since 4-times
encoder signal evaluation is used. (See Figure 10: Encoder Output and Evaluation on page 14).
Microstep
s
12800
6400
3200
1600
800
400
1024
3.125
1.5625
-------------
1000
3.2
1.6
-------------
Encoder Resolution [Pulses / Rotation]
512
500
256
250
200
125
6.25
6.4
12.5
12.8
16
25.6
3.125
3.2
6.25
6.4
8
12.8
1.5625
1.6
3.125
3.2
4
6.4
------1.5625
1.6
2
3.2
------------1
1.6
-------------------
Table 4: Prescaler factors for different motors and encoders
Copyright © 2004 TRINAMIC Motion Control GmbH & Co. KG
50
64
32
16
8
4
2
25
---64
32
16
8
4
TMC423 Data Sheet – (V1.13 / June 20th, 2007)
12/22
5 Serial Peripheral Interface (SPI) with 32-bit Register
5.1
Description and Specification
Four pins named nSCS, SCK, SDI and SDO form the serial peripheral interface from a microcontroller
to the TMC423. The communication between the microcontroller and the TMC423 takes place via
datagrams with a fixed length of 32 bit. The microcontroller acts always as master and the TMC423 as
slave.
The SPITM of the TMC423 behaves like a simple 32-bit shift register. Incoming serial data at pin SDI is
shifted with the rising edge of the clock signal SCK into the 32-bit register. The content of this
register is copied after 32-bits with the rising edge of the selection signal nSCS into a buffer register
of 32-bit length. The SPITM of the TMC423 sends back data read from registers immediately via the
SDO signal. It processes serial data synchronously to the clock signal CLK.
Because of on-the-fly processing of the input data stream, the serial microcontroller interface of the
TMC423 requires the serial data clock signal SCK to have a minimum low / high time of three clock
cycles. The data signal SDI driven by the microcontroller has to be valid at the rising edge of the
serial data clock input SCK. The maximum duration of the serial data clock period is unlimited.
A complete serial datagram frame has a fixed length of 32 bit. While the data transmission from the
microcontroller to the TMC423 is idle, the low active serial chip select input nSCS and also the serial
data clock signal SCK are set to high. The serial data input SDI of the TMC428 has to be driven by the
microcontroller. Like other SPI compatible devices, the SDO signal of the TMC423 is high impedance
‘Z’ as long as nSCS is high.
The signal nSCS has to be high for at least three clock cycles before starting a datagram transmission.
To initiate a transmission, the signal nSCS has to be set to low. Three clock cycles later the serial data
clock may go low. The most significant bit (MSB) of a 32 bit wide datagram comes first and the least
significant bit (LSB) is transmitted as the last one. A data transmission is finished by setting nSCS
high for three or more CLK cycles after the last rising SCK slope. nSCS and SCK change in opposite
order from low to high at the end of a transmission as these signals change from high to low at the
beginning. The timing of the serial microcontroller interface is outlined in Figure 7: Timing diagram of
the Serial Interface.
tCLK
tDATAGRAMuC
tSUCSC
tHDCSC
tSCKCL
tSCKCH
tHDCSC
tSUCSC
CLK
nSCS
SCK
tSD
tSD
sdi_bit#31
SDI
tSD
sdi_bit#0
sdi_bit#30 . . . sdi_bit#1
tPD
sdo_bit#31
SDO
sdo_bit#30 ... sdo_bit#1
sdo_bit#0
tIS
tSI
30 x sampled SDI_C
1 x SDI_C sampled
1 x SDI_C sampled
one full 32 bit datagram
Figure 7: Timing diagram of the Serial Interface
Copyright © 2004 TRINAMIC Motion Control GmbH & Co. KG
TMC423 Data Sheet – (V1.13 / June 20th, 2007)
5.2
13/22
32-bit SPI Datagram Structure
Datagram from TMC423 send to µC
3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
9 8 7 6 5 4 3 2 1 0
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
INT
Data
0 0 0 0
Datagram from µC to TMC423
3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
9 8 7 6 5 4 3 2 1 0
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
R
W
Address
Data
Figure 8: Structure 32-Bit Interface
Interrupt Flags [Bit]
31
30
29
28
Name
INT_ext
INT_enc1
INT_enc2
INT_enc3
Description
external Interrupt, e.g. TMC428
N Signal of Encoder Interface 1 detected
N Signal of Encoder Interface 2 detected
N Signal of Encoder Interface 3 detected
Table 5: Interrupt Flags
SPI 32-bit Datagram Specification
Byte 3
30
29
28
27
26
25
Address
Data
21
20
19
18
17
16
15
14
13
12
11
10
9
8
0
0
0
1
Encoder 1 Prescaler
0
0
1
1
Encoder 2 Prescaler
0
0
0
0
0
1
0
1
Encoder 3 Prescaler
0
0
0
0
0
1
1
1
Encoder 1, 2, 3 Prescaler - set all commonly
0
0
0
0
1
0
0
Encoder 1 Position Register
0
0
0
0
1
0
1
Encoder 2 Position Register
0
0
0
1
1
0
0
0
0
1
1
1
1
0
0
1
0
0
0
1
0
7
6
5
4
3
2
1
Reserved
N Trigger
0
0
N Hold
0
0
N Clear
0
0
N Polarity
0
0
Matrix
22
Byte 0
0
Step /Dir 0
INT
23
Reserved
Reserved
Reserved
Encoder 3 Position Register
Step Pulse Length
Step Pulse Delay
Clear Flags
Control
24
Byte 1
Direction
31
Byte 2
INT EN
Byte #
Bit #
Overview
RW
5.3.1
Reg Hold
5.3
Reserved
Reserved
0
0
0
1
0
0
1
0
Switch Row 3
Switch Row 2
Switch Row 1
Switch Row 0
0
0
0
1
0
1
0
1
LED Row 3
LED Row 2
LED Row 1
LED Row 0
Figure 9: Overview TMC423 Registers
Copyright © 2004 TRINAMIC Motion Control GmbH & Co. KG
0
TMC423 Data Sheet – (V1.13 / June 20th, 2007)
14/22
6 Incremental Encoder
Incremental Encoders are translating the rotary motion of a shaft into a two-channel digital
quadrature output. The light emitted from a LED is focused onto a reflective code wheel. As the shaft
moves, the code wheel rotates, reflecting light from an alternating bright and dark pattern.
The TMC423 samples the incoming signals ENCx_a and ENCx_B from the incremental encoder. A
internal algorithm block counts the amount of edges generated by the encoder. A prescaler value can
be used to adapt the incremental encoder resolution to the stepper motor resolution.
For high resolution the TMC423 evaluates the encoder signals 4-times during each encoder step. This
has to kept in mind when choosing the prescaler value.
Step
Channel A
Channel B
Channel N
Evaluation
Figure 10: Encoder Output and Evaluation
Note: It is possible that the encoder signals ENCx_A, ENCx_B and ENCx_N are polluted with crosstalk
noise. Crosstalk could influence the internal logic, to overcome this problem internal filters are
applied to ensure correct functionality. Furthermore is saves the need for external analog filters.
e.g.: Figure 11: Crosstalk on Encoder Wire shows crosstalk from channel A to channel B.
Figure 11: Crosstalk on Encoder Wire
Copyright © 2004 TRINAMIC Motion Control GmbH & Co. KG
TMC423 Data Sheet – (V1.13 / June 20th, 2007)
15/22
7 Configuration Datagrams
7.1
Encoder
Interface
Configuration
Prescaler
and
Null
Event
The Encoder Interface Initialization datagram configures the parameterizeable encoder prescaler to
adapt the TMC423 for different incremental encoders. Furthermore the TMC423 behavior concerning
the N channel can be selected.
Example: A 1000 steps per rotation encoder is to connect at a stepper motor with 12800 microsteps per rotation. When the next
event at the high active N channel is found, the position register must set to zero. Only Encoder Interface 1 is connected.
The following datagram performs this task:
•
Bits 31 down to 24 have to be set to 01HEX to select encoder interface 1
•
The prescaler value has to set to 12800 / (1000*4) = 3.2. Therefore bits 23 down to 12 must set to 831HEX.
•
The N channel is set up correctly when bits 11 down to 0 are set to A0HEX.
Bit
31…28
27…25
24
23…12
Encoder Interface Initialization
“0000” Register Address
Interface Selection
000 = Interface 1
001 = Interface 2
010 = Interface 3
011 = Interface 1, 2 and 3
‘1’
External Encoder Resolution and Corresponding Prescaler Factor
Bits 15 … 12:
Fractional part of Factor. Unit: 1/16 (when bit 23 = 0) resp. 1/5 (bit 23 = 1)
Bits 22 … 16:
Integer part of Factor
Bit 23:
Switches Fractional part between 1/5 resolution or 1/16 resolution
Default:
(010)h (prescaler 1)
(default value after power on)
Example settings:
Encoder: 1024 lines (4096 steps per rotation)
(032)h for 12800 micro steps per rotation (prescaler 3.125)
(019)h for 6400 micro steps (prescaler 1.5625)
Encoder: 1000 lines
(831) h for 12800 micro steps (prescaler 3.2)
(813)h for 6400 micro steps (prescaler 1.6)
Encoder: 512 lines
(064)h for 12800 micro steps (prescaler 6.25)
(032)h for 6400 micro steps (prescaler 3.125)
(019)h for 3200 micro steps (prescaler 1.5625)
Encoder: 500 lines
(862)h for 12800 micro steps (prescaler 6.4)
(831)h for 6400 micro steps (prescaler 3.2)
(813)h for 3200 micro steps (prescaler 1.6)
Encoder: 256 lines
(0C8)h for 12800 micro steps (prescaler 12.5)
(064)h for 6400 micro steps (prescaler 6.25)
(032)h for 3200 micro steps (prescaler 3.125)
(019)h for 1600 micro steps (prescaler 1.5625)
Encoder: 250 lines
(8C4)h for 12800 micro steps (prescaler 12.8)
(862)h for 6400 micro steps (prescaler 6.4)
(831)h for 3200 micro steps (prescaler 3.2)
(813)h for 1600 micro steps (prescaler 1.6)
Encoder: 200 lines
(100)h for 12800 micro steps (prescaler 16)
(080)h for 6400 micro steps (prescaler 8)
(040)h for 3200 micro steps (prescaler 4)
(020)h for 1600 micro steps (prescaler 2)
Copyright © 2004 TRINAMIC Motion Control GmbH & Co. KG
TMC423 Data Sheet – (V1.13 / June 20th, 2007)
16/22
(010)h for 800 micro steps (prescaler 1)
Encoder: 125 lines
(993)h for 12800 micro steps (prescaler 25.6)
(8C4)h for 6400 micro steps (prescaler 12.8)
(862)h for 3200 micro steps (prescaler 6.4)
(831)h for 1600 micro steps (prescaler 3.2)
(813)h for 800 micro steps (prescaler 1.6)
Encoder: 50 lines (200 steps per rotation)
(400)h for 12800 micro steps (prescaler 64)
(200)h for 6400 micro steps (prescaler 32)
(100)h for 3200 micro steps (prescaler 16)
(080)h for 1600 micro steps (prescaler 8)
(040)h for 800 micro steps (prescaler 4)
(020)h for 400 micro steps (prescaler 2)
(010)h for 200 steps per rotation (prescaler 1)
11
10
9
8
7
6…0
N Polarity for Selected Interface
0 = active low (default)
1 = active high
When changing the polarity, please be aware that a single clear on N Event might be
triggered, and thus should not be initiated in the same write access.
Hold on N for Selected Interface
0 = no hold (default)
1 = active: Encoder counter freezes during 0 channel event.
Clear on N Event for Selected Interface
0 = no clear (default)
1 = active
When switched to active, then it depends on bit 8, if a clear event is issued only once, or
always when the N channel becomes active.
N Trigger Selection
0 = only at next N signal (default)
1 = always at N signal
The clear event last until the N signal goes inactive again. If earlier termination is desired,
i.e. to preset the encoder counter to a different value, disable “Clear on N” prior to
changing the position register.
add or sub register for each step (CW = looking onto the axis)
0= add for CW, sub for CCW (default)
1= add for CCW, sub for CW
Reserved
Table 6: SPI Datagram Prescaler
7.2
Encoder Interface Hold Register Operation
To read the actual contents of the position register or to preset the position register the following
command is to be used:
Bit
31…28
27…25
24
23…0
Encoder Interface Control (Read/Preload Encoder Hold Register)
“0000” Register Address
Select Encoder Hold Register
100 = Hold register in encoder interface 1
101 = Hold register in encoder interface 2
110 = Hold register in encoder interface 3
Read or Preload Selection
0 = Read encoder hold register
1 = Preload encoder hold register
Encoder Hold Register Data
Table 7: SPI Datagram Hold Register
Copyright © 2004 TRINAMIC Motion Control GmbH & Co. KG
TMC423 Data Sheet – (V1.13 / June 20th, 2007)
7.3
17/22
Timer Logic Step Pulse Length and Delay
To parameterize the step length and delay the next datagram is to be used:
Bit
31…25
24
23…16
15…6
5…0
Write Step Pulse Length / Delay
“0000111” Register Address
‘1’
Step Pulse Length (default value = 48(10) after PON)
Step Pulse Delay after Direction Change (default value = 160(10) after PON)
Reserved
Table 8: SPI Datagram Step-/Dir logic
7.4
Control Register and Interrupt Control
This datagram configures the interrupt control of the TMC423. When enabled, the N channel pulse of
all encoders is fed to the NINT pin.
Bit
31…25
24
23
22
21
20…0
Control Register
“0001000” Register Address
‘1’
Set Common Hold for Encoder Hold Registers
0 = no hold (default)
1 = freeze encoder hold registers
Encoder Interrupt Enable, if Null signal
0 = interrupt disable (default)
1 = interrupt enable
Clear Interrupt Flags
0 = no clear (default)
1= clear flags
Reserved
Table 9: SPI Datagram Control Register
7.5
Bit
31…25
24
23…18
17…12
11…6
5…0
Switch Matrix Read
Control Register
“0001001” Register Address
‘0’
Switch Matrix Register Row
Switch Matrix Register Row
Switch Matrix Register Row
Switch Matrix Register Row
3
2
1
0
Table 10: Switch Matrix Read
7.6
Bit
31…25
24
23…18
17…12
11…6
5…0
LED Matrix Write
Control Register
“0001010” Register Address
‘1’
LED Matrix Register Row 3
LED Matrix Register Row 2
LED Matrix Register Row 1
LED Matrix Register Row 0
Table 11: LED Matrix Write
Copyright © 2004 TRINAMIC Motion Control GmbH & Co. KG
TMC423 Data Sheet – (V1.13 / June 20th, 2007)
18/22
8 SPI-Protocol for Interface with 6-bit Register
The 6-bit SPI Interface is used to receive step / direction information from the TMC428. The TMC423
processes the data and issues the corresponding step / direction signals via the step / direction pins.
Bit0 (Pulse 1) have to be sent first to the TMC423.
Bit
0
1
2
3
4
5
Step / Direction Converter
Pulse 1
Direction 1
Pulse 2
Direction 2
Pulse 3
Direction 3
Table 12: SPI Datagram Step / Direction Converter
The order of the control signals serially sent from the TMC428 has to be defined. This can be done by
writing so called primary signal codes into the stepper motor driver datagram configuration area of
the on-chip configuration RAM of the TMC428. This signals codes are $13 (step first) and $12
(direction). To switch to the next motor the next motor bit (NxM) has to be set.
Position within
datagram
0
1
2
3
4
5
Driver/motor
1
2
3
NxM bit
TMC428 signal
code
RAM data
0
1
0
1
0
1
$13
$12
$13
$12
$13
$12
$13
$32
$13
$32
$13
$32
TMC428
mnemonic of
primary signal
Step
Direction
Step
Direction
Step
Direction
Table 13: Datagram example and RAM contents for three step-direction drivers
8.1
Step and Direction Pulse conversion
Step pulses can be modified in their pulse width and delayed after an direction change was done.
The corresponding datagram (See 7.3) on page 17) is used to parameterize the Step / Dir interface.
step_in
step pulse length
t
step_out
step pulse delay
t
dir
t
Figure 12: Step Direction conversion
Copyright © 2004 TRINAMIC Motion Control GmbH & Co. KG
TMC423 Data Sheet – (V1.13 / June 20th, 2007)
19/22
9 LED and Switch Matrix
The TMC423 can be used to drive a LED matrix or to get information from a switch matrix, whether
the switches are on or off. LEDs or switches are only active when the corresponding column is
selected by setting it to zero. The switch frequency of the column pins is fixed to 500 Hz at a clock
frequency of 16MHz. The LEDs are driven with a maximum current of 20mA.
The following Table 14: TMC423 LED Matrix Pins shows how the LED Matrix Write register is mapped
to the corresponding TMC423 pins to drive the LEDs.
TMC423 Pin: COLUMN_PIN [3:0]
Bit 3
0
1
1
1
Bit 2
1
0
1
1
Bit 1
1
1
0
1
TMC423 Pin: LED_ROW_PIN [5:0]
Bit 0
1
1
1
0
23
17
11
5
22
16
10
4
LED_Matrix_Write [23:0]
21
20
15
14
9
8
3
2
19
13
7
1
18
12
6
0
Table 14: TMC423 LED Matrix Pins
For correct external connection of the matrix please refer to the following Figure 13: Connection to
the matrix. If distortions causes by long PCB traces are to expect, then filter capacitors Cfilter of 100pF
have to be added.
TMC423
Column Pin [3:0]
7407
5V
LED_ROW_PIN[5:0] SW_ROW_PIN [5:0]
10k
Cfilter
(opt.)
180
Figure 13: Connection to the matrix
Copyright © 2004 TRINAMIC Motion Control GmbH & Co. KG
TMC423 Data Sheet – (V1.13 / June 20th, 2007)
10 Package dimensions
Figure 14: 100-Pin TQFP Top View
Figure 15: 100-Pin TQFP Side View
Figure 16: 100-Pin TQFP Side View Detail A
Copyright © 2004 TRINAMIC Motion Control GmbH & Co. KG
20/22
TMC423 Data Sheet – (V1.13 / June 20th, 2007)
JEDEC
Equivalent
Dimension
A
A1
A2
b
c
D/E
D1/E1
e
L
ccc
Theta
21/22
Min
0.05
1.35
0.17
0.09
0.45
0
TQFP100
MS-026 VAR BED
Nom
1.40
0.22
16.00 BSC
14.00 BSC
0.50 BSC
0.60
0.08
3.50 deg
Table 15: TQFP Dimensions
Notes :
- all dimensions are in millimeters
- BSC Basic Spacing between Centers
Copyright © 2004 TRINAMIC Motion Control GmbH & Co. KG
Max
1.60
0.15
1.45
0.27
0.20
0.75
7 deg
TMC423 Data Sheet – (V1.13 / June 20th, 2007)
Life support policy
TRINAMIC Motion Control GmbH & Co. KG does not
authorize or warrant any of its products for use in life
support systems, without the specific written consent
of TRINAMIC Motion Control GmbH & Co. KG. Life
support systems are equipment intended to support
or sustain life, and whose failure to perform, when
properly used in accordance with instructions provided,
can be reasonably expected to result in personal injury
or death.
© 2004 TRINAMIC Motion Control GmbH & Co. KG
Information given in this data sheet is believed to
be accurate and reliable. However no
responsibility is assumed for the consequences
of its use nor for any infringement of patents or
other rights of third parties, which may result form
its use.
Specifications subject to change without notice.
Copyright © 2004 TRINAMIC Motion Control GmbH & Co. KG
22/22