Using the M16C/62 Analog to Digital Converter in Repeat Sweep Mode 0

Similar documents
Using the M16C/62 Analog to Digital Converter in One-Shot Mode

Successive approximation (capacitive coupling amplifier)

M16C/26 APPLICATION NOTE. Using The M16C/26 Timer in PWM Mode. 1.0 Abstract. 2.0 Introduction

M16C/26 APPLICATION NOTE. Using Timer A in One-Shot Mode. 1.0 Abstract. 2.0 Introduction

APPLICATION NOTE. Achieving Accuracy in Digital Meter Design. Introduction. Target Device. Contents. Rev.1.00 August 2003 Page 1 of 9

Pulse period. Pulse low width. Pulse high width. Pulse high width. Pulse high width Pulse period

1SS120. Silicon Epitaxial Planar Diode for High Speed Switching. Features. Ordering Information. Pin Arrangement

2SB739. Silicon PNP Epitaxial. Application. Outline. Absolute Maximum Ratings. REJ03G (Previous ADE ) Rev.2.00 Aug.10.

2SB740. Silicon PNP Epitaxial. Application. Outline. Absolute Maximum Ratings. REJ03G (Previous ADE ) Rev.2.00 Aug.10.

<TRANSISTOR ARRAY> M54562FP 8-UNIT 500mA DARLINGTON TRANSISTOR ARRAY WITH CLAMP DIODE SOURCE TYPE

RoHS COMPLIANT MGF4841AL is a RoHS compliant product. RoHS compliance is indicated by the letter G after the Lot Marking.

2SC1345. Silicon NPN Epitaxial. Application. Outline. Absolute Maximum Ratings. REJ03G (Previous ADE A) Rev.3.00 Sep.10.

HD74LV2G66A. 2 channel Analog Switch. Description. Features. REJ03D Z (Previous ADE C (Z)) Rev.4.00 Sep

RT3DKAM DKA ISAHAYA ELECTRONICS CORPORATION SMALL-SIGNAL DIODE

2SJ160, 2SJ161, 2SJ162

Item Symbol Ratings Unit Drain to Source voltage V DSS 300 V Gate to Source voltage V GSS ±30 V Drain current I D 88 A Drain peak current.

RoHS COMPLIANT MGF4841CL is a RoHS compliant product. RoHS compliance is indicated by the letter G after the Lot Marking.

Preliminary VLA GTR HYBRID IC ISOLATED DC-DC CONVERTER DESCRIPTION OUTLINE DRAWING FEATURES APPLICATIONS BLOCK DIAGRAM 1 N.C.

2SK2568. Silicon N Channel MOS FET. Application. Features. Outline. REJ03G (Previous: ADE ) Rev.3.00 Sep 07, 2005

R1RP0416D Series. 4M High Speed SRAM (256-kword 16-bit) Description. Features. Ordering Information. REJ03C Z Rev Mar.12.

RT8H255C PIN CONFIGURATION. FEATURE The miniaturization of a set and high-density mounting are possible. APPLICATION IGBT Gate Driver 1.1±0.

RoHS COMPLIANT MGF4964BL is a RoHS compliant product. RoHS compliance is indicated by the letter G after the Lot Marking.

PS22A78-E Transfer-Mold Type Insulated Type

page.1 IGBT Gate Drive Unit Apr.07, 09

< Silicon RF Power MOS FET (Discrete) > RD100HHF1C DESCRIPTION FEATURES APPLICATION. RoHS COMPLIANT ABSOLUTE MAXIMUM RATINGS

M52769FP DESCRIPTION FEATURES RECOMMENDED OPERATING CONDITIONS APPLICATION

10-Bit A/D Converter: Example of Settings for Conversion in Single Mode

VLA QR HYBRID IC 4OUTPUT ISOLATED DC-DC CONVERTER DISCRIPTIONS OUTLINE DRAWING FEATURES APPLICATION BLOCK DIAGRAM. Regulator.

< IGBT MODULES > CM50MXA-24S HIGH POWER SWITCHING USE INSULATED TYPE APPLICATION

< IGBT MODULES > CM75MXA-24S HIGH POWER SWITCHING USE INSULATED TYPE APPLICATION

