EasyManua.ls Logo

Renesas V850 Series - Msec Interval Interrupt Processing Function

Renesas V850 Series
186 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
CHAPTER 4 PROGRAM LIST
Application Note U17209EJ1V0AN
83
/* */
if ( ( ( init_flag == 0 ) && ( stop_flag == OFF) ) ) {
sa_time = TM4 ;
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.1.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 ;
}

Table of Contents