EasyManuals Logo

Renesas V850 Series User Manual

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
Page #147 background imageLoading...
Page #147 background image
CHAPTER 4 PROGRAM LIST
Application Note U17209EJ1V0AN
150
sw = ~IN_data( SW ) & 0x07 ; /* Read operation button */
if ( sw == 1 ) {
sw_mode = CW ;
} else if ( sw == 2 ) {
sw_mode = CCW ;
} else if ( sw == 4 ) {
sw_mode = STOP ;
}
switch( proc_no ) {
/* STOP processing */
case 0 :
if ( sw_mode == CW ) {
_ _DI() ;
object_speed = SPEED_MINI ; /* Set target speed to minimum value */
stop_flag = OFF ;
timer_count = WATCH_START ; /* Set speed monitor start time to 5 SEC */
accel_count = ACCEL_VAL_1ST ;/* Set acceleration/deceleration counter */
init_flag = 2 ; /* CCW initial request */
start_init() ; /* Initialize revolution start */
_ _EI() ;
proc_no = 1 ; /* Set next processing number */
} else if ( sw_mode == CCW ) {
_ _DI() ;
stop_flag = OFF ; /* Stop flag off */
object_speed = -SPEED_MINI ; /* Set target speed to minimum value */
timer_count = WATCH_START ; /* Set speed monitor start time to 5 SEC */
accel_count = ACCEL_VAL_1ST ;/* Set acceleration/deceleration counter */
init_flag = 3 ; /* CCW initial request */
start_init() ; /* Initialize revolution start */
_ _EI() ;
proc_no = 4 ; /* Set CCW processing number */
}
break ;
/* CW processing, acceleration */
case 1 :
if ( accel_count == 0 ) {
accel_count = ACCEL_VAL ; /* Set acceleration/deceleration counter */
if ( object_speed < speed ) {
object_speed += accel_spd ;
if ( object_speed > speed ) object_speed = speed;
timer_count = WATCH_START ;/* Set speed monitor start time to 5 SEC */
} else if ( object_speed > speed ) {
object_speed -= accel_spd ;
if ( object_speed < speed ) object_speed = speed;
timer_count = WATCH_START ;/* Set speed monitor start time to 5 SEC */
} else {
proc_no = 2 ; /* Constant-speed processing */
}

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Renesas V850 Series and is the answer not in the manual?

Renesas V850 Series Specifications

General IconGeneral
BrandRenesas
ModelV850 Series
CategoryInverter
LanguageEnglish