CR02AM-8. Thyristor. Low Power Use. Features. Outline. Applications. Maximum Ratings. REJ03G Rev.1.00 Aug Planar Passivation Type

CM1800HCB-34N. <High Voltage Insulated Gate Bipolar Transistor:HVIGBT >

Old Company Name in Catalogs and Other Documents

2SK2937. Silicon N Channel MOS FET High Speed Power Switching. Features. Outline. REJ03G (Previous: ADE C) Rev.5.

< HVIC > M81745JFP HIGH VOLTAGE HALF BRIDGE DRIVER (for Automotive)

IGBT Gate Drive Unit VLA598-01R

SILICON RF DEVICES. Silicon RF Devices

HIGH FREQUENCY DEVICES. Mitsubishi High Frequency Solutions for Communication Networks in the Information Era. High Frequency Devices

RKV502KJ. Variable Capacitance Diode for VHF tuner. Features. Ordering Information. Pin Arrangement. REJ03G Rev.1.

SILICON RF DEVICES. Better Performance for Radio Communication Network. Silicon RF Devices

MITSUBISHI RF MOSFET MODULE RA01L9595M

< Silicon RF Power MOS FET (Discrete) > RD06HHF1 RoHS Compliance, Silicon MOSFET Power Transistor 30MHz, 6W, 12.5V DESCRIPTION FEATURES APPLICATION

VLA574-01R V I + V CC DETECT C trip V O V I - F O C S V EE TIMER & RESET LATCH DETECT. 1kΩ INTERFACE UVL 240Ω GATE SHUT DOWN BLOCK DIAGRAM DESCRIPTION

VLA542-01R. 3,7,9,10 pin : Non connection DESCRIPTION FEATURES APPLICATIONS BLOCK DIAGRAM HYBRID IC. Hybrid IC for driving IGBT modules

HD74LS191FPEL. Synchronous Up / Down 4-bit Binary Counter (single clock line) Features. REJ03D Rev.2.00 Feb

Old Company Name in Catalogs and Other Documents

OUTLINE DRAWING 6.0+/ INDEX MARK (Gate)

HD74LS193RPEL. Synchronous Up / Down Binary Counter (dual clock lines) Features. REJ03D Rev.2.00 Feb

Old Company Name in Catalogs and Other Documents

8.0+/-0.2. (d) (4.5) INDEX MARK [Gate] SIDE VIEW

OUTLINE DRAWING SYMBOL PARAMETER CONDITIONS RATINGS UNIT

IGBT Gate Drive Unit VLA598-11R

Old Company Name in Catalogs and Other Documents

PS21A79 MAIN FUNCTION AND RATINGS 3 phase inverter with N-side open emitter structure 600V / 50A (CSTBT)

<Silicon RF Power Modules > RA55H4452M RoHS Compliance, MHz 55W 12.5V, 3 Stage Amp. For MOBILE RADIO

< Silicon RF Power Modules > RA60H3847M1 RoHS Compliance, MHz 60W 12.5V, 2 Stage Amp. For MOBILE RADIO

Old Company Name in Catalogs and Other Documents

<Silicon RF Power Modules > RA30H1721M RoHS Compliance, MHz 30W 12.5V, 2 Stage Amp. For MOBILE RADIO DESCRIPTION

M54640P. Stepper Motor Driver. Description. Features. Application. Function. Pin Configuration. REJ03F Z Rev.1.0 Sep.19.

Silicon Planar Zener Diode for Bidirectional Surge Absorption

Old Company Name in Catalogs and Other Documents

< Silicon RF Power Modules > RA33H1516M1 RoHS Compliance, MHz 33W 12.5V 2 Stage Amp. For MOBILE RADIO

Old Company Name in Catalogs and Other Documents

< Silicon RF Power MOS FET (Discrete) > RD16HHF1 DESCRIPTION FEATURES APPLICATION. RoHS COMPLIANT PINS 1:GATE 9.5MAX

FM600TU-2A HIGH POWER SWITCHING USE INSULATED PACKAGE

<Silicon RF Power Modules > RA60H1317M RoHS Compliance, MHz 60W 12.5V, 3 Stage Amp. For MOBILE RADIO

