CHAPTER 4 PROGRAM LIST
Application Note U17209EJ1V0AN
163
4.4.12 Common area initialization processing function
/****************************************************************************** /
/* Common area initialization */
/****************************************************************************** /
void ainit( void )
{
/* Initialization of flags */
error_flag = 0 ; /* Clear error flag */
init_flag = OFF ; /* Initial flag off */
disp_co = 100 ;
d_speed = 0 ;
/* Motor control area initialization */
stop_flag = ON ; /* Stop flag on */
object_speed = 0 ; /* Target speed 0 */
o_iqai = 0 ; /* Speed integral value 0 */
}
4.4.13 Revolution start initialization processing function
/****************************************************************************** /
/* Revolution start initialization */
/****************************************************************************** /
void start_init( void )
{
int i;
/* */
for ( i = 0 ; i < 21 ; i++ ) before_posi[i][1] = 0;
total_sa = 0 ;
sum_speed = 0 ;
speed_co = 100000 / TS ;
init_co = 0 ;
init_pat = 0 ;
init_upco = 0 ;
TQ0IOC0 = 0x55; /* Positive phase normal output, output enabled */
TQ0IOC3 = 0xfc; /* Negative phase inverted output, output enabled */
}
4.4.14 Link directive file for V850E/IA4
/****************************************************************************** /
/* Link directive file for V850E/IA4 */
/****************************************************************************** /
VECT_RESET: !LOAD ?RX V0x00000000 {
.vect_RESET = $PROGBITS ?AX .vect_RESET;
};