TMC4330A Datasheet | Document Revision 1.01 • 2017-JAN-12
59/166
Position Comparison of Internal Values
TMC4330A provides several ways of comparing internal values. The position comparison
process is permanently active and associated with one flag and one event. A positive
comparison result can be forwarded through the INTR pin using the POS_COMP_REACHED
event as interrupt source or by using the TARGET_REACHED pin as explained in section 8.4.2,
page 58.
Basic
How to compare the internal position with an arbitrary value:
Comparison
Settings
Action:
Select a comparison value in the POS_COMP register 0x32.
Select pos_comp_source = 0 (REFERENCE_CONF register 0x01).
Result:
XACTUAL is compared with POS_COMP. When POS_COMP equals XACTUAL the
POS_COMP_REACHED_Flag becomes set and the POS_COMP_REACHED event
becomes released.
Select External
Position as
Comparison
Base
How to compare the external position with an arbitrary value:
Action:
Select a comparison value in the POS_COMP register 0x32.
Select pos_comp_source = 1 (REFERENCE _CONF register 0x01).
Result:
ENC_POS is compared with POS_COMP. When POS_COMP equals ENC_POS the
POS_COMP_REACHED_Flag becomes set and the POS_COMP_REACHED event
becomes released.
NOTE:
Because ENC_POS represents microsteps and not encoder steps, POS_COMP
represents also microsteps for the comparison process with external positions.
In case ENC_POS moves past POS_COMP without assuming the same value as
POS_COMP, the POS_COMP_REACHED event is not flagged but is nonetheless
listed in the EVENTS register in order to indicate that it has traversed.
Comparison
selection grid
In addition to comparing XACTUAL / ENC_POS with POS_COMP, it is also possible to
conduct a comparison of one of both parameters with X_HOME or X_LATCH resp.
ENC_LATCH. TMC4330A also allows comparison of the revolution counter REV_CNT
against POS_COMP.
Only the selected combination generates the POS_COMP_REACHED_Flag
and the corresponding event. Therefore, select modified_pos_compare in
the REFERENCE_CONF register 0x01 as outlined in the table below:
SETTINGS
ALERT
!
Comparison Selection Grid
pos_comp_source
modified_pos_compare
‘0’
‘1’
‘00’
‘01’
‘10’
‘11’
XACTUAL vs. POS_COMP
XACTUAL vs. X_HOME
XACTUAL vs. X_LATCH
ENC_POS vs. POS_COMP
ENC_POS vs. X_HOME
ENC_POS vs. ENC_LATCH
REV_CNT vs. POS_COMP
Table 27: Comparison Selection Grid to generate POS_COMP_REACHED_Flag
© 2015 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany — Terms of delivery and rights
to technical change reserved. Download newest version at: www.trinamic.com .
Read entire documentation; especially the “Supplemental Directives” on page 160.
MAIN MANUAL