VLA591-01R DIP-GAM PRELIMINARY


<Silicon RF Power Modules > RA08H1317M RoHS Compliance, MHz 8W 12.5V, 2 Stage Amp. For PORTABLE RADIO

Regarding the change of names mentioned in the document, such as Hitachi Electric and Hitachi XX, to Renesas Technology Corp.

MITSUBISHI RF MOSFET MODULE RA35H1516M

Silicon RF Power Semiconductors RA03M4547MD

PRELIMINARY DRIVER FOR IGBT MODULES

Old Company Name in Catalogs and Other Documents

Old Company Name in Catalogs and Other Documents

VLA567-01R DESCRIPTION FEATURES APPLICATIONS BLOCK DIAGRAM HYBRID IC DRIVER FOR IGBT MODULES

Old Company Name in Catalogs and Other Documents

BCR16PM-12L. Triac. Medium Power Use. Features. Outline. Applications. Maximum Ratings. REJ03G Rev.1.00 Aug

SYMBOL PARAMETER CONDITIONS RATINGS UNIT VDSS Drain to source voltage Vgs=0V 30 V VGSS Gate to source voltage Vds=0V +/-20 V

< HVIC > M81748FP 1200V HIGH VOLTAGE HALF BRIDGE DRIVER

OUTLINEDRAWING SYMBOL PARAMETER CONDITIONS RATINGS UNIT

BCR8CM-12L. Triac. Medium Power Use. Features. Outline. Applications. Maximum Ratings. REJ03G Rev.1.00 Aug

OUTLINE DRAWING. SYMBOL PARAMETER CONDITIONS RATINGS UNIT VDSS Drain to source voltage Vgs=0V 30 V

= 25 C unless otherwise noted. A - Pulsed. (Note 1c) 0.9

< Silicon RF Power MOS FET (Discrete) > RD06HVF1 RoHS Compliance, Silicon MOSFET Power Transistor 175MHz, 6W, 12.5V DESCRIPTION FEATURES APPLICATION

OUTLINE DRAWING. SYMBOL PARAMETER CONDITIONS RATINGS UNIT VDSS Drain to source voltage Vgs=0V 25 V

SLIMDIP-L TRANSFER MOLDING TYPE INSULATED TYPE

< HVIC > M81738FP 1200V HIGH VOLTAGE HALF BRIDGE DRIVER

BCR8PM-12L. Triac. Medium Power Use. Features. Outline. Applications. Maximum Ratings. REJ03G Rev.1.00 Aug

Old Company Name in Catalogs and Other Documents

< Silicon RF Power MOS FET (Discrete) > RD10MMS2

07H4452M RA07H4452. Silicon RF Power Semiconductors 1/9. RoHS Compliance, MHz 7W 12.5V, 2 Stage Amp. For PORTABLE RADIO

< Silicon RF Power MOS FET (Discrete) > RD35HUP2 RoHS Compliance,Silicon MOSFET Power Transistor, 175MHz, 530MHz, 35W, 12.5V

OUTLINE DRAWING Pin 1. SOURCE (COMMON) 2. OPEN 3. DRAIN 4. SOURCE (COMMON) 5. SOURCE (COMMON) 6. OPEN 7. GATE 8.

< Dual-In-Line Package Intelligent Power Module > PSS25SA2FT TRANSFER MOLDING TYPE INSULATED TYPE

PSM03S93E5-A TRANSFER MOLDING TYPE INSULATED TYPE

< Silicon RF Power Modules > RA60H1317M1B RoHS Compliance, MHz 60W 12.5V, 2 Stage Amp. for Digital Mobile Radio

16M Synchronous Late Write Fast Static RAM (512-kword 36-bit, Register-Latch Mode)

IGBT Gate Drive Unit VLA553-01R/-02R

< Silicon RF Power Modules > RA60H4452M1 RoHS Compliance, MHz 60W 12.5V, 2 Stage Amp. For MOBILE RADIO

Transcription:

