Current Digital to Analog Converter



Similar documents
Making Prototyping Boards for the EFM32 kits

AN111: Using 8-Bit MCUs in 5 Volt Systems

TS1005 Demo Board COMPONENT LIST. Ordering Information. SC70 Packaging Demo Board SOT23 Packaging Demo Board TS1005DB TS1005DB-SOT

Figure 1. 8-Bit USB Debug Adapter

Backup Power Domain. AN Application Note. Introduction

Analog to Digital Converter

Bootloader with AES Encryption

Figure 1. Proper Method of Holding the ToolStick. Figure 2. Improper Method of Holding the ToolStick

AN486: High-Side Bootstrap Design Using ISODrivers in Power Delivery Systems

Connect the EFM32 with a Smart Phone through the Audio Jack

AN962: Implementing Master-Slave Timing Redundancy in Wireless and Packet- Based Network Applications

AN803. LOCK AND SETTLING TIME CONSIDERATIONS FOR Si5324/27/ 69/74 ANY-FREQUENCY JITTER ATTENUATING CLOCK ICS. 1. Introduction

AN862. OPTIMIZING Si534X JITTER PERFORMANCE IN NEXT GENERATION INTERNET INFRASTRUCTURE SYSTEMS. 1. Introduction

AN580 INFRARED GESTURE SENSING. 1. Introduction. 2. Hardware Considerations

UG103.8: Application Development Fundamentals: Tools

AN952: PCIe Jitter Estimation Using an Oscilloscope

UG129: ZigBee USB Virtual Gateway Reference Design (RD ) User's Guide

UG103-13: Application Development Fundamentals: RAIL

How To Use A Watt Saver On A Microcontroller (Watt Saver) On A Cell Phone Or Mp3 Player

AN588 ENERGY HARVESTING REFERENCE DESIGN USER S GUIDE. 1. Kit Contents. 2. Introduction. Figure 1. Energy Harvesting Sensor Node

AN922: Using the Command Line Interface (CLI) for Frequency On-the-Fly with the Si5346/47

AN583: Safety Considerations and Layout Recommendations for Digital Isolators

PC Base Adapter Daughter Card UART GPIO. Figure 1. ToolStick Development Platform Block Diagram

APPLICATION. si32library. Callback CMSIS HARDWARE. Figure 1. Firmware Layer Block Diagram

How To Develop A Toolstick

RoHs compliant, Pb-free Industrial temperature range: 40 to +85 C Footprint-compatible with ICS , 2.5, or 3.3 V operation 16-TSSOP

AES Cipher Modes with EFM32

AN LPC1700 timer triggered memory to GPIO data transfer. Document information. LPC1700, GPIO, DMA, Timer0, Sleep Mode

CS4525 Power Calculator

CP2110-EK CP2110 EVALUATION KIT USER S GUIDE. 1. Kit Contents. 2. Relevant Documentation. 3. Software Setup

AVR127: Understanding ADC Parameters. Introduction. Features. Atmel 8-bit and 32-bit Microcontrollers APPLICATION NOTE

APPLICATION NOTE Atmel AT02509: In House Unit with Bluetooth Low Energy Module Hardware User Guide 8-bit Atmel Microcontroller Features Description

ZigBee-2.4-DK 2.4 GHZ ZIGBEE DEVELOPMENT KIT USER S GUIDE. 1. Kit Contents. Figure GHz ZigBee Development Kit

INTEGRATED CIRCUITS. NE558 Quad timer. Product data Supersedes data of 2001 Aug Feb 14

AN614 A SIMPLE ALTERNATIVE TO ANALOG ISOLATION AMPLIFIERS. 1. Introduction. Input. Output. Input. Output Amp. Amp. Modulator or Driver

SMARTCARD XPRO. Preface. SMART ARM-based Microcontrollers USER GUIDE

Measuring Resistance Using Digital I/O

Software Real Time Clock Implementation on MC9S08LG32

ETRX3USB ETRX3USB-LRS ETRX3USB+8M ETRX3USB-LRS+8M PRODUCT MANUAL

7 OUT1 8 OUT2 9 OUT3 10 OUT4 11 OUT5 12 OUT6 13 OUT7 14 OUT8 15 OUT9 16 OUT10 17 OUT11 18 OUT12 19 OUT13 20 OUT14 21 OUT15 22 OUT16 OUT17 23 OUT18

CryptoAuth Xplained Pro

Product Datasheet P MHz RF Powerharvester Receiver

PAC52XX Clock Control Firmware Design

USER GUIDE EDBG. Description

