AN10955 Full-duplex software UART for LPC111x and LPC13xx

Similar documents
OM13071 LPCXpresso824-MAX Development board

AN10917 Memory to DAC data transfers using the LPC1700's DMA

AN LPC82x Touch Solution Quick Start Guide. Document information. Keywords

UM User Manual for LPC54018 IoT Module. Rev November Document information

UM LPC54018 IoT module. Document information. LPC54018, OM40007, Amazon FreeRTOS, AWS, GT1216 LPC54018 IoT module user manual

UM NVT2008PW and NVT2010PW demo boards. Document information

ES_LPC81xM. Errata sheet LPC81xM. Document information

UM NVT2001GM and NVT2002DP demo boards. Document information

ES_LPC5410x. Errata sheet LPC5410x. Document information

Using LPC11Axx EEPROM (with IAP)

IoT Sensing SDK. Getting started with IoT Sensing SDK (ISSDK) v1.7 middleware. Document information. IoT Sensing SDK, ISSDK, MCUXpresso, middleware

UM NXP USB PD shield board user manual COMPANY PUBLIC. Document information

UM LPC General Purpose Shield (OM13082) Rev November Document information. Keywords

QPP Proprietary Profile Guide

UM PCAL6524 demonstration board OM Document information

AN BGA301x Wideband Variable Gain Amplifier Application. Document information. Keywords

OM bit GPIO Daughter Card User Manual

NXP AN11528 sensor Application note

QSG DAC1x08D+ECP3 DB

Release notes for ISSDK v1.7

AN10942 MFRX852 Evaluation Board- Quick start up Guide

CAUTION This device is sensitive to ElectroStatic Discharge (ESD). Therefore care should be taken during transport and handling.

AN BGA GHz 18 db gain wideband amplifier MMIC. Document information. Keywords. BGA3018, Evaluation board, CATV, Drop amplifier.

Broadband system applications i.e. WCDMA, CATV, etc. General purpose Voltage Controlled Attenuators for high linearity applications

UM EEPROM Management of PN746X and PN736X. User manual COMPANY PUBLIC. Rev February Document information

UM OM bit GPIO Daughter Card User Manual. Document information. Keywords Abstract

UM NXP USB Type-C Shield 2 Demo Kit User Manual COMPANY PUBLIC. Document information

UM10766 User manual for the I2C-bus RTC PCF85263A demo board OM13510

UM PR533 - PCSC Tool. User manual COMPANY PUBLIC. Rev November Document information

How to use the NTAG I²C plus for bidirectional communication. Rev June

LPC-Link2 Debug Probe Firmware Programming. Rev June, 2017 User Guide

LPC81x, LPC82x, LPC83x Errata Sheet and Datasheet Update for Vdd.1 Errata

AN NTAG I²C plus memory configuration options. Application note COMPANY PUBLIC. Rev June Document information

AN CBTL08GP053 Programmer's Guide. Document information. Keywords Abstract

PNP 500 ma, 50 V resistor-equipped transistor; R1 = 2.2 kω, R2 = open

AN Sleep programming for NXP bridge ICs. Document information

AN LPC1700 Ethernet MII Management (MDIO) via software. Document information. LPC1700, Ethernet, MII, RMII, MIIM, MDIO

STB-CE v Overview. 2 Features. Release notes for STB-CE v What's new in STB-CE v2.5

UM QN908x Quick Start. Document information. QN908x, Quick Start, Development Kit, QN9080 DK, QN9080 Development Kit

AN Automatic RS-485 address detection. Document information

UM LPCXpresso845MAX. Document information. LPCXpresso845MAX, OM13097, LPC845, LPC844 LPCXpresso845MAX User Manual

AN Entering ISP mode from user code. Document information. ARM ISP, bootloader

UM Gaming suitcase demo system. Document information

UM User manual for the BGU MHz LNA evaluation board. Document information

AN MIFARE Type Identification Procedure. Application note COMPANY PUBLIC. Rev August Document information

In data sheets and application notes which still contain NXP or Philips Semiconductors references, use the references to Nexperia, as shown below.

General-purpose Zener diodes in a SOD323F (SC-90) very small and flat lead Surface-Mounted Device (SMD) plastic package.

