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 #182 background imageLoading...
Page #182 background image
CHAPTER 4 PROGRAM LIST
Application Note U17209EJ1V0AN
185
}
4.5.10 A/D converter interrupt processing function
/****************************************************************************** /
/* A/D converter interrupt processing */
/****************************************************************************** /
_ _multi_interrupt
void int_AD0(void)
{
iua = (( ADCR0 & 0x3ff ) - 0x200) ;
if ( abs(iua) > MAX_I ) {
HZA0CTL1 |= 0x08; /* PWM output off */
error_flag = ERR_NO1 ; /* Set error No. */
}
iva = (( ADCR1 & 0x3ff ) - 0x200) ;
if ( abs(iva) > MAX_I ) {
HZA0CTL1 |= 0x08; /* PWM output off */
error_flag = ERR_NO1 ; /* Set error No. */
}
volume = 1023 - ( ADCR3 & 0x3ff ) ; /* Set volume value */
Motor_CONT() ;
cont_time = TMD0 * 10 / 32; /* Convert to uSEC */
}
4.5.11 Hardware initialization processing function
/****************************************************************************** /
/* Hardware (peripheral I/O) initialization */
/****************************************************************************** /
void hinit( void )
{
/* Port mode register initialization */
PM4 = 0xf7 ;
PMDL = 0x00 ;
OUT_data( LED11, 0xff ) ; /* LED OFF */
OUT_data( LED12, 0xff ) ;
OUT_data( LED13, 0xff ) ;
OUT_data( LED14, 0xff ) ;
OUT_data( LED21, 0xff ) ;
OUT_data( LED22, 0xff ) ;
OUT_data( LED31, 0xff ) ;
OUT_data( LED32, 0xff ) ;
OUT_data( LED41, 0xff ) ;
OUT_data( LED42, 0xff ) ;
/* Set 10 mSEC timer TMD0 */
TMCD0 = 0x00; /* Stop (reset) timer D0 */

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