AN437. Si4432 RF PERFORMANCE AND FCC COMPLIANCE TEST RESULTS. 1. Introduction. 2. Relevant Measurements to comply with FCC

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

76-77 GHz RF Transmitter Front-end for W-band Radar Applications

AN3252 Application note

AVR126: ADC of megaavr in Single Ended Mode. Introduction. Features. AVR 8-bit Microcontrollers APPLICATION NOTE

UG103.8 APPLICATION DEVELOPMENT FUNDAMENTALS: TOOLS

AVR131: Using the AVR s High-speed PWM. Introduction. Features. AVR 8-bit Microcontrollers APPLICATION NOTE

AN2680 Application note

1. Learn about the 555 timer integrated circuit and applications 2. Apply the 555 timer to build an infrared (IR) transmitter and receiver

Flexible Active Shutter Control Interface using the MC1323x

APPLICATION NOTE. AT07175: SAM-BA Bootloader for SAM D21. Atmel SAM D21. Introduction. Features

AT15007: Differences between ATmega328/P and ATmega328PB. Introduction. Features. Atmel AVR 8-bit Microcontrollers APPLICATION NOTE

AN75. Si322X DUAL PROSLIC DEMO PBX AND GR 909 LOOP TESTING SOFTWARE GUIDE. 1. Introduction

Lab Experiment 1: The LPC 2148 Education Board

8-bit Microcontroller. Application Note. AVR400: Low Cost A/D Converter

USB FM Radio-RD USB FM RADIO USER S GUIDE. 1. USB FM Radio Setup. One-time set-up enables configuration of presets and region specific FM band

Capacitive Sensing Solutions from Silicon Labs. In this section, we are going to cover the Silicon Labs Capacitive Sensing solutions.

Designing an Induction Cooker Using the S08PT Family

AN3110 Application note

AN655 R ANGE TEST APPLICATION FOR EZRADIO AND EZRADIOPRO. 1. Introduction. 2. Supported Radio Types

Selecting the Right MCU Can Squeeze Nanoamps out of Your Next Internet of Things Application

Embedded Systems on ARM Cortex-M3 (4weeks/45hrs)

ic-mq EVAL MQ1D EVALUATION BOARD DESCRIPTION

AVR125: ADC of tinyavr in Single Ended Mode. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Application Report. 1 Introduction. 2 Resolution of an A-D Converter. 2.1 Signal-to-Noise Ratio (SNR) Harman Grewal... ABSTRACT

ETEC Digital Controls PIC Lab 10 Pulse Width Modulation

SSM3K335R SSM3K335R. 1. Applications. 2. Features. 3. Packaging and Pin Configuration Rev.3.0. Silicon N-Channel MOS (U-MOS -H)

Evaluation Board for the AAT1275 Boost Converter with USB Power Switch

AVR1301: Using the XMEGA DAC. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

AN4646 Application note

High-Speed, Low r ON, SPST Analog Switch (1-Bit Bus Switch)

AN LPC1700 RTC hardware auto calibration. Document information. RTC, Hardware Auto Calibration, LPC1700, Graphic LCD

LM555/NE555/SA555. Single Timer. Description. Features. Applications. Internal Block Diagram. Vcc GND. Trigger. Discharge. Output F/F.

DG2302. High-Speed, Low r ON, SPST Analog Switch. Vishay Siliconix. (1-Bit Bus Switch with Level-Shifter) RoHS* COMPLIANT DESCRIPTION FEATURES

TPN4R712MD TPN4R712MD. 1. Applications. 2. Features. 3. Packaging and Internal Circuit Rev.4.0. Silicon P-Channel MOS (U-MOS )

Table 1. RF Pico Boards of the EZRadioPRO Development Kits. Qty Description Part Number

TOSHIBA Bipolar Linear Integrated Circuit Silicon Monolithic TAR5SB15~TAR5SB50

Freescale Semiconductor, I

AN220 USB DRIVER CUSTOMIZATION

css Custom Silicon Solutions, Inc.

Theory of Operation. Figure 1 illustrates a fan motor circuit used in an automobile application. The TPIC kω AREF.

AUTOMATIC NIGHT LAMP WITH MORNING ALARM USING MICROPROCESSOR

Timer A (0 and 1) and PWM EE3376

PACKAGE OUTLINE DALLAS DS2434 DS2434 GND. PR 35 PACKAGE See Mech. Drawings Section

APPLICATION NOTE. AT16268: JD Smart Cloud Based Smart Plug Getting. Started Guide ATSAMW25. Introduction. Features