300 V, 100 ma PNP high-voltage transistor

AN LPC1700 secondary USB bootloader. Document information. LPC1700, Secondary USB Bootloader, ISP, IAP

QPP Programming Guide

UM OM13500 & OM13500A, PCA9620 & PCx8537 demo board. Document information. Keywords

uip, TCP/IP Stack, LPC1700

LPC540xx_LPC54S0xx. Errata sheet LPC540xx_LPC54S0xx. Document information

UM LPCXpresso Rev th November Document information. LPCXpresso54102, LPC54100 LPCXpresso54102 User Manual

NCR402T. 1. General description. 2. Features and benefits. 3. Applications. 4. Quick reference data

74ABT General description. 2. Features and benefits. 3. Ordering information. Quad 2-input AND gate

AN10913 DSP library for LPC1700 and LPC1300

Wafer Fab process Assembly Process Product Marking Design

QN908x. DK User s Guide. Document information. QN9080-DK, QN9080, QN9083, BLE, USB Dongle This document is an introduction to the QN908x DK V1.

LPC1300, FM+, Fast-mode Plus, I 2 C, Cortex-M3

SiGe:C Low Noise High Linearity Amplifier

In data sheets and application notes which still contain NXP or Philips Semiconductors references, use the references to Nexperia, as shown below.

AN Over-the-Air top-up with MIFARE DESFire EV2 and MIFARE Plus EV1. Document information

SOD Package summary

PESD18VV1BBSF. Very symmetrical bidirectional ESD protection diode

NWP2081T. 1. General description. 2. Features and benefits. 3. Applications. 4. Ordering information. Half-bridge driver IC

UM LPC54114 Audio and Voice Recognition Kit. Rev February Document information. Keywords

UM10760 User manual for the I²C-bus RTC PCF8523 demo board OM13511

Bidirectional ESD protection diode

AN QN902x Quick Start Guide. Document information

UM OM11057 quick start guide. Document information

PESD18VF1BL. 1. General description. 2. Features and benefits. 3. Applications. 4. Quick reference data. 5. Pinning information

AN12119 A71CH Quick start guide for OM3710A71CHARD and i.mx6ultralite

MMBZ16VAL. 1. General description. 2. Features and benefits. 3. Applications. 4. Quick reference data

UM10889 LPCXpresso4337/43S37/18S37

In data sheets and application notes which still contain NXP or Philips Semiconductors references, use the references to Nexperia, as shown below.

ESD protection for ultra high-speed interfaces

GreenChip synchronous rectifier controller. The TEA1792TS is fabricated in a Silicon-On-Insulator (SOI) process.

UM NTAG I²C plus Explorer Kit Peek and Poke. Rev September User manual COMPANY PUBLIC. Document information

PESD5V0C1USF. in portable electronics, communication, consumer and computing devices.

AN10428 UART-SPI Gateway for Philips SPI slave bridges

ES_LPC5411x. Errata sheet LPC5411x. Document information LPC54113J256UK49, LPC54114J256UK49, LPC54113J128BD64, LPC54113J256BD64, LPC54114J256BD64

PESD5V0X2UM. 1. General description. 2. Features and benefits. 3. Applications. 4. Quick reference data

SOT404-REFLOW REL Major version date Minor version date Security status

Installation Manual Installation Manual for the MicroWave Office design kit version v1.0

D (double) Package type descriptive code. SOD2 Package type industry code. DSN Package style descriptive code

PTVSxS1UR series. 1. Product profile. 400 W Transient Voltage Suppressor. 1.1 General description. 1.2 Features and benefits. 1.

In data sheets and application notes which still contain NXP or Philips Semiconductors references, use the references to Nexperia, as shown below.

PESD24VF1BSF. Table 1. Quick reference data Symbol Parameter Conditions Min Typ Max Unit C d diode capacitance f = 1 MHz; V R = 0 V

MF1ICS General description. Functional specification. 1.1 Key applications. 1.2 Anticollision. Product data sheet PUBLIC

DC connector: 5VDC, 2,5A, round; 2,1x5,5x10 mm, inside positive External power supply: AC 230V 50/60Hz, 5V 2,5A out

