Generating a Quick and Controlled Waveform With the DAC

Similar documents
Using DMA for Pulse Counting on S32K

Emulating Dual SPI Using FlexIO

General C Functions for the etpu Covers the MCF523x, MPC5500, MPC5600, MPC5700, MPX40 and all etpu-equipped Devices

Working around ERR7026 according to application needs

Emulating I2C Bus Master by using FlexIO

i.mx 6Solo/6DualLite Product Lifetime Usage Estimates

DDR Validation Tool Getting Started Guide

FRDM-K64F Board Errata

HVP-MC56F82748 User s Guide

TWR-KV10Z32 Sample Code Guide for CodeWarrior Board configuration, software, and development tools

Freedom FRDM-MC-LVBLDC Development Platform User s Guide

HVP-KV10Z32 User s Guide

PMSM Field-Oriented Control Using MC56F84789 DSC With Encoders Demo Guide

MMPF0100 Errata for Mask 1N47F and 1N18J

Getting Started with Freescale MQX RTOS for Kinetis SDK and MDK-ARM Keil

Adding a run control interface into an existing CodeWarrior for MCU v10.x project

Integrate TWR-EPD Software with MQX RTOS Based on the TWR-K21F120M Platform

Processor Expert Software for i.mx Processors Version 1.0

TWR-KV10Z32 Sample Code Guide for IAR Board configuration, software, and development tools

MM912_634, Silicon Analog Mask (M91W) / Digital Mask (N53A) Errata

Table of Contents 1 Typical Applications General Description Block Diagram Pinout System Connections Typical A

How to setup pre-build steps in CodeWarrior for Microcontrollers v10.x

Getting Started with Freescale MQX RTOS for Kinetis SDK and Kinetis Design Studio IDE

S12VR Hardware Design. Guidelines. 1 Introduction. 2 Hardware Design. Guidelines. 2.1 Voltage regulator. Freescale Semiconductor

CodeWarrior Development Studio Processor Expert RTOS Adapter User Guide

Mask Set Errata for Mask 2N27B

KIT34901EFEVB Evaluation Board

Using the MPC5777M MCAN Module to Exchange CAN FD Messages

HVP-KV31F120M User s Guide

Flash Core Voltage Supply Requirements and Considerations

Using the Asynchronous DMA features of the Kinetis L Series

Single Chip Module (SCM) Package-on- Package (PoP) Assembly Guide

Quick Start Guide for FRDM-FXS-MULTI-B

TWR-LS1021A Getting Started

i.mx 6 Android JB 4.3_1.1.1 Patch Release Notes

Watt Saver Software Component (WSC)

Component Development Environment Getting Started Guide

Three-Phase Power Meter Hardware Design Reference Manual

Kinetis Bootloader to Update Multiple Devices in a Field Bus Network

Mask Set Errata for Mask 3N86B

Understanding S08P Internal Clock Source

Emulating I2S bus on KE06

Measuring Interrupt Latency

SPI topics: watchdog, serial output and parity check

Kinetis Updater User's Guide

i.mxrt1050 Product Lifetime Usage Estimates

Intelligent Sensing Framework 2.1 for Kinetis Errata Sheet

P1010RDB-PB Quick Start Guide

PCIe Certification Guide for i.mx 6Dual/6Quad and i.mx 6Solo/6DualLite

Freescale Semiconductor Data Sheet: Technical Data

i.mx 7 Dual/Solo Product Lifetime Usage

TWR-LS1021A Getting Started

i.mx 6ULL Product Usage Lifetime Estimates

MQX RTOS Release Notes for Kinetis SDK FRDM- KV10Z Freescale Freedom Development Platform

Getting Started with Freescale MQX RTOS for Kinetis SDK and ARM GCC

CodeWarrior Development Studio for StarCore 3900FP DSP v SP3 Release Notes

Building U-Boot in CodeWarrior ARMv8

Differences Between P4080 Rev. 2 and P4080 Rev. 3

MQX RTOS Release Notes for Kinetis SDK v1.2.0 for KL33Z64 for FRDM-KL43Z Freescale Freedom Development Platform

Collecting Linux Trace without using CodeWarrior

MPXHZ6130A, 15 to 130 kpa, Absolute, Integrated Pressure Sensor

MAG3110 Frequently Asked Questions

Mask Set Errata for Mask 0N22G

i.mx 6UltraLite Product Usage Lifetime Estimates

Table 1 provides silicon errata information that relates to the masks 0M55B, 1M55B, and M55B of the MC9328MX21S (i.mx21s) applications processor.

KIT33972AEWEVBE Evaluation Board

Freescale MKW40Z IEEE Software Quick Start Guide

Kinetis USB-KW41Z Wireless Protocol Sniffer Quick Start Guide

MP3V5050V, -50 to 0 kpa, Gauge Pressure Sensor

