Mode

This document describes the setting procedure to use the A/D converter in repeat mode.


A/D Conversion Time
This section describes how to calculate A/D conversion time. Start processing time depends on which φAD is selected. A/D conversion starts after the start processing time elapses by setting the ADST bit in the ADCON0 register to 1 (A/D conversion start). When reading the ADST bit before starting A/D conversion, 0 (A/D conversion stop) is read.

A/D Conversion Cycle
In repeat mode, inter-execution processing time is inserted between A/D conversions.
• Repeat mode: Start processing time + (A/D conversion execution time + inter-execution processing time + A/D conversion execution time + inter-execution processing time + ...)   Start processing time φAD = fAD 1 to 2 cycles of fAD φAD = fAD divided by 2 2 to 3 cycles of fAD φAD = fAD divided by 3 3 to 4 cycles of fAD φAD = fAD divided by 4 3 to 4 cycles of fAD φAD = fAD divided by 6 4 to 5 cycles of fAD φAD = fAD divided by 12 7 to 8 cycles of fAD A/D conversion execution time Open-circuit detection disabled 40 cycles of φAD Open-circuit detection enabled 42 cycles of φAD Inter-execution processing time 1 cycle of φAD Typ. Max.

φAD
A/D operating clock frequency

Sample Code
A sample code can be downloaded from the Renesas Electronics website. To download, click "Application Notes" in the left-hand side menu of the M16C Family page.

Sample Code Operation
In repeat mode, functions listed in Table 6.1 can be selected. The settings used in the sample code are marked with " " in the table. The sample code operation is as follows; set the CPU clock as the main clock with no division by executing functions for CPU initialization, transition from 125 kHz on-chip oscillator mode to high-speed mode, then execute the function for A/D conversion in repeat mode. Refer to 6.2 Function Tables for details on functions.

Function Tables
Function Tables for This Document   Other Function Tables   Declaration  void ad_repeat(

General Precautions in the Handling of MPU/MCU Products
The following usage notes are applicable to all MPU/MCU products from Renesas. For detailed usage notes on the products covered by this manual, refer to the relevant sections of the manual. If the descriptions under General Precautions in the Handling of MPU/MCU Products and in the body of the manual differ from each other, the description in the body of the manual takes precedence.

Handling of Unused Pins
Handle unused pins in accord with the directions given under Handling of Unused Pins in the manual.
The input pins of CMOS products are generally in the high-impedance state. In operation with an unused pin in the open-circuit state, extra electromagnetic noise is induced in the vicinity of LSI, an associated shoot-through current flows internally, and malfunctions occur due to the false recognition of the pin state as an input signal become possible. Unused pins should be handled as described under Handling of Unused Pins in the manual.

Processing at Power-on
The state of the product is undefined at the moment when power is supplied. The states of internal circuits in the LSI are indeterminate and the states of register settings and pins are undefined at the moment when power is supplied. In a finished product where the reset signal is applied to the external reset pin, the states of pins are not guaranteed from the moment when power is supplied until the reset process is completed.
In a similar way, the states of pins in a product that is reset by an on-chip power-on reset function are not guaranteed from the moment when power is supplied until the power reaches the level at which resetting has been specified.

Prohibition of Access to Reserved Addresses
Access to reserved addresses is prohibited. The reserved addresses are provided for the possible future expansion of functions. Do not access these addresses; the correct operation of LSI is not guaranteed if they are accessed.

Clock Signals
After applying a reset, only release the reset line after the operating clock signal has become stable. When switching the clock signal during program execution, wait until the target clock signal has stabilized. When the clock signal is generated with an external resonator (or from an external oscillator) during a reset, ensure that the reset line is only released after full stabilization of the clock signal. Moreover, when switching to a clock signal produced with an external resonator (or by an external oscillator) while program execution is in progress, wait until the target clock signal is stable.

Differences between Products
Before changing from one product to another, i.e. to one with a different part number, confirm that the change will not lead to problems.
The characteristics of MPU/MCU in the same group but having different part numbers may differ because of the differences in internal memory capacity and layout pattern. When changing to products of different part numbers, implement a system-evaluation test for each of the products.