plastic surface-mounted package; 5 leads D (double) Package type descriptive code TSOP5 Package type industry code

D (double) Package type descriptive code. TSSOP8 Package type industry code. TSSOP8 Package style descriptive code

S (single) Package type descriptive code. DPAK Package type industry code. DPAK Package style descriptive code

AN10688_1. PN532C106 demoboard. Document information. NFC, PN532, PN532C106, demoboard. This document describes PN532C106 demoboard.

Ultra low capacitance ESD protection for Ethernet ports. ESD protection high-frequency AC-coupled Ethernet ports

General-purpose Zener diodes in an SOD523 (SC-79) ultra small and flat lead Surface-Mounted Device (SMD) plastic package.

D (double) Package type descriptive code. SMT3; MPAK Package type industry code. SMT3; MPAK Package style descriptive code

S (surface mount) Issue date

SOD123W. 1. Package summary. plastic, surface mounted package; 2 terminals; 2.6 mm x 1.7 mm x 1 mm body 9 April 2018 Package information

Transcription:

Rev. 1 13 July 2010 Application note Document information Info Content Keywords LPC111X, LPC13XX, UART, software Abstract This application note illustrates how software running on an LPC111X or LPC13XX processor can implement the behavior of a standard Universal Asynchronous Receiver/Transmitter (UART)

Revision history Rev Date Description 1 20100713 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 All information provided in this document is subject to legal disclaimers. NXP B.V. 2010. All rights reserved. Application note Rev. 1 13 July 2010 2 of 11

1. Introduction 2. Implementation The LPC111X and LPC13XX families of microcontrollers offer a wide range of communication interfaces. Each microcontroller contains one on-chip Universal Asynchronous Receiver/Transmitter (UART). However, some applications require more UARTs than are available on the device. While the addition of an external stand-alone UART IC could be used in some of these situations, software based UARTs result in reduced BOM costs and take up no additional space on the PCB. This allows designers to meet their ever increasing miniaturization requirements and ever decreasing cost targets. This application note describes one possible implementation of the full-duplex software UART. This software UART for LPC111X and LPC13XX is migrated from the LPC2000 software UART. For the principle of software UART implementation, please refer to AN10689 LPC2000 software UART for details. This application note made use of the Embedded Artists LPCXpresso 1114 Rev A and LPCXpresso Base Board Rev A evaluation kits with Code Red LPCXpresso 3.3.4. Care should be taken to make sure that the proper jumper configuration on the Base Board is in place, in particular that the thermal sensor is not connected to P1.5 nor is the potentiometer connected to P0.11 Be aware that the example software packages are not optimized. The additional space required by adding the software UART functionality to an existing design can be as low as 1 kb when additional care is taken to optimize the code density. If full-duplex operation is not required by a particular application, code size can be further reduced by trimming the unused features of the UART. This solution relies on a general purpose 32-bit timer and its ability to toggle a dedicated pin while simultaneously monitoring the state of another pin. While the capture and toggle functions of the timer are used, the receive routine also uses an additional match register of the timer. Each timer has four match registers; Table 1 indicates their allocation. In this application note, Timer32_0 was used. See Table 2 for the transfer format used in the example code. Table 1. Match register usage Timer MRn MR0 MR1 MR2 MR3 Function RX RX Available to user TX The software implementation has variable depth FIFOs enabling buffering for both transmission and reception. It should be noted that the UART baud rate, as well as transmitter and receiver FIFO depth, are configured during the compilation process and thus cannot be changed at runtime. All information provided in this document is subject to legal disclaimers. NXP B.V. 2010. All rights reserved. Application note Rev. 1 13 July 2010 3 of 11

