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



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

AN10866 LPC1700 secondary USB bootloader

AN Boot mode jumper settings for LPC1800 and LPC4300. Document information

How To Add A Usb Secondary Ipo Bootloader To An Lpc23Xx Flash Device To A Flash Device

AN10811 Programming SPI flash on EA3131 boards Rev May 2009 Application note Document information Info Content Keywords Abstract

AN10860_1. Contact information. NXP Semiconductors. LPC313x NAND flash data and bad block management

ES_LPC4357/53/37/33. Errata sheet LPC4357/53/37/33. Document information

AN11008 Flash based non-volatile storage

AN AES encryption and decryption software on LPC microcontrollers. Document information

Using the RS232 serial evaluation boards on a USB port

USER GUIDE EDBG. Description

AN Level shifting techniques in I 2 C-bus design. Document information

AN3332 Application note

UM Vertical Alignment (VA) displays and NXP LCD drivers

AN3252 Application note

PAC52XX Clock Control Firmware Design

HEF4021B. 1. General description. 2. Features and benefits. 3. Ordering information. 8-bit static shift register

AN LPC24XX external memory bus example. Document information

Lab Experiment 1: The LPC 2148 Education Board

MFRD52x. Mifare Contactless Smart Card Reader Reference Design. Document information

AN1991. Audio decibel level detector with meter driver

MIFARE ISO/IEC PICC

3-input EXCLUSIVE-OR gate. The 74LVC1G386 provides a 3-input EXCLUSIVE-OR function.

AN4646 Application note

Schottky barrier quadruple diode

Quad 2-input NAND Schmitt trigger

MF1 IC S General description. Functional specification. 1.1 Contactless Energy and Data Transfer. 1.2 Anticollision. Energy

HEF4011B. 1. General description. 2. Features and benefits. 3. Ordering information. 4. Functional diagram. Quad 2-input NAND gate

PMEG2020EH; PMEG2020EJ

PMEG3015EH; PMEG3015EJ

PESDxU1UT series. 1. Product profile. Ultra low capacitance ESD protection diode in SOT23 package. 1.1 General description. 1.

PMEG1020EA. 1. Product profile. 2 A ultra low V F MEGA Schottky barrier rectifier. 1.1 General description. 1.2 Features. 1.

PMEG3005EB; PMEG3005EL

14-stage ripple-carry binary counter/divider and oscillator

Flexible Active Shutter Control Interface using the MC1323x

Planar PIN diode in a SOD323 very small plastic SMD package.

AN3998 Application note

Figure 1. 8-Bit USB Debug Adapter

Silicon temperature sensors. Other special selections are available on request.

1-of-4 decoder/demultiplexer

PRTR5V0U2F; PRTR5V0U2K

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

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

Freescale Semiconductor, Inc. Product Brief Integrated Portable System Processor DragonBall ΤΜ

AN3265 Application note

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

Motor Control using NXP s LPC2900

CAN bus ESD protection diode

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

Using the CoreSight ITM for debug and testing in RTX applications

Low-power configurable multiple function gate

BAT54 series SOT23 Schottky barrier diodes Rev. 5 5 October 2012 Product data sheet 1. Product profile 1.1 General description

The sensor can be operated at any frequency between DC and 1 MHz.

Hello, and welcome to this presentation of the STM32L4 reset and clock controller.

Chapter 13. PIC Family Microcontroller

High-speed switching diodes. Type number Package Configuration Package NXP JEITA JEDEC

The 74LVC1G11 provides a single 3-input AND gate.

AN BGU8009 Matching Options for 850 MHz / 2400 MHz Jammer Immunity. Document information. Keywords

Medium power Schottky barrier single diode

How To Develop A Toolstick

AND8336. Design Examples of On Board Dual Supply Voltage Logic Translators. Prepared by: Jim Lepkowski ON Semiconductor.

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

AVR151: Setup and Use of the SPI. Introduction. Features. Atmel AVR 8-bit Microcontroller APPLICATION NOTE

IP4220CZ6. 1. Product profile. Dual USB 2.0 integrated ESD protection. 1.1 General description. 1.2 Features and benefits. 1.

etpu Host Interface by:

10 ma LED driver in SOT457

Am186ER/Am188ER AMD Continues 16-bit Innovation

NPN wideband transistor in a SOT89 plastic package.

