EasyManua.ls Logo

Renesas V850 Series - Motor Control 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
129
if ( reg == WRESET ) {
P3.0 = 0;
data = 1; /* Dummy step */
P3.0 = 1;
} else {
PDL = data | ( reg << 8 );
PDL = reg | ( reg << 8 ) | 0x8000;
}
}
/****************************************************************************** /
/* External I/O input subroutine */
/* reg : Input register number */
/****************************************************************************** /
unsigned short IN_data( int reg )
{
unsigned char *po;
/* */
if ( reg == SW ) {
return P4;
} else {
return 0;
}
}
4.3.7 Motor control interrupt processing function
#include "Common.h"
#include "Motor.h"
#pragma ioreg /* Peripheral I/O register definition */
/****************************************************************************** /
/* Motor control timer interrupt processing */
/****************************************************************************** /
_ _interrupt
void int_MOTOR(void)
{
ADA0M0 = 0xB0 ; /* Start AD0 */
ADA1M0 = 0xA0 ; /* Start AD1 */
}
/****************************************************************************** /
/* Motor control processing */
/****************************************************************************** /
void Motor_CONT(void)
{
signed int wrm, wre, trm, tre ;
signed int o_wre, we, o_iqap, o_iqa ;
signed int s_time, ek, sa ;
unsigned char wk, wk2 ;
signed int cow ;

Table of Contents