Fujitsu MB90480 Series Hardware Manual page 402

F2mc-16lx 16-bit microcontroller
Table of Contents

Advertisement

CHAPTER 17 8/10-BIT A/D CONVERTER
<Interrupt>
Read conversion value
Disable interrupt, clear interrupt
request flag
Read conversion value
Enable interrupt
<Interrupt vector>
Set vector table
Note:
Setting related to clock and setting of _set_il (numeric value)
are required in advance. See the chapter of clock and interrupt.
Setting method other than program example
● Type of conversion mode and setting method
The following three conversion modes are available.
• Single conversion mode to convert once and terminate
• Continuous conversion mode to convert specified channels
• Stop mode to temporarily stop after specified channels are converted
The conversion mode is set by the conversion mode selection bits (ADCS1. MD[1:0]).
To set to single conversion mode
To set to continuous conversion mode
● Method to specify bit length
Set by the number of storage bits of conversion result (ADCR.S10).
To store to ADCR1, 2 register with 10-bit
To store to ADCR1 register with 8-bit
● Method to select channel
Channel to start the conversion is set by the A/D conversion start channel bits (ADCS1.ANS[2:0]).
Channel to end the conversion is set by the A/D conversion end channel bits (ADCS1.ANE[2:0]).
380
Register name. bit name
ADCS2
.INT
.INTE
ADCR1- 2
ADCS2
.INTE
Operation mode
To set to stop mode
Operation mode
__interrupt void AD0_ch0_int(void) /*
{
IO_ADCS2.bit.INT = 0;
IO_ADCS2.bit.INTE = 0;
[Any storage location] = IO_ADCR1-2; /* Store conversion value */
IO_ADCS2.bit.INTE = 1;
}
#pragma intvect AD0_ch0_int 40
Note:
For the description form of the register, see "SAMPLE I/O REGISTER FILES
2
FOR F
MC-16LX FAMILY MB90480 SERIES".
Conversion mode selection bits (MD[1:0])
Set to "00
umber of storage bits of conversion result
N
(Continued)
*/
/* Bit14=0: Clear AD0 interrupt flag */
/* Bit13=0: Disable AD0 interrupt */
/* Bit13=1: Enable AD0 interrupt */
", "01
"
B
B
Set to "10
"
B
Set to "11
"
B
Set to "0"
Set to "1"
(S10)

Advertisement

Table of Contents
loading

Table of Contents