APPLICATION NOTE M16C/62 1.0 Abstract The following article outlines the steps necessary to set up, perform, and read multiple conversions on multiple channels using the onboard analog to digital converter (ADC) of the M16C. The ADC is useful in measuring output voltages of sensors such as accelerometers or other analog instrumentation and converting them to digital values. 2.0 Introduction The M16C line of devices features an onboard analog to digital converter (ADC). The ADC consists of one 10-bit successive approximation circuit with a capacitive coupled amplifier. There are eight analog input pins, selectable conversion clock speeds, sample and hold function, and several conversion modes. Figure 1 is an overview of the internal circuitry for the ADC block. CKS1=1 fad 1/2 1/2 CKS0=1 CKS0=0 CKS1=0 A-D conversion rate selection φad VREF AVSS VCUT=0 VCUT=1 Resistor ladder Successive conversion register A-D control register 1 (address 03D716) A-D control register 0 (address 03D616) Addresses (03C116, 03C016) (03C316, 03C216) (03C516, 03C416) (03C716, 03C616) (03C916, 03C816) (03CB16, 03CA16) (03CD16, 03CC16) (03CF16, 03CE16) A-D register 0(16) A-D register 1(16) A-D register 2(16) A-D register 3(16) A-D register 4(16) A-D register 5(16) A-D register 6(16) A-D register 7(16) Decoder Vref VIN Comparator Data bus high-order Data bus low-order AN0 CH2,CH1,CH0=000 AN1 CH2,CH1,CH0=001 AN2 CH2,CH1,CH0=010 AN3 CH2,CH1,CH0=011 OPA1,OPA0=0,0 AN4 CH2,CH1,CH0=100 AN5 CH2,CH1,CH0=101 AN6 CH2,CH1,CH0=110 AN7 CH2,CH1,CH0=111 ANEX0 ANEX1 OPA0=1 OPA1=1 OPA1,OPA0=1,1 OPA1,OPA0=0,1 OPA1, OPA0 0 0 : Normal operation 0 1 : ANEX0 1 0 : ANEX1 1 1 : External op-amp mode Figure 1 Internal Circuitry for ADC Block Overview REU05B0002-0100Z June 2003 Page 1 of 6

3.0 Repeat Sweep Mode 0 Description In repeat sweep mode 0, groups of pins of the ADC can be selected as input sources. Once triggered, a conversion takes place on the selected pins and the results are stored in the ADC result registers corresponding to the selected channels. This is repeated until the ADC conversion start flag is disabled. No interrupt is generated on the completed conversions, but rather the ADC output registers can be read anytime to determine the converted values. Figure 2 and F igure 3 re overviews of the registers that will be used in this example. These registers are detailed in the included sample code. For specific details, consult the MCU specification for the device in question. A-D control register 0 (Note 1) b7 b6 b5 b4 b3 b2 b1 b0 Symbol Address When reset ADCON0 03D616 00000XXX2 Bit symbol Bit name F unction R W CH0 CH1 CH2 MD0 MD1 TRG ADST CKS0 Analog input pin select bit A-D operation mode select bit 0 Trigger select bit A-D conversion start flag Frequency select bit 0 b2 b1 b0 0 0 0 : AN0 is selected 0 0 1 : AN1 is selected 0 1 0 : AN2 is selected 0 1 1 : AN3 is selected 1 0 0 : AN4 is selected 1 0 1 : AN5 is selected 1 1 0 : AN6 is selected 1 1 1 : AN7 is selected (Note 2) b4 b3 0 0 : One-shot mode 0 1 : Repeat mode 1 0 : Single sweep mode 1 1 : Repeat sweep mode 0 Repeat sweep mode 1 (Note 2) 0 : Software trigger 1 : ADTRG trigger 0 : A-D conversion disabled 1 : A-D conversion started 0 : fad/4 is selected 1 : fad/2 is selected Note 1: If the A-D control register is rewritten during A-D conversion, the conversion result is indeterminate. Note 2: When changing A-D operation mode, set analog input pin again. A-D control register 1 (Note) b7 b6 b5 b4 b3 b2 b1 b0 Symbol Address When reset ADCON1 03D716 0016 Bit symbol SCAN0 SCAN1 MD2 Bit name A-D sweep pin select bit BITS 8/10-bit mode select bit 0 : 8-bit mode 1 : 10-bit mode CKS1 VCUT OPA0 OPA1 A-D operation mode select bit 1 Frequency select bit 1 Vref connect bit External op-amp connection mode bit Figure 2 A-D Converter Related Registers Function When single sweep and repeat sweep mode 0 are selected b1 b0 0 0 : AN0, AN1 (2 pins) 0 1 : AN0 to AN3 (4 pins) 1 0 : AN0 to AN5 (6 pins) 1 1 : AN0 to AN7 (8 pins) When repeat sweep mode 1 is selected b1 b0 0 0 : AN0 (1 pin) 0 1 : AN0, AN1 (2 pins) 1 0 : AN0 to AN2 (3 pins) 1 1 : AN0 to AN3 (4 pins) 0 : Any mode other than repeat sweep mode 1 1 : Repeat sweep mode 1 0 : fad/2 or fad/4 is selected 1 : fad is selected 0 : Vref not connected 1 : Vref connected b7 b6 0 0 : ANEX0 and ANEX1 are not used 0 1 : ANEX0 input is A-D converted 1 0 : ANEX1 input is A-D converted 1 1 : External op-amp connection mode Note: If the A-D control register is rewritten during A-D conversion, the conversion result is indeterminate. R W REU05B0002-0100Z June 2003 Page 2 of 6

