User manual

PD-1021 TMCL Firmware V1.19 Manual (Rev. 1.01 / 2012-JUL-30) 53
www.trinamic.com
3.5.33 EI (enable interrupt)
The EI command enables an individual interrupt and activates interrupts in general (global interrupt
enable). Please make sure to always issue a global interrupt enable in order to actually activate the
interrupts individually enabled.
Related command: DI, VECT, RETI
Mnemonic: EI <interrupt number>
Binary representation:
INSTRUCTION NO.
TYPE
MOT/BANK
VALUE
25
<interrupt number>
(don't care)
(don't care)
THE FOLLOWING TABLE SHOWS ALL INTERRUPT VECTORS THAT CAN BE USED:
Interrupt number
Interrupt type
0
Timer 0
1
Timer 1
2
Timer 2
3
(Target) position reached
15
Stall (stallGuard2)
21
Deviation
27
Stop left
28
Stop right
39
IN_0 change
40
IN_1 change
255
Global interrupts
Examples:
Enable interrupts globally
EI, 255
Binary format of EI:
Byte Index
0
1
2
3
4
5
6
7
Function
Target-
address
Instruction
Number
Type
Motor/
Bank
Operand
Byte3
Operand
Byte2
Operand
Byte1
Operand
Byte0
Value (hex)
$01
$19
$FF
$00
$00
$00
$00
$00
Enable interrupt when target position reached
EI, 3
Binary format of EI:
Byte Index
0
1
2
3
4
5
6
7
Function
Target-
address
Instruction
Number
Type
Motor/
Bank
Operand
Byte3
Operand
Byte2
Operand
Byte1
Operand
Byte0
Value (hex)
$01
$19
$03
$00
$00
$00
$00
$00