Block 3 Size 0 KB 0 KB 16KB 32KB. Start Address N/A N/A F4000H F0000H. Start Address FA000H F8000H F8000H F8000H. Block 2 Size 8KB 16KB 16KB 16KB

Passivated, sensitive gate triacs in a SOT54 plastic package. General purpose switching and phase control

PSoC Creator Component Data Sheet. Calculation accuracy 0.01 C for -200 C to 850 C temperature range

Low forward voltage High breakdown voltage Guard-ring protected Hermetically sealed glass SMD package

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

AVR1309: Using the XMEGA SPI. 8-bit Microcontrollers. Application Note. Features. 1 Introduction SCK MOSI MISO SS

BAS16 series. 1. Product profile. High-speed switching diodes. 1.1 General description. 1.2 Features and benefits. 1.

AN111: Using 8-Bit MCUs in 5 Volt Systems

HEF4013B. 1. General description. 2. Features and benefits. 3. Applications. 4. Ordering information. Dual D-type flip-flop

Von der Hardware zur Software in FPGAs mit Embedded Prozessoren. Alexander Hahn Senior Field Application Engineer Lattice Semiconductor

An introduction to nxpusblib. March 2012

74HC175; 74HCT175. Quad D-type flip-flop with reset; positive-edge trigger

Software Real Time Clock Implementation on MC9S08LG32

IP4234CZ6. 1. Product profile. Single USB 2.0 ESD protection to IEC level General description. 1.2 Features. 1.

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

AN TDA8026ET - 5 slots smart card interface. Document information

PN7120 Windows IoT Porting Guidelines. Rev October

Technical Note. Micron NAND Flash Controller via Xilinx Spartan -3 FPGA. Overview. TN-29-06: NAND Flash Controller on Spartan-3 Overview

BAS70 series; 1PS7xSB70 series

HG2 Series Product Brief

8-Bit Flash Microcontroller for Smart Cards. AT89SCXXXXA Summary. Features. Description. Complete datasheet available under NDA

AVR134: Real Time Clock (RTC) using the Asynchronous Timer. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

DISCRETE SEMICONDUCTORS DATA SHEET M3D848. CGD MHz, 20 db gain power doubler amplifier. Product specification 2002 Oct 08

Thermistor Calculator. Features. General Description. Input/Output Connections. When to use a Thermistor Calculator 1.10

8-bit Microcontroller. Application Note. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer. Features. Theory of Operation.

SiGe:C Low Noise High Linearity Amplifier

SCR, 12 A, 15mA, 500 V, SOT78. Planar passivated SCR (Silicon Controlled Rectifier) in a SOT78 plastic package.

Production Flash Programming Best Practices for Kinetis K- and L-series MCUs

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

TWR-KV31F120M Sample Code Guide for IAR Board configuration, software, and development tools Rev.0

Programming Flash Microcontrollers through the Controller Area Network (CAN) Interface

Atmel Norway XMEGA Introduction

Transcription:

LPC1700 timer triggered memory to GPIO data transfer Rev. 01 16 July 2009 Application note Document information Info Keywords Abstract Content LPC1700, GPIO, DMA, Timer0, Sleep Mode This application note briefly covers the functionality of the LPC1700 DMA controller whilst performing a SRAM to GPIO DMA data transfer in Normal and Sleep mode.

Revision history Rev Date Description 01 20090716 Initial version. Contact information For additional information, please visit: http://www.nxp.com For sales office addresses, please send an email to: salesaddresses@nxp.com _1 Application note Rev. 01 16 July 2009 2 of 10