Heterojunction Bipolar Transistor Technology (InGaP HBT) High Efficiency/Linearity Amplifier

Freedom FRDM-KV31F Development Platform User s Guide

How to Implement USB Suspend/Resume Feature with MCUXpresso SDK USB Stack

Configuring DDR in U-Boot using QCVS

Kinetis SDK Release Notes for the TWR-K24F120M Tower System Module

MPXH6300A, 20 to 300 kpa, Absolute, Integrated, Pressure Sensor

Getting Started with the MCU Flashloader

Smart Plug Software Design Reference Manual

Using an FFT on the Sigma-Delta ADCs

MMA845x Driver: Quick Start Guide

Using an External GCC Toolchain with CodeWarrior for Power Architecture

Kinetis SDK Freescale Freedom FRDM-KL03Z Platform User s Guide

Kinetis KE1xF512 MCUs

Load Position-Independent Code (PIC) on a Kinetis Platform Using the IAR EWARM Compiler

ORDERING INFORMATION # of Ports Pressure Type Device Name

Getting Started with MQX RTOS for Kinetis SDK

High Volume Pressure Sensor for Disposable Applications

New VLE Instructions for Improving Interrupt Handler Efficiency Robert Moran Applications Engineer Microcontroller Solutions Group

MC56F825x/MC56F824x (2M53V) Chip Errata

Using the Xtrinsic FXLS8471CQ Transient-Acceleration Function

WPR1500-LDO MP Receiver V2.1 Reference Design User s Guide

Quick Start Guide for TWR-S08MM128-KIT TOWER SYSTEM MC9S08MM128. The industry s most complete solution for portable medical applications

MC34708, Silicon Errata

How to use FlexMemory as D-Flash and EEPROM in KE1xF

Power Consumption and Measurement of i.mx RT1020

i.mx 6 Yocto Project Patch Release Notes

Using FCCU on MPC5744P

Using IIC to Read ADC Values on MC9S08QG8

Kinetis Bootloader v1.2.0 Release Notes

OpenSDA on TWR-KW2x. User s Guide Rev 1.1

Getting Started with Pins Tool User's Guide

Transcription:

Freescale Semiconductor Document Number: AN4978 Application Note Rev 0, 08/2014 Generating a Quick and Controlled Waveform With the DAC by: Arpita Agarwal 1 Overview This application note describes how to enable a Digital to Analog Converter (DAC) to generate a quick and controlled waveform (rise time and wave shapes) from a predefined set of digital data. The rise time of a waveform generated using Automatic mode can be much quicker, but generation of all waveform shapes is not possible through Automatic mode. Automatic mode can generate square, triangle, and sawtooth output waveforms only. The DAC is used in Normal mode so that other wave-shapes can also be generated. Direct memory access (DMA) is used for transferring data to the DAC. This enables fast transfers of data, providing an efficient way to move blocks of data with minimal processor interaction. Contents 1 Overview...1 2 Digital-to-analog converter (DAC)......1 3 Direct memory access (DMA) controller... 3 4 Implementation...... 3 4.1 CPU configuration......4 4.2 DAC configuration...4 4.3 DMA configuration...5 5 Test setup and results...... 6 2 Digital-to-analog converter (DAC) The 12-bit digital-to-analog converter (DAC) provides a voltage reference to on-chip modules or an output to a package pin. It can also be used as a waveform generator to generate square, triangle, and sawtooth waveforms through automatic mode. The DAC can be put in power-down mode if needed. The maximum settling time will not exceed two 2014 Freescale Semiconductor, Inc.

12 Digital-to-analog converter (DAC) microseconds with a maximum output load (3 kω 400 pf) when the output swings from minimum output to maximum output or vice-versa. The DAC provides the ability to select either high-speed or low-speed mode and also supports two digital formats. It has a glitch filter to suppress output glitches during data conversion. The DAC supports two conversion modes, asynchronous and synchronous. In asynchronous conversion mode, data can be immediately presented to the DAC and converted to an analog output when written to the DAC buffered data register. In synchronous conversion mode, data in the DAC buffered data register is controlled by the SYNC_IN signal when the buffered data is presented to the input of the DAC. The DAC supports two operation modes: Normal and Automatic mode. In Normal mode, it generates an analog representation of digital words. In Automatic mode, it generates sawtooth, triangle, and square waveforms without CPU intervention, with programmable period, update rate, and range. A quick waveform can be generated through Automatic mode, but not all wave-shapes can be generated. Normal mode can generate all the waveforms, but direct writing of the data register will be slow because of CPU intervention. A fast rise time cannot be achieved and it is difficult to have tight control. Since the DAC also has a DMA support mode, DMA is used for this purpose. PDN STEP MAXVAL MINVAL Automatic Waveform Generation DAC Analog Output IPBus Data Buffered Data Register 16 Data Format FIFO (DMA Support) 12 12 0 1 12 1 0 Data Register 0 Filter 1 DMA_EN AUTO VDD 0 Update FILT_EN SYNC_IN 1 SYNC_EN Figure 1. DAC block diagram 2 Freescale Semiconductor, Inc.

