Home

M16C/26 Using the A-D Converter in Repeat Sweep Mode 0

image

Contents

1. 1 18 2 Nothing is assigned In an attempt to write to these bits write 0 The value if read tums out to be 0 Note 1 If the A D control register is rewritten during conversion the conversion result Is Indeterminate A D register i Symbol Address When reset EE ADi i 0 to 7 03C016 to O3CF16 Indeterminate bb RiW Eight low order bits of A D conversion result During 10 bit mode Two high order bits of conversion result During 8 bit made When read the content is indeterminate Nothing is assigned In an attempt to write to these bits write 0 The value if read turns out to be 0 Figure 3 ADC Control Registers 4 0 Example Program The following example program demonstrates how to perform a conversion using the ADC with the following configuration Repeat sweep mode 0 conversions 10 bit mode Analog inputs 0 3 used Sample and hold enabled Internal Vref Conversion clock used will be fap 4 When f Xin is greater than 10 MHz f fap must be divided Software conversion start REUO5BO0030 0100Z June 2003 Page 4 of 7 16 26 ESAS Using the A D Converter In Repeat Sweep Mode 0 5 0 Reference Renesas Technology Corporation Semiconductor Home Page http www renesas com E mail Support support apl renesas com Data Sheets e M16C 26 datasheets M30262eds pdf User s Manual e M16C 20 60 C Language Programming Manual 6020c pdf e M16C 20 60 Software Manual 6020soft
2. Renesas Technology Corporation by various means including the Renesas Technology Corporation Semiconductor home 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 cont
3. 24 NESAS APPLICATION NOTE M16C 26 Using the A D Converter In Repeat Sweep Mode 0 1 0 Abstract The following document outlines the steps necessary to setup and perform analog to digital conversions of the M16C 26 using repeat sweep mode 0 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 Renesas M30262 is a 16 bit MCU based on the M16C 60 series CPU core The MCU features include up to 64K bytes of Flash ROM 2K bytes of RAM and 4K bytes of Virtual EEPROM The peripheral set includes 10 bit A D UARTS Timers DMA and GPIO The M16C 26 features an onboard analog to digital converter ADC The ADC consists of one 10 bit successive approximation circuit eight analog input pins selectable conversion clock speeds sample and hold function and several conversion modes Table 1 shows the performance of the ADC and Figure 1 shows a diagram of the ADC block Table 1 ADC Performance tome Method of A D Conversion Successive approximation capacitive coupling amplifier Analog input voltage OV to AVcc Vcc Operating clock fap fap fap2 fap3 fap4 fAp6 Or fApO or fap12 where fap f Xin 8 bit or 10 bit selectable Operating modes One shot mode repeat single sweep mode repeat mode repeat sweep mode 0 and repeat sweep mode 1 Analog input pins 8 pins ANo to AN A D conversion start Software trigge
4. 5 Q P106 AN6 P107 AN7 Q Figure 1 ADC Block Diagram 3 0 Repeat Sweep Mode 0 Description In repeat sweep mode 0 several pins of the ADC can be selected as input sources Once triggered a conversion takes place on the selected pins and the result is 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 are read anytime to determine the converted values Below is an overview 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 datasheet Figure 2 and Figure 3 show the control registers for ADC setup in Repeat Sweep Mode 0 REU05B0030 0100Z June 2003 Page 2 of 7 16 26 ESAS Using the A D Converter In Repeat Sweep Mode 0 A D control register 0 Note A a PLUME Symbol Address When reset bi hi bhi rdi ADCONO oec L L Bit symbol Bit Function Invalid in repeat sweep mode 0 mm DOES DO esse KL i I Software trigger 1 trigger conversion start flag A amp D conversion disabled A D conversion started ee ee ee K Refer BO t
5. able 1 1 a2 Note If the A D control register ia rewritten during 0 conversion the conversion result is indeterminate A D control register 1 Note 1 6 bd bS ba bl ki Symbol Address When reset AA 9 ADCON 03071 00 E 1 Bit symbol Funci n A D sweep pin When repeat sweep made 0 is selected select bit ANG 2 pina 1 AW to ANa d pins ANo to ANS 6 SCAN 1 ANa to AN B pinaj when this mode ig selected AIT D amp bit mode 1 10 bit mode ee LI 2 cy Refer in tabla 1 12 2 tt Fi H I1 Jh x i M1 T 1 connected Nothing is assigned In an attempt to write to these bits write 0 The value if read turns aut to be 0 Note 1 If the A O contral register is rewritten during A D conversion the conversion result is indeterminate Note 2 If the WOUT bit is reset from 0 Vref unconnected to 1 Vref connected wait for 1 pa or more before starting A D conversion Figure 2 ADC control registers in Repeat Sweep Mode 0 REU05B0030 0100Z June 2003 Page 3 of 7 16 26 ESAS Using the A D Converter In Repeat Sweep Mode 0 A D control register 2 Note 1 Symbol Address When reset ADCON2 030416 0016 0 conversion method 0 Without sample and hold select bit 1 With sample and hold Must always be set to 0 Frequency select bit 2 Reter to table
6. 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
7. r A D conversion starts when the A D conversion start flag changes to 1 condition External trigger can be retriggered A D conversion starts when the A D conversion start flag is 1 and the ADrac P15 input shared with INT3 changes from to L Conversion speed per pin Without sample and hold function 8 bit resolution 49 fap cycles 10 bit resolution 59 fap cycles With sample and hold function 8 bit resolution 28 fap cycles 10 bit resolution 33 fap cycles REUO5BO0030 0100Z June 2003 Page 1 of 7 16 26 ESAS Using the A D Converter In Repeat Sweep Mode 0 A D conversion rate selection CKS1 4 CKS2 0 cL zz 8 1 2 1 2 edi 51 0 CKS0 0 VREF VCUT 0 Q Resistor ladder AVSS O Vegrat E N Successive conversion register 9 A D control register 1 address 030716 A D control register O address 03D616 A D register 0 16 03C3416 03C216 A D register 1 16 e 03C516 03C416 A D register 2 16 Addresses 03C 116 03C016 03C916 03C816 A D register 4 16 03CBi6 03CA16 A D register 5 16 03CD16 03CC16 A D register 6 16 O3CF16 O3CE 16 A D register 7 16 X H EEL 03C716 03C616 Data bus low order A D control register 2 address 03D416 Decoder for channel selection VN Comparator P10o0 ANo O z000 101 1 P102 AN2 P103 AN3 Q P104 AN4 Q P105 AN
8. rary 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
9. served reserved H O O REU05B0030 0100Z June 2003 Page 6 of 7 24 NESAS M16C 26 Using the A D Converter In Repeat Sweep Mode 0 asm tset 1 globally enable interrupts adst 1 Start a conversion here while 1 TempStore0 ado 0x03ff Mask off the upper 6 bits of the variable leaving only the result in the variable itself TempStorel adi 0x03ff Mask off the upper 6 bits of the variable leaving only the result in the variable itself TempStore2 ad2 0x03ff Mask off the upper 6 bits of the variable leaving only the result in the variable itself TempStore3 ad3 0x03ff Mask off the upper 6 bits of the variable leaving only the result in the variable itself j REU05B0030 0100Z June 2003 Page 7 of 7 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
10. sults RETURNS Nothing e void main void 0x18 e O ANO repeat sweep mode 0 software trigger fAD 4 Analog input select bit O0 Analog input select bit 1 Analog input select bit 2 A D operation repeat mode select bit 0 A D operation repeat mode select bit 0 Trigger select bit A D conversion start flag Frequency select bit 0 n O adconl 0x29 ANO AN3 10 bit mode fAD 4 Vref connected A D sweep pin select bit A D sweep pin select bit A D operation mode select bit 1 8 10 bit mode select bit Frequency select bit 1 Vref connect bit connected reserved reserved n o n o0 n adcon2 0x01 Sample and hold enabled sample and hold select bit reserved reserved reserved Frequency select bit 2 reserved reserved reserved Hn E O adic 0x01 Enable the ADC interrupt interrupt priority select bit 0 interrupt priority select bit 1 interrupt priority select bit 2 interrupt request bit reserved reserved re
11. ware pdf e MSV30262 SKP or MSV Mini26 SKP Quick start guide e MSV30262 SKP or MSV Mini26 SKP Users Manual e MDECE30262 or MSV Mini26 SKP Schematic 6 0 Software Code The sample software provided was compiled using the KNC30 compiler The program sets up the ADC to continuously perform conversions on channels 0 to The code then repeatedly reads the results of those conversions The example program was written to run on the MSV30262 Starter Kit but could be modified for a user application Ax kk kkk kkk ck ck ke ck ck ck kkk kkk kkk kkk ck kk k k k k ok DESCRIPTION repeat sweep mode 0 PURPOSE Outlines how to use the M16C 26 ADC in repeat sweep modeO On reset program repeatedly stores the result of the conversion in a variable that can be examined using KD30 or similar tool eR ek kc ck ek A coke ck ck kc ck ck cec ck ck ck kk ox dinclude sfr26 h int TempStoreO 0x0000 Location where ADC result is stored int TempStorel 0x0000 Location where ADC result is stored int TempStore2 0x0000 Location where ADC result is stored int TempStore3 0x0000 Location where ADC result is stored REUO5BO0030 0100Z June 2003 Page 5 of 7 16 26 EJ ESAS Using the A D Converter In Repeat Sweep Mode 0 main PARAMETERS None DESCRIPTION Main function Where program execution starts Sets up the ADC then reads conversion re

Download Pdf Manuals

image

Related Search

Related Contents

Kingston Technology ValueRAM 12GB DDR3-1333  Dao-AIDCOM-Réhabilitation-bureaux-DGDA  Fisher & Paykel CG244 User's Manual  H027  hygiène et thérapeutique - Biblioteca Digital de Obras Raras e    Alpine VOLUME 1.3 Impact Driver User Manual  ニット  Right page  

Copyright © All rights reserved.
Failed to retrieve file