1. Introduction This application note serves as a quick introduction to the LPC1700 s timer-triggered DMA to GPIO functionality. Without using a DMA (Direct Memory Access) controller, a data transfer between two address locations is a multi-step process. Each step in this data transfer process requires the CPU. Fortunately, one way to reduce the CPU s overhead in transferring data is by using a DMA controller. The DMA controller performs the tedious and repetitive tasks of transferring data from one location to another. Generally speaking, a DMA controller is hardware driven state machine with a sole purpose to transfer data between memory and peripherals. 1.1 DMA The LPC1700 features a DMA controller that has the ability to transfer data from memory-to-memory, memory-to-peripheral, peripheral-to-peripheral, and peripheral-tomemory. Using all eight of its channels, the DMA can transfer eight simultaneous 32-bit wide words at a given time. Some of the peripherals that are supported by the DMA include the SSP, I 2 S, UART, A/D Converter, and the D/A Converter. For the DMA controller, the GPIO registers are considered as memory sources/destinations. For example, to have the DMA copy data from the internal SRAM to the GPIOs, it needs to be configured for a memory-to-memory transfer. The LPC1700 s DMA controller has scatter (or gather) support. This new feature allows the DMA to transfer a non-contiguous block of memory with the guidance of a linked list data structure. 1.2 GPIOs The GPIO registers allow the user to utilize physical pins on the LPC1700 for regular I/O purposes. On the LPC1700, these registers are located on an AHB peripheral bus for fast I/O timing. They are byte, half-word, and word addressable. More importantly, the LPC1700 GPIO registers are accessible by the DMA controller. A detailed description of the GPIO registers and their features can be found in the LPC1700 user manual. 1.3 Timers The LPC1700 has four general purpose timers (Timer 0 to Timer 3). Each timer contains four match registers (MR0 to MR3) that can generate interrupts and/or other actions, such as stopping or resetting the timer s counter register. Out of the four match registers that each timer has, only the first two match registers (MR0 and MR1) are capable of triggering a direct DMA request without using interrupts. A detailed description of the timers and their features can be found in the LPC1700 user manual. For demonstration purposes, we are just interested in a free-running timer and a configured match register. More specifically, we are interested of having one of timer 0 s match register trigger a DMA request directly to the DMA. _1 Application note Rev. 01 16 July 2009 3 of 10

1.4 Power modes The LPC1700 features several power modes so that the device s current consumption can be reduced. The power modes are: Normal Mode Sleep Mode 2. Application demo Deep Sleep Mode Power-down Mode Deep Power-down Mode The mode that we are particularly interested in is Sleep mode. To conserve power, the LPC1700 s Sleep mode halts the clock to the CPU s core and powers down the on-chip flash. More importantly however, while the LPC1700 is in Sleep mode the peripheral clocks and the SRAM memory module remain powered. In other words, this means that during Sleep mode the LPC1700 stops executing instructions to conserve power, but its DMA, SRAM, GPIOs and Timers still remain active! More details on the LPC1700 s power modes can be found in the LPC1700 user manual. 2.1 Requirements 2.1.1 Hardware Keil MCB1700 Development Board (See Fig 1). Keil ULINK JTAG module Note: Instead of using the ULINK JTAG module to program the LPC1700, you can use an RS-232 serial cable along with the FlashMagic programming tool that is available at no charge at http://www.nxp.com/redirect/flashmagictool.com/. 2.1.2 Software Keil uvision3 Development IDE v3.7 or later (evaluation version will work for the demo). The project demo is CMSIS (Cortex Microcontroller Software Interface Standard) compliant. 2.2 Project design In this project demo, we will use the DMA to transfer data that is located in SRAM to the LEDs (GPIOs) on the MCB1700 development board. This is done by simply configuring the DMA to make a memory-to-memory transfer every time when the match register for Timer 0 matches its counter register. This DMA transfer can be demonstrated while the CPU is in Normal or in Sleep mode. The following sections elaborate on how the project demo is designed and structured. _1 Application note Rev. 01 16 July 2009 4 of 10

2.2.1 Initialization and memory preparation The LPC1700 s CPU is configured to run at 48 MHz, whereas Timer 0 runs at 24 MHz. The GPIOs that are connected to the MCB1700 LEDs are configured as outputs. Fig 1 shows which LEDs and buttons are used throughout this project. (1) LED and button configuration Fig 1. Keil MCB1700 A block of unused memory is cleared and configured with known data. In this case we will configure the SRAM to contain incrementing values. These values are then displayed on the LEDs which are controlled by the DMA. _1 Application note Rev. 01 16 July 2009 5 of 10

Fig 2. Memory configuration 2.2.2 Configuring the DMA request source At this pointer, the Timer 0 match compare register is connected to the DMA so that it can trigger a DMA request. Fig 3. Selecting Timer 0 s match register to generate a DMA request Once the DMA receives the DMA request from Timer 0, it will then transfer data from the SRAM to the GPIO register that is connected to the MCB1700 s LEDs. 2.2.3 DMA configuration With each DMA request, the DMA will automatically transfer the contents of the next memory location until it has reached the last address specified in its DMA configuration. (1) The DMA is configured to transfer data from SRAM to the LEDs Fig 4. DMA configuration _1 Application note Rev. 01 16 July 2009 6 of 10