Table 2. UART transfer format Parameter Start Bits 1 Data Bits 8 Stop Bits 1 Parity 3. Software environment Value None The demo source code takes advantage of the pin compatibility between the LPC111X and LPC13XX and therefore requires minimal modification to change between target platforms. Table 3 lists the functions of the pins used in the demo. Both of the targeted evaluation modules used in this application note are equipped with hardware to convert the peripheral UART signals to either RS-232 or USB. The software UART pins must be externally connected to these signals in order to communicate with a host PC. Because the pins of the LPC111X/LPC13XX default to using configurable pull-up resistors P1.6 and P1.7 should be set to inactive mode to prevent contention with the software UART signals. Table 3. Pin functions Pin Number Configuration Description P0.11 CT32B0_MAT3 Software Tx P1.5 CT32B0_CAP0 Software Rx P1.6 GPIO (Inactive) RS-232 Driver Rx P1.7 GPIO (Inactive) RS-232 Driver Tx P1.11 Output CALL indicator (active low) P3.0 Output TX_PRO indicator (active low) P3.1 Output INT CT32B0 interrupt indicator (active low) P3.2 Output INT_TX Tx interrupt indicator (active low) P3.3 Output INT_RX Rx interrupt indicator (active low) Included with this application note are several versions of the example software project. They have been tested in the environments listed in Table 4. Default (i.e., without optimization) sizes for the example project are listed in Table 5. Table 4. Tool versions used Tool Version LPC1114 PCB LPC1343 PCB LPCXpresso v3.3.4 LPCXpresso LPC1114 Rev. A, LPCXpresso Base Board Rev. A IAR C/C++ Compiler for ARM LPCXpresso LPC1343 Rev A. LPCXpresso Base Board Rev. A 5.50.0.31878 LPC1114-SK Rev. B LPC1343-SK Rev. B Keil C/C++ Compiler V4.0.0.728 LPC1114-SK Rev. B LPC1343-SK Rev. B All information provided in this document is subject to legal disclaimers. NXP B.V. 2010. All rights reserved. Application note Rev. 1 13 July 2010 4 of 11

Table 5. Estimated build size Tool Device Text (Bytes) LPCXpresso LPC1114 3632 LPCXpresso LPC1343 5236 IAR LPC1114 3636 IAR LPC1343 3710 Keil LPC1114 3796 Keil LPC1343 4216 4. Hardware configuration IAR LPC1114 SK An example wiring connection can be seen in Fig 1. Please be aware that the jumpers connecting P0.11 to P1.7 interfere with the 20 pin standard connector for debugging. This does not affect debugging via the on board JLink, however, it requires external debuggers such as the Keil ULINK2 use the 10 pin SWD header. P0.11 P1.7 P1.5 P1.6 Serial port SWD Connector RS-232 transceiver LPC111X/13XX Fig 1. IAR LPC1114 SK jumpers All information provided in this document is subject to legal disclaimers. NXP B.V. 2010. All rights reserved. Application note Rev. 1 13 July 2010 5 of 11

5. Hardware configuration LPC1114 LPCXpresso Fig 2 illustrates how to connect the software UART signals to the USB translation IC. P0.11 P1.7 UART USB IC USB P1.5 P1.6 LPC111X/13XX Fig 2. LPC1114 LPCXpresso and base board jumpers 6. Operation The demo code for LPC13XX family was tested under several conditions: in a system running an external 12 MHz crystal without the use of a system PLL, as well as in systems using the PLL to generate 24 MHz, 60 MHz and 72 MHz system clocks. The LPC111X family was tested in a system running an external 12 MHz crystal as well as systems using the PLL to generate 24 MHz and 48 MHz system clocks. It should be noted that the UART s baud rate is dependent upon the system clock frequency. Therefore systems using a clock frequency which differ from the example code s 48 MHz/72 MHz must update the BIT_LENGTH definitions in the project s source code. For example, in a 12 MHz system transferring serial data at 9600 bit/s, the BIT_LENGTH is equal to 12000000/9600 = 1250. If the system clock is changed to 48 MHz, BIT_LENGTH should be changed to 48000000/9600 = 5000. The demo application will initially prompt the user with a message, and will then enter a perpetual loop in which received characters are echoed back to the user. This is illustrated in Fig 3. All information provided in this document is subject to legal disclaimers. NXP B.V. 2010. All rights reserved. Application note Rev. 1 13 July 2010 6 of 11