APPLICATION NOTE. AT12405: Low Power Sensor Design with PTC. Atmel MCU Integrated Touch. Introduction

ZL40221 Precision 2:6 LVDS Fanout Buffer with Glitchfree Input Reference Switching and On-Chip Input Termination Data Sheet

In the idle state, the TIP lead will be high impedance to ground and the RING lead will have the battery voltage. See Figure 1.

M68EVB908QL4 Development Board for Motorola MC68HC908QL4

TSL250, TSL251, TLS252 LIGHT-TO-VOLTAGE OPTICAL SENSORS

TS555. Low-power single CMOS timer. Description. Features. The TS555 is a single CMOS timer with very low consumption:

Signal Processing in So.ware and Electric Field Sensing

Single Phase Two-Channel Interleaved PFC Operating in CrM

DG2731/2732/2733. Low Voltage, 0.4 Ω, Dual SPDT Analog Switch. Vishay Siliconix. RoHS COMPLIANT FEATURES

Implementing SPI Master and Slave Functionality Using the Z8 Encore! F083A

APPLICATION NOTE. Atmel AVR134: Real Time Clock (RTC) Using the Asynchronous Timer. Atmel AVR 8-bit Microcontroller. Introduction.

Transcription:

Current Digital to Analog Converter AN0064 - Application Note Introduction This application note describes how to use the EFM32 Current Digital to Analog Converter (IDAC), a peripheral that can source or sink a configurable constant current. The general operation of the peripheral is explained and software examples include using PRS to control the IDAC, a calibration routine for a given current output and a demonstration on how to use the module to measure absolute capacitance. This application note includes: This PDF document Source files (zip) Example C-code for the Zero Gecko STK Multiple IDE projects

1 Current Digital to Analog Converter 1.1 Introduction...the world's most energy friendly microcontrollers The EFM32 IDAC can source or sink a configurable constant current from 50 na to 64 µa. This can be either through the IDAC pin or an ADC channel pin. 1.2 Overview An overview of the IDAC module is shown in Figure 1.1 (p. 2). The IDAC is designed to source or sink a programmable current. Controlling the IDAC output can be done through software or using PRS. The output from the IDAC can be sinked or sourced through the IDAC pin or the ADC. When using the ADC the current is sinked or sourced using the pin to the ADC channel that is currently in use. Figure 1.1. IDAC Overview Output control IDAC Internal output VDD IDAC OUT ADC OUT ADC ADCn_CH0 ADCn_CH1 ADCn_CH2 ADCn_CH3 ADCn_CH4 ADCn_CH5 ADCn_CH6 ADCn_CH7 ADC Channels 2013-10-08 - an0064_rev1.00 2 www.silabs.com

2 General Operation...the world's most energy friendly microcontrollers A register overview of the IDAC module is shown in Figure 2.1 (p. 3). Figure 2.1. IDAC Register Overview IDAC_CTRL_PRSSEL IDAC_CTRL_OUTENPRS IDAC_CTRL_MINOUTTRANS IDAC_CTRL_OUTEN Output control IDAC_CTRL_OUTMODE IDAC_CURRPROG_RANGESEL IDAC_CURRPROG_STEPSEL IDAC_CAL_TUNING IDAC Internal output VDD ADC OUT IDAC OUT IDAC_CTRL_EN IDAC_CTRL_CURSINK 2.1 Current Selection The 4 different current ranges can be selected by configuring the RANGESEL bitfield in IDAC_CURRPROG. Each range covers a different current interval and is linearly divided in 32 steps, which is configured by the STEPSEL bitfield in IDAC_CURRPROG. These current ranges with their step sizes are shown in Table 2.1 (p. 3). Table 2.1. Range Selection Range Select Range Value [µa] Step Size [na] Step Counts 0 0.05-1.6 50 32 1 1.6-4.7 100 32 2 0.5-16 500 32 3 2-64 2000 32 2.2 Turning the IDAC on/off The IDAC output can be controlled either by software or PRS. After enabling the IDAC module the current output can be turned on by setting the OUTEN in IDAC_CTRL. The IDAC output pin must be disabled in the appropriate GPIO_MODE register for the IDAC to work. 2.3 Output through IDAC pin When the OUTMODE in the IDAC CTRL register is set to PIN the current output will go through the IDAC PIN when the current is turned on. First the IDAC must be enabled through the EN bit in the CTRL register, then the current can be turned on and off with the OUTEN bit in the same register. 2.4 Output through ADC channel pin The output can also be set to go through one of the ADC channel pins, this is done by setting the OUTMODE to ADC. When the ADC starts a scan the IDAC output will go out on the selected channel. 2013-10-08 - an0064_rev1.00 3 www.silabs.com

The IDAC output will stop after the scan is done, unless the CHCONIDLE bit in ADCn_CTRL is set. Then the output will be on until a new ADC channel is scanned or the IDAC is turned off. 2.5 PRS The IDAC can be turned on and off by the PRS. An example use case is setting up the timer to generate a PWM signal that turns the IDAC on and off using PRS as seen in the included software example PRS Triggered Charge Injection. To let the PRS take control of the IDAC set OUTENPRS in IDAC_CTRL and select the PRS channel to control it using the PRSSEL bit field. 2.6 Calibration To get the highest performance out of the IDAC it should be calibrated for offset error. This is where the entire range is offset by a constant amount. The IDAC can be calibrated using the IDAC_CAL_TUNING register. By adjusting the register value the offset error can be calibrated away. In production, the middle step of every range is calibrated at room temperature and the calibration values are stored in the IDAC_CALx registers in the Device Information Page. When the range is set using the emlib IDAC_RangeSet function the calibration value is automatically loaded from flash into the IDAC Calibration register. 2.7 Minimizing Output Transition The internal output of the IDAC may be at a different voltage than the output pin. By setting the MINOUTTRANS bit in IDAC_CTRL the internal output is lowered to GND or risen to VDD depending on if the IDAC is in current source or sink mode, thereby minimizing unwanted peaks in the current when switching the output on. When the IDAC output is enabled the charge/discharging will stop until OUTEN is cleared. Only the internal net of the IDAC is affected by this setting. If there is external components connected to the IDAC pin, for example a capacitor that needs to be discharged, the pin should be lowered to GND by setting it as a GPIO output for enough time to let the capacitor discharge, then it can be configured back to be used by the IDAC. 2013-10-08 - an0064_rev1.00 4 www.silabs.com

3 Software Examples...the world's most energy friendly microcontrollers 3.1 IDAC Demo This demo allows the user to cycle through all the IDACs current range and step selections, sending the current out on IDAC_OUT(PB11). Incrementing the range and step register is done by push button 1 and 2 respectively, while the selection is presented on the kit's LCD along with the current output. The software assumes that the IDAC is correctly calibrated and displayes only the expected current output. 3.2 Calibration Routine In production the IDAC is calibrated at room temperature. If the temperature where the MCU is used in varies from this, the calibration value might be off. This software example uses the ADC to measure the current sent through an external resistor connected to ADC channel pin, see Figure 3.1 (p. 6). The appropriate resistor value is dependent on the range the user wants to calibrate for since the difference between the lowest and highest current output is three orders of magnitude. The resistor value must be chosen so that the resulting voltage over it can be measured by the ADC with the limiting factor that the maximum current output for that range does not make the voltage over the resistor exceed the supply voltage. See Table 3.1 (p. 5) for suggested resistor values. To get the most accurate results the ADC should be calibrated before running the IDAC calibration routine. Table 3.1. Resistor Selection Current Interval Resistor Value 50 na - 1.6 µa 500k Ohm 1 µa - 64 µa 18k Ohm For a given current range and step the value of the resistor and the voltage over it is known. This lets the software, using Ohm's law(equation 3.1 (p. 5) ), find the current going through the resistor, tuning the value in the IDAC Calibration register until the difference between the current and the target value is minimized. The function calibrateidac(range, step, resistor, adcch) takes the range and step values that is to be calibrated for, the value of the resistor and which ADC channel to use. This lets the user connect different value resistors to different ADC channel pins allowing for calibration of all four current ranges. Ohm's law I = U cal / R cal (3.1) 2013-10-08 - an0064_rev1.00 5 www.silabs.com

Figure 3.1. Calibration Circuit I EFM32 ADC_CH4 (PD4) Vcal Rcal 3.3 PRS Triggered Charge Injection This example demonstrates how to use a timer to control the IDAC through the PRS. The IDAC is configured to enable its output based on the signal it receives from PRS channel 0. The timer generates a square waveform signal that is sends to the PRS. See Figure 3.2 (p. 6). Figure 3.2. IDAC Charge Injection Example I IDAC_OUT (PB11) T ON OFF time U T PRS input time 3.4 Capacitance Measurement This example uses the IDAC, ACMP and TIMER module to measure the capacitance of a capacitor. See Figure 3.1 (p. 6) for the circuit diagram. The IDAC is used to charge the capacitor until the analog comparator detects that the voltage has reached a predetermined value, then the ACMP interrupt stops the timer. Since the current, voltage and time is known the capacitance can be calculated using Equation 3.2 (p. 6). When the IDAC pin is not charging the capacitor, the pin is pulled to ground to discharge the capacitor. This software example works best with capacitors above 1 µf. Capacitance formula when current is constant C = I T/ V C (3.2) 2013-10-08 - an0064_rev1.00 6 www.silabs.com

Figure 3.3. Capacitance Measuring Circuit I EFM32 IDAC_OUT (PB11) Vc ACOMP0_CH1 (PC1) 2013-10-08 - an0064_rev1.00 7 www.silabs.com

4 Revision History...the world's most energy friendly microcontrollers 4.1 Revision 1.00 2013-10-08 Initial revision. 2013-10-08 - an0064_rev1.00 8 www.silabs.com

A Disclaimer and Trademarks A.1 Disclaimer...the world's most energy friendly microcontrollers Silicon Laboratories intends to provide customers with the latest, accurate, and in-depth documentation of all peripherals and modules available for system and software implementers using or intending to use the Silicon Laboratories products. Characterization data, available modules and peripherals, memory sizes and memory addresses refer to each specific device, and "Typical" parameters provided can and do vary in different applications. Application examples described herein are for illustrative purposes only. Silicon Laboratories reserves the right to make changes without further notice and limitation to product information, specifications, and descriptions herein, and does not give warranties as to the accuracy or completeness of the included information. Silicon Laboratories shall have no liability for the consequences of use of the information supplied herein. This document does not imply or express copyright licenses granted hereunder to design or fabricate any integrated circuits. The products must not be used within any Life Support System without the specific written consent of Silicon Laboratories. A "Life Support System" is any product or system intended to support or sustain life and/or health, which, if it fails, can be reasonably expected to result in significant personal injury or death. Silicon Laboratories products are generally not intended for military applications. Silicon Laboratories products shall under no circumstances be used in weapons of mass destruction including (but not limited to) nuclear, biological or chemical weapons, or missiles capable of delivering such weapons. A.2 Trademark Information Silicon Laboratories Inc., Silicon Laboratories, the Silicon Labs logo, Energy Micro, EFM, EFM32, EFR, logo and combinations thereof, and others are the registered trademarks or trademarks of Silicon Laboratories Inc. ARM, CORTEX, Cortex-M3 and THUMB are trademarks or registered trademarks of ARM Holdings. Keil is a registered trademark of ARM Limited. All other products or brand names mentioned herein are trademarks of their respective holders. 2013-10-08 - an0064_rev1.00 9 www.silabs.com

B Contact Information...the world's most energy friendly microcontrollers Silicon Laboratories Inc. 400 West Cesar Chavez Austin, TX 78701 Please visit the Silicon Labs Technical Support web page: http://www.silabs.com/support/pages/contacttechnicalsupport.aspx and register to submit a technical support request. 2013-10-08 - an0064_rev1.00 10 www.silabs.com

Table of Contents 1. Current Digital to Analog Converter... 2 1.1. Introduction... 2 1.2. Overview... 2 2. General Operation... 3 2.1. Current Selection... 3 2.2. Turning the IDAC on/off... 3 2.3. Output through IDAC pin... 3 2.4. Output through ADC channel pin... 3 2.5. PRS... 4 2.6. Calibration... 4 2.7. Minimizing Output Transition... 4 3. Software Examples... 5 3.1. IDAC Demo... 5 3.2. Calibration Routine... 5 3.3. PRS Triggered Charge Injection... 6 3.4. Capacitance Measurement... 6 4. Revision History... 8 4.1. Revision 1.00... 8 A. Disclaimer and Trademarks... 9 A.1. Disclaimer... 9 A.2. Trademark Information... 9 B. Contact Information... 10 B.1.... 10 2013-10-08 - an0064_rev1.00 11 www.silabs.com

List of Figures 1.1. IDAC Overview... 2 2.1. IDAC Register Overview... 3 3.1. Calibration Circuit... 6 3.2. IDAC Charge Injection Example... 6 3.3. Capacitance Measuring Circuit... 7 2013-10-08 - an0064_rev1.00 12 www.silabs.com

List of Tables 2.1. Range Selection... 3 3.1. Resistor Selection... 5 2013-10-08 - an0064_rev1.00 13 www.silabs.com

List of Equations 3.1. Ohm's law... 5 3.2. Capacitance formula when current is constant... 6 2013-10-08 - an0064_rev1.00 14 www.silabs.com