2.2.4 Configure Timer 0 and enable To make this project viewable, Timer 0 is configured so that it generates a DMA request only two times a second. When the Timer 0 counter register matches its match register, it resets the counter and toggles the match output signal. Fig 5. Timer 0 configuration and enable 2.2.5 CPU LED toggle While the DMA is enabled, the CPU can be in either one of two states. In Normal mode it can loop in while(1) toggling the LED at P1.28, or it can enter Sleep mode. In Sleep mode P1.28 will stop toggling, whereas the DMA will continue until it has finished the end of the entire data transfer. To enter Sleep mode, press the INT0 button. (1) Pressing INT0 will cause the CPU to go into Sleep mode. Fig 6. CPU toggling LED _1 Application note Rev. 01 16 July 2009 7 of 10

3. Known issues 2.3 Key observations Note that the toggling rate of CPU controlled LED and the DMA controlled LEDs are intentionally configured differently. A noticeable timing difference between the two sets of LEDs indicates that the DMA is running independent from the CPU. The overall objective of this project is to show that the: 1. DMA operates independently of the CPU, by showing different LED toggling rates. 2. DMA can transfer data to GPIO registers, by using LEDs. 3. Timers can generate DMA requests. 4. DMA continues to operate in Sleep mode. Keil s uvision <LPC17xx.h> header file may not specify the DMAREQSEL register. To fix this, open the LPC17xx.h header file that come with the uvision tool and ensure that DMAREQSEL is put in the place indicated. (1) DMAREQSEL may not be defined already Fig 7. LPC17xx.h header file placeholder _1 Application note Rev. 01 16 July 2009 8 of 10

4. Legal information 4.1 Definitions Draft The document is a draft version only. The content is still under internal review and subject to formal approval, which may result in modifications or additions. NXP Semiconductors does not give any representations or warranties as to the accuracy or completeness of information included herein and shall have no liability for the consequences of use of such information. 4.2 Disclaimers General Information in this document is believed to be accurate and reliable. However, NXP Semiconductors does not give any representations or warranties, expressed or implied, as to the accuracy or completeness of such information and shall have no liability for the consequences of use of such information. Right to make changes NXP Semiconductors reserves the right to make changes to information published in this document, including without limitation specifications and product descriptions, at any time and without notice. This document supersedes and replaces all information supplied prior to the publication hereof. Suitability for use NXP Semiconductors products are not designed, authorized or warranted to be suitable for use in medical, military, aircraft, space or life support equipment, nor in applications where failure or malfunction of a NXP Semiconductors product can reasonably be expected to result in personal injury, death or severe property or environmental damage. NXP Semiconductors accepts no liability for inclusion and/or use of NXP Semiconductors products in such equipment or applications and therefore such inclusion and/or use is for the customer s own risk. Applications Applications that are described herein for any of these products are for illustrative purposes only. NXP Semiconductors makes no representation or warranty that such applications will be suitable for the specified use without further testing or modification. Export control This document as well as the item(s) described herein may be subject to export control regulations. Export might require a prior authorization from national authorities. 4.3 Trademarks Notice: All referenced brands, product names, service names and trademarks are property of their respective owners. _1 Application note Rev. 01 16 July 2009 9 of 10

5. Contents 1. Introduction...3 1.1 DMA...3 1.2 GPIOs...3 1.3 Timers...3 1.4 Power modes...4 2. Application demo...4 2.1 Requirements...4 2.1.1 Hardware...4 2.1.2 Software...4 2.2 Project design...4 2.2.1 Initialization and memory preparation...5 2.2.2 Configuring the DMA request source...6 2.2.3 DMA configuration...6 2.2.4 Configure Timer 0 and enable...7 2.2.5 CPU LED toggle...7 2.3 Key observations...8 3. Known issues...8 4. Legal information...9 4.1 Definitions...9 4.2 Disclaimers...9 4.3 Trademarks...9 5. Contents...10 Please be aware that important notices concerning this document and the product(s) described herein, have been included in the section 'Legal information'. For more information, please visit: http://www.nxp.com For sales office addresses, email to: salesaddresses@nxp.com Date of release: 16 July 2009 Document identifier: _1