![Melec C-875 Instruction Manual Download Page 90](http://html1.mh-extra.com/html/melec/c-875/c-875_instruction-manual_1767048090.webp)
- 90 -
16-2.INITIALIZE Program Example
Execute this program at POWER ON/RESET as needed.
This program is developed based on the following specifications.
(1) DRIVE Specification
DRIVE TYPE=L, LIMIT STOP TYPE=fast stop, MOTOR TYPE=Stepping motor and RDYINT=Not output in any case
shall be specified.
(2) PULSE COUNTER and Comparator Specification
The PULSE COUNTER is supposed to operate with drive pulse from the MCC05v2, and the COMPARE REGISTER1
output on the conferred matching is to output to the CNTINT. Address of the COMPARE REGISTER1 detection
shall be 10000(2710 ), and the deceleration-to-stop shall be selected for the COMP STOP TYPE.
H
(3) Address Specification
Motor current address shall be defined as 1000(3E8 ), and 1000(3E8 ) shall also be preset for the pulse
H
H
counter.
/*-----------------------------------*/
/*
X-AXIS MCC05 INITIALIZE
*/
/*-----------------------------------*/
void
xmcc05inz( void )
{
/** SPEC INITIALIZE1 COMMAND **/
xmccrdy();
/* X-AXIS MCC05 RDY WAIT */
outp(XMCCDT1 ,0x28);
/* DRIVE SPEC DATA OUT */
outp(XMCCCOM ,0x01);
/* SPEC INITIALIZE1 COMMAND OUT */
/** PULSE COUNTER INITIALIZE COMMAND **/
xmccrdy();
/* X-AXIS MCC05 RDY WAIT */
outp(XMCCDT1 ,0x01);
/* COUNTER SPEC DATA1 OUT */
outp(XMCCDT2 ,0x20);
/* COUNTER SPEC DATA2 OUT */
outp(XMCCDT3 ,0x00);
/* COUNTER SPEC DATA3 OUT */
outp(XMCCCOM ,0x02);
/* PULSE COUNTER INITIALIZE COMMAND OUT */
/** ADDRESS INITIALIZE COMMAND **/
xmccrdy();
/* X-AXIS MCC05 RDY WAIT */
outp(XMCCDT1 ,0x00);
/* ADDRESS MSB OUT */
outp(XMCCDT2 ,0x03);
outp(XMCCDT3 ,0xe8);
/* ADDRESS LSB OUT */
outp(XMCCCOM ,0x03);
/* ADDRESS INITIALIZE COMMAND OUT */
/** COUNTER PRESET COMMAND **/
outp(XCNTDT1 ,0x00);
/* COUNTER MSB OUT */
outp(XCNTDT2 ,0x03);
outp(XCNTDT3 ,0xe8);
/* COUNTER LSB OUT */
outp(XCNTCOM ,0x00);
/* COUNTER PRESET COMMAND OUT */
/** COUNTER REGISTER1 SET COMMAND **/
outp(XCNTDT1 ,0x00);
/* COMPARE REGISTER1 MSB OUT */
outp(XCNTDT2 ,0x27);
outp(XCNTDT3 ,0x10);
/* COMPARE REGISTER1 LSB OUT */
outp(XCNTCOM ,0x01);
/* COUNTER REGISTER1 SET COMMAND OUT */
}
Note: At POWER ON/RESET, above settings are all initialized their specific specification.
Thus, the above processing shall be done only when a modification is needed.
For details of the initial specifications, see Chapter 10.
Summary of Contents for C-875
Page 98: ... 98 2 M TYPE 3 H TYPE ...