A-D control register 2 (Note) b7 b6 b5 b4 b3 b2 b1 b0 0 0 0 Symbol ADCON2 Address 03D416 When reset 0000XXX02 Bit symbol Bit name Function R W SMP A-D conversion method select bit 0 : Without sample and hold 1 : With sample and hold Reserved bit Always set to 0 Nothing is assigned. Write "0" when writing to these bits. When read, the value is "0". Note 1: If the A-D control register is rewritten during A-D conversion, the conversion result is indeterminate. A-D register i Symbol Address When reset ADi(i=0 to 7) 03C016 to 03CF16 Indeterminate (b15) (b8) b7 b0 b7 b0 Function Eight low-order bits of A-D conversion result R W During 10-bit mode Two high-order bits of A-D conversion result During 8-bit mode When read, the content is indeterminate Nothing is assigned. Write "0" when writing to these bits. When read, the value is "0". Figure 3 A-D Converter Related Register 4.0 Example Program This example program demonstrates how to perform a conversion using the ADC in the following environment: Environment Setup Repeat sweep mode 0 conversions 10-bit mode Analog inputs 0 3 used Sample and hold enabled Vref connected Conversion clock used will be f AD /2 (when f(xin) is greater than 10 MHz, f AD must be divided) Software conversion start ADC Software Setup Set the ADCON0 register for f AD /2 and repeat sweep mode 0 operation (0x98) Set the ADCON1 register for 10-bit mode, f AD divided, AN0-3 sweep, and connect Vref (0x29) Set the ADCON2 register for sample and hold (0x01) Enable the A/D converter by setting the ADST bit to 1 Read current A/D channel values in the variables TempStore(x) REU05B0002-0100Z June 2003 Page 3 of 6

5.0 Reference Renesas Technology Corporation Semiconductor Home Page http://www.renesas.com E-mail Support support_apl@renesas.com Data Sheets M16C/62 datasheets, 62aeds.pdf User s Manual M16C/62 User s Manual, 62eum.pdf M16C/60 and M16C/20 C Language Programming Manual, 6020EC.pdf NC30 Ver. 4.0 User s Manual, NC30UE.pdf 6.0 Software Code The sample software provided was written using the NC30 compiler. The program starts the conversion process on reset. / DESCRIPTION: repeat_sweep_mode_0.c AUTHOR: Renesas Technology Corporation, Inc. (June 2003) PURPOSE: Outlines how to use the M16C/62 ADC in repeat sweep mode 0. On reset, program repeatedly stores the result of the conversion in a variable that can be examined using KD30 and the MSV1632-62 Starter Kit / #include "sfr62.h" unsigned int TempStore0 = 0x0000; unsigned int TempStore1 = 0x0000; unsigned int TempStore2 = 0x0000; unsigned int TempStore3 = 0x0000; // Location where AN0 result is stored // Location where AN1 result is stored // Location where AN2 result is stored // Location where AN3 result is stored REU05B0002-0100Z June 2003 Page 4 of 6