Fig 3. Example output 7. Results 8. Conclusion The oscilloscope screenshots of signal lines could be helpful when debugging. Since they are similar to the LPC2000 software UART, please refer to AN10689 for details. Based on the demo application, the baud rates in Table 6 and Table 7 were determined to be the maximum reliable speed for each system clock frequency listed. Table 6. LPC111X test results System clock (MHz) Max. transmit (bit/s) Max. receive (bit/s) 12 9600 4800 24 38400 9600 48 57600 19200 Table 7. LPC13XX test results System Clock (MHz) Max. transmit (bit/s) Max. receive (bit/s) 12 9600 4800 24 38400 9600 60 115200 19200 72 115200 38400 Despite the LPC11XX/LPC13XX part families being equipped with a single UART peripheral, with this example designers can augment their products with an additional software UART channel. By using the software based implementation no additional ICs will need to be added to the PCB, thus saving space and reducing the cost of manufacturing. All information provided in this document is subject to legal disclaimers. NXP B.V. 2010. All rights reserved. Application note Rev. 1 13 July 2010 7 of 11

9. Legal information 9.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. 9.2 Disclaimers Limited warranty and liability 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. In no event shall NXP Semiconductors be liable for any indirect, incidental, punitive, special or consequential damages (including - without limitation - lost profits, lost savings, business interruption, costs related to the removal or replacement of any products or rework charges) whether or not such damages are based on tort (including negligence), warranty, breach of contract or any other legal theory. Notwithstanding any damages that customer might incur for any reason whatsoever, NXP Semiconductors aggregate and cumulative liability towards customer for the products described herein shall be limited in accordance with the Terms and conditions of commercial sale of NXP Semiconductors. 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 life support, life-critical or safety-critical systems or equipment, nor in applications where failure or malfunction of an 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 at 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. Customers are responsible for the design and operation of their applications and products using NXP Semiconductors products, and NXP Semiconductors accepts no liability for any assistance with applications or customer product design. It is customer s sole responsibility to determine whether the NXP Semiconductors product is suitable and fit for the customer s applications and products planned, as well as for the planned application and use of customer s third party customer(s). Customers should provide appropriate design and operating safeguards to minimize the risks associated with their applications and products. NXP Semiconductors does not accept any liability related to any default, damage, costs or problem which is based on any weakness or default in the customer s applications or products, or the application or use by customer s third party customer(s). Customer is responsible for doing all necessary testing for the customer s applications and products using NXP Semiconductors products in order to avoid a default of the applications and the products or of the application or use by customer s third party customer(s). NXP does not accept any liability in this respect. 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. 9.3 Trademarks Notice: All referenced brands, product names, service names and trademarks are property of their respective owners. All information provided in this document is subject to legal disclaimers. NXP B.V. 2010. All rights reserved. Application note Rev. 1 13 July 2010 8 of 11

10. List of figures Fig 1. IAR LPC1114 SK jumpers...5 Fig 2. LPC1114 LPCXpresso and base board jumpers...6 Fig 3. Example output...7 All information provided in this document is subject to legal disclaimers. NXP B.V. 2010. All rights reserved. Application note Rev. 1 13 July 2010 9 of 11

11. List of tables Table 1. Match register usage...3 Table 2. UART transfer format...4 Table 3. Pin functions...4 Table 4. Tool versions used...4 Table 5. Estimated build size...5 Table 6. LPC111X test results...7 Table 7. LPC13XX test results...7 All information provided in this document is subject to legal disclaimers. NXP B.V. 2010. All rights reserved. Application note Rev. 1 13 July 2010 10 of 11

12. Contents 1. Introduction...3 2. Implementation...3 3. Software environment...4 4. Hardware configuration IAR LPC1114 SK...5 5. Hardware configuration LPC1114 LPCXpresso...6 6. Operation...6 7. Results...7 8. Conclusion...7 9. Legal information...8 9.1 Definitions...8 9.2 Disclaimers...8 9.3 Trademarks...8 10. List of figures...9 11. List of tables...10 12. Contents...11 Please be aware that important notices concerning this document and the product(s) described herein, have been included in the section 'Legal information'. NXP B.V. 2010. All rights reserved. For more information, visit: http://www.nxp.com For sales office addresses, please send an email to: salesaddresses@nxp.com Date of release: 13 July 2010 Document identifier: