Operation Of The 10-Bit A/D Converter - Fujitsu MB91319 Series Hardware Manual

Fr60 32-bit microcontroller
Table of Contents

Advertisement

12.3

Operation of the 10-Bit A/D Converter

This section explains A/D conversion started by software and an external trigger.
■ A/D Conversion Started by Software
To perform A/D conversion started by software, select the required channel from analog input
pins AN0 to AN9. Write 1 to the corresponding bit of the ADCH register to enable A/D conversion.
❍ Single channel
If only one channel is selected as the analog input pin for conversion, writing 1 to the STR bit of
the ADCTH register starts software-started conversion and sets the BUSY bit of the ADCTL
register to 1.
Writing 1 to the STR bit again during conversion initializes the converter and restarts conversion.
After A/D conversion ends, the BUSY bit of the ADCTL register is reset to 0 and the INT bit of the
ADCTL register is set to 1. These status bits can be read to determine whether conversion has
ended. To generate an interrupt to complete conversion, set the INTE bit of the ADCTL register to
1 beforehand.
❍ Multiple channels (scan conversion)
If multiple channels are selected as the analog input pins for conversion, the converter performs
A/D conversion for the first selected channel and then stores the conversion result in the register
corresponding to the channel. The converter then repeats this process for the remaining selected
channels.
Writing 1 to the corresponding bit of the ADCTH register to select the channel for conversion and
writing 1 to the STR bit of the ADCTH register starts conversion and sets the BUSY bit of the
ADCTL register to 1. The channels are converted sequentially from 0 to 9. If a channel is not
selected in the ADCTH register, the converter skips that channel and starts conversion for the
next selected channel.
Writing 1 to the STR bit again during conversion initializes the converter and restarts conversion
for the selected channels in the order of 0 to 9.
When A/D conversion for all selected channels ends, the BUSY bit of the ADCTL register is reset
to 0 and the INT bit of the ADCTL register is set to 1. To generate an interrupt to complete
conversion, set the INTE bit of the ADCTL register to 1 beforehand.
The results of A/D conversion are stored in the registers of individual channels.
■ A/D Conversion Started by External Trigger
If external trigger start is enabled (ADCTH: TRG = 1), detection of a rising edge at external pin
ATRG starts A/D conversion. If the signal for A/D conversion by software is received when the
external trigger is enabled, conversion is also started. If a rising edge is detected again at
external pin ATRG during A/D conversion, conversion is continued and the edge is ignored.
CHAPTER 12 10-BIT A/D CONVERTER
247

Advertisement

Table of Contents
loading

Table of Contents