/ main PARAMETERS: None DESCRIPTION: Main function. Where program execution starts. Sets up the ADC then reads conversion results. RETURNS: Nothing / void main (void){ fad/2 adcon0 = 0x98; / 10011000 AN0 input, repeat sweep mode 0, software trigger; analog input select bit 0 analog input select bit 1 analog input select bit 2 A/D operation mode select bit 0 A/D operation mode select bit 1 trigger select bit A/D conversion start flag frequency select bit / adcon1 = 0x29; /00011001; 10 bit mode, fad divided, Vref connected;an0-an3 converted A/D sweep pin select bit 0 A/D sweep pin select bit 1 A/D operation mode select bit 1 8/10 bit mode select bit frequency select bit 1 Vref connect bit external op-amp connection bit 0 external op-amp connection bit 1 / adcon2 = 0x01; /00000001 Sample and hold enabled sample and hold select bit reserved reserved reserved reserved reserved reserved reserved / adst = 1; // Start AD conversions REU05B0002-0100Z June 2003 Page 5 of 6

while (1){ TempStore0 = ad0 & 0x03ff; // Mask off the upper 6 bits of the TempStore1 = ad1 & 0x03ff; // Mask off the upper 6 bits of the TempStore2 = ad2 & 0x03ff; // Mask off the upper 6 bits of the } TempStore3 = ad3 & 0x03ff; // Mask off the upper 6 bits of the } REU05B0002-0100Z June 2003 Page 6 of 6

Keep safety first in your circuit designs! Renesas Technology Corporation puts the maximum effort into making semiconductor products better and more reliable, but there is always the possibility that trouble may occur with them. Trouble with semiconductors may lead to personal injury, fire or property damage. Remember to give due consideration to safety when making your circuit designs, with appropriate measures such as (i) placement of substitutive, auxiliary circuits, (ii) use of nonflammable material or (iii) prevention against any malfunction or mishap. Notes regarding these materials These materials are intended as a reference to assist our customers in the selection of the Renesas Technology Corporation product best suited to the customer's application; they do not convey any license under any intellectual property rights, or any other rights, belonging to Renesas Technology Corporation or a third party. Renesas Technology Corporation assumes no responsibility for any damage, or infringement of any third-party's rights, originating in the use of any product data, diagrams, charts, programs, algorithms, or circuit application examples contained in these materials. All information contained in these materials, including product data, diagrams, charts, programs and algorithms represents information on products at the time of publication of these materials, and are subject to change by Renesas Technology Corporation without notice due to product improvements or other reasons. It is therefore recommended that customers contact Renesas Technology Corporation or an authorized Renesas Technology Corporation product distributor for the latest product information before purchasing a product listed herein. The information described here may contain technical inaccuracies or typographical errors. Renesas Technology Corporation assumes no responsibility for any damage, liability, or other loss rising from these inaccuracies or errors. Please also pay attention to information published by Renesas Technology Corporation by various means, including the Renesas Technology Corporation Semiconductor home page (http://www.renesas.com). When using any or all of the information contained in these materials, including product data, diagrams, charts, programs, and algorithms, please be sure to evaluate all information as a total system before making a final decision on the applicability of the information and products. Renesas Technology Corporation assumes no responsibility for any damage, liability or other loss resulting from the information contained herein. Renesas Technology Corporation semiconductors are not designed or manufactured for use in a device or system that is used under circumstances in which human life is potentially at stake. Please contact Renesas Technology Corporation or an authorized Renesas Technology Corporation product distributor when considering the use of a product contained herein for any specific purposes, such as apparatus or systems for transportation, vehicular, medical, aerospace, nuclear, or undersea repeater use. The prior written approval of Renesas Technology Corporation is necessary to reprint or reproduce in whole or in part these materials. If these products or technologies are subject to the Japanese export control restrictions, they must be exported under a license from the Japanese government and cannot be imported into a country other than the approved destination. Any diversion or reexport contrary to the export control laws and regulations of Japan and/or the country of destination is prohibited. Please contact Renesas Technology Corporation for further details on these materials or the products contained therein.