Direct memory access (DMA) controller 3 Direct memory access (DMA) controller The DMA controller module enables fast transfers of data, providing an efficient way to move blocks of data with minimal processor interaction. The DMA module has four channels that allow 8-bit, 16-bit, or 32-bit data transfers. Each channel has a dedicated Source Address register (SARn), Destination Address register (DARn), Status register (DSRn), Byte Count register (BCRn), and Control register (DCRn). Collectively, the combined program-visible registers associated with each channel define a transfer control descriptor (TCD). All transfers are dual-address, moving data from a source memory location to a destination memory location with the module operating as a 32-bit bus master connected to the system bus. The programming model is accessed through a 32-bit connection with the slave peripheral bus. DMA data transfers may be explicitly initiated by software or by peripheral hardware requests. The terms peripheral request and DREQ refer to a DMA request from one of the on-chip peripherals or package pins. The DMA provides hardware handshake signals: either a DMA acknowledge (DACK) or a done indicator back to the peripheral. The DMA has a Continuous mode or cycle-steal transfers from software or peripheral initiation. One programmable input is selected from 16 possible peripheral requests per channel. Automatic hardware acknowledge/ done indicator from each channel is supported. There are independent source and destination address registers. Optional modulo addressing, automatic updates of source and destination addresses, and independent transfer sizes for source and destination are a few of its features. 4 Implementation Basic implementation in the DSC to achieve quick and controlled waveform is explained in this section. The example shown is based on the MC56F82748 DSC. Software requirements to demo this code are Code Warrior 10.5 or above and the Processor Expert utility. DAC and DMA peripherals are initialized through Processor Expert. These modules are interfaced as shown in Figure 2. Figure 2. DAC DMA interface block diagram Freescale Semiconductor, Inc. 3

Implementation 4.1 CPU configuration The MC56F82XX series of DSC supports two speed modes. Here, the CPU is configured in fast mode so that core and system clocks will be 100 MHz. Run MCU in fast mode Figure 3. CPU configuration 4.2 DAC configuration DMA operations are enabled in the DAC with synchronous mode to maintain a controlled rise rate. The DAC is configured in high speed mode. A watermark level is defined. Sync source (such as PITx, TAx, etc.) through XBar is enabled. 4 Freescale Semiconductor, Inc.

Implementation Figure 4. DAC configuration 4.3 DMA configuration Transfer mode Cycle-steal is set. External request and auto-disable external request features are enabled. A channel request source for DAC FIFO is assigned. Data source address (can be an array address where waveform is saved), size, other properties of source, data destination as DAC data register address, and other data destination properties are assigned. Most peripheral modules on this chip are addressed in terms of 16-bit words. However, the DMA controller expects a byte address for every module. As a result, in the SARn and DARn registers, the user must always specify a byte address (which is double the value of a 16-bit word address). The DMA Transfer Complete ISR should clear the interrupt flag by writing 1 to it. For example, DMA_DSR_BCR0 = DMA_DSR_BCR_DONE_MASK. Reinitialize the BCR value and source address (if cyclic buffer is not used) in the ISR and also enable a peripheral request. Freescale Semiconductor, Inc. 5

Test setup and results Figure 5. DMA configuration 5 Test setup and results In the setup, PIT0 provides a sync signal to the DAC every 125 ns. Predefined steps for the waveform are stored in an array where 24 steps from 0x000 to 0xFFF are given. The watermark level is 6. Thus the expected rise time equals 125 ns 24 = 3 μs. See Figure 6 for a graphic representation. 6 Freescale Semiconductor, Inc.

Test setup and results Figure 6. Waveform output Freescale Semiconductor, Inc. 7

How to Reach Us: Home Page: freescale.com Web Support: freescale.com/support Information in this document is provided solely to enable system and software implementers to use Freescale products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits based on the information in this document. Freescale reserves the right to make changes without further notice to any products herein. Freescale makes no warranty, representation, or guarantee regarding the suitability of its products for any particular purpose, nor does Freescale assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. Typical parameters that may be provided in Freescale data sheets and/or specifications can and do vary in different applications, and actual performance may vary over time. All operating parameters, including typicals, must be validated for each customer application by customer's technical experts. Freescale does not convey any license under its patent rights nor the rights of others. Freescale sells products pursuant to standard terms and conditions of sale, which can be found at the following address: freescale.com/salestermsandconditions. Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. All other product or service names are the property of their respective owners. 2014 Freescale Semiconductor, Inc. All rights reserved. Document Number AN4978 Revision 0, 08/2014