CHAPTER 4 PROGRAM LIST
Application Note U17209EJ1V0AN
109
TMC4 = 0x61;
TMC4 = 0x63; /* Restart timer */
if ( ~P2 & 0x02 ) { /* Check V phase */
base_position = RAD*2/3/P ;
} else {
base_position = RAD/6/P ;
}
if ( object_speed < 0 ) {
wk = run_ccw_data[ P2 & 0x07 ][0] ;
} else {
wk = run_cw_data[ P2 & 0x07 ][0] ;
}
if ( wk & 0x01 ) {
BFCM00 = 0 ;
BFCM01 = pwm_value ;
BFCM02 = pwm_value ;
} else if ( wk & 0x04 ) {
BFCM00 = pwm_value ;
BFCM01 = 0 ;
BFCM02 = pwm_value ;
} else {
BFCM00 = pwm_value ;
BFCM01 = pwm_value ;
BFCM02 = 0 ;
}
POER0 = wk ;
}
int_co++ ;
}
4.2.9 10 mSEC interval interrupt processing function
/****************************************************************************** /
/* Other timer interrupt processing (10 mSEC interval) */
/****************************************************************************** /
_ _multi_interrupt
void int_ETC(void)
{
unsigned short dummy ;
/* Wait timer processing */
if ( timer_count != 0 ) {
timer_count -= 1 ;
}
/* Acceleration/deceleration timer processing */
if ( accel_count != 0 ) {
accel_count -= 1 ;