NOVA electronics Inc.
MCX514 -
39
-
39
-
Set to enable SYNC2
synchronous actions.
For more details of the synchronous action functions and settings, see chapter 2.6.
■
Example: Synchronous Action Activation
While 10 seconds timer is running, to activate relative position driving in X axis after 5 seconds from timer-start by synchronous
action SYNC2, set as follows.
The timer activates the synchronous action after 5 seconds from timer-start and is up after 10 seconds.
WR6 ← 4B40h
WR7 ← 004Ch
MR2
:
Set 5,000,000
WR0 ← 0112h
(5 seconds
=
5,000,000μsec)
WR6 ← 9680h
WR7 ← 0098h
Timer
:
Set 10,000,000
WR0 ← 0116h
(10 seconds
=
10,000,000)
WR6 ← 0300h
D11,D10
:
0,0 Comparison condition
:
≧
D9,D8
:
1,1
Comparative object
:
Current timer value (CT)
WR0 ← 0120h
Writes multi-purpose register mode setting
WR6 ← 00A1h
Activation factor code 01h
:
MR2 comparison changed to True
Action code 0Ah
:
Start of relative position driving
WR0 ← 0128h
Writes synchronous action SYNC2 setting
WR0
← 0184h
Synchronous action SYNC2 enable setting command
※
Parameters for relative position driving must be set in advance.
For more details of the relative position driving, see chapter 2.1.1.
■
Generating an Interrupt
The user can generate an interrupt according to the comparison result of a multi-purpose register. When the comparison result of a
multi-purpose register changes to meet a specified comparison condition, an interrupt occurs. If it already meets the comparison
condition when an interrupt is enabled, an interrupt does not occur at that time. After it returns the state not to meet a specified
comparison condition, if the comparison result of a multi-purpose register again changes to meet the specified comparison
condition, an interrupt will occur.
To generate an interrupt according to the comparison result of multi-purpose register MR3~0, the user needs to set each bit of the
interrupt factor of WR1 mode register 1 to enable for the multi-purpose register that is used for comparison. The interrupt factor of
when an interrupt occurs can be checked by the interrupt factor check bit of RR1 Status register 1.
Table 2.4-6 Interrupt Enable and Check Bit corresponding to Comparison Result of Multi-purpose Register
Multi-purpose Register
Interrupt Enable Bit
Interrupt Factor Check Bit
MR0
WR1
/
D0
:
1
RR1
/
D0
:
1
MR1
WR1
/
D1
:
1
RR1
/
D1
:
1
MR2
WR1
/
D2
:
1
RR1
/
D2
:
1
MR3
WR1
/
D3
:
1
RR1
/
D3
:
1
For more details of the interrupt, see chapter 2.10.
■
Example: Interrupt
When the real position counter value is passing through 30,000, an interrupt occurs in X axis.
WR6 ← 7530h
WR7 ← 0000h
MR3
:
Set 30,000
WR0 ← 0112h
WR6 ← 0060h
D15,D14
:
1,0 Comparison condition
:=
D13,D12
:
0,1 Comparative object
:
Real position counter (RP)
WR0 ← 0120h
Writes multi-purpose register mode setting
WR0 ← 011Fh
Assign
X
axis (NOP command)
WR1 ← 0008h
Interrupt Factor
:
Enable MR3 comparison changed to True
Set comparative object and comparison
condition of MR3
Set the value to MR3
Set the interrupt factor
Set comparative object and comparison
condition of MR2
Set the value to MR2
Set10 seconds to the timer value
Set the function of SYNC2