AN4113 Application note

Similar documents
AN2667 Application note

STEVAL-CCM002V1. TFT-LCD panel demonstration board based on the STM32 as LCD controller. Features. Description

STEVAL-SPBT4ATV3. USB dongle for the Bluetooth class 1 SPBT2632C1A.AT2 module. Features. Description

STEVAL-PCC010V1. ST802RT1A Ethernet PHY demonstration board with STM32F107 controller add-on board. Features. Description

AN2672 Application note

AN3996 Application Note

AN2676 Application note

AN2143 Application note

UM1572 User manual. STEVAL-IPE020V1: ST energy meter application based on the Android platform. Introduction

AN626 Application note

STM32-MP3NL/DEC. STM32 audio engine MP3 decoder library. Description. Features

UM0792 User manual. Demonstration firmware for the DMX-512 communication protocol transmitter based on the STM32F103Zx.

AN3354 Application note

AN3965 Application note

AN3279 Application Note

EV-VNQ5E050AK VNQ5E050AK evaluation board

AN2470 Application note TS4871 low voltage audio power amplifier Evaluation board user guidelines Features Description

STM3210B-SK/KEIL STR91X-SK/KEI, STR7-SK/KEIL

AN2673 Application note

AN2855 Application note

AN2557 Application note

STTS V memory module temperature sensor. Features

UM0401 User manual. User manual for eight bit port expander STMPE801 demonstration board. Introduction

OSPlus USB Extension. OSPlus USB 2.0 extension. Description. Features. Application. TCP/IP stack NexGenOS NexGenIP VFS. FAT Ext2 LVM Device layer

STA bit single chip baseband controller for GPS and telematic applications. Features

AN3980 Application note

ST19WR08 Dual Contactless Smartcard MCU With RF UART, IART & 8 Kbytes EEPROM Features Contactless specific features

STM32-SK/KEIL STR91X-SK/KEI, STR7-SK/KEIL

UM0693 User manual. 1 Introduction. STM8L101-EVAL demonstration firmware

STM8 I 2 C optimized examples

AN2825 Application Note

AN2261 APPLICATION NOTE

AN3154 Application note

EVAL6235PD. L6235 three-phase brushless DC motor driver demonstration board. Features. Description

SOT23-6L ESDALCL6-2SC6

UM1488 User manual. STPMC1 evaluation software. Introduction

AN2737 Application note Basic in-application programming example using the STM8 I 2 C and SPI peripherals Introduction

AN2781 Application note

STM32 embedded target for MATLAB and Simulink release 3.1. Summary for STM32 embedded target for MATLAB and Simulink release 3.1:

STM3220G-SK/KEI. Keil starter kit for STM32F2 series microcontrollers (STM32F207IG MCU) Features. Description

AN3250 Application note

ST19NP18-TPM-I2C Trusted Platform Module (TPM) with I²C Interface Features

STEVAL-IHM028V1. 2 kw 3-phase motor control demonstration board featuring the IGBT intelligent power module STGIPS20K60. Features.

STLC2500D. Bluetooth V2.1 "Lisbon" + EDR. Features. Description

ST33F1M. Smartcard MCU with 32-bit ARM SecurCore SC300 CPU and 1.25 Mbytes high-density Flash memory. Features. Hardware features.

UM1084 User manual. CR95HF development software user guide. Introduction. Reference documents

AN2592 Application note

AN2240 Application note

AN2474 Application note

STICE CF/Stice_Connect AD/Stice_Connect AS/Stice_Connect

AN2430 Application note

AN2594 Application note

STM32-SK/RAIS,STR91X-SK/RAI,STR7-SK/RAIS STM32-D/RAIS,STR9-D/RAIS,STR7-D/RAIS

ST21NFCB. Near field communication controller. Features. RF communications. Hardware features. Communication interfaces. Electrical characteristics

AN2361 Application note

AN3174 Application note

AN4274 Application note

AN2734 Application note S-Touch design procedure Introduction

AN3362 Application note

TN0189 Technical note

Main components USB charging controller with integrated power switch

Description SPC564A-DISP. March 2014 DocID Rev 3 1/5

EMIF01-SMIC01F2 IPAD. Single line EMI filter including ESD protection. Main application. Description. Benefits. Pin configuration (Bump side view)

EMIF02-SPK02F2. 2-line IPAD, EMI filter and ESD protection. Features. Application. Description. Complies with the following standards

TN0132 Technical note

Obsolete Product(s) - Obsolete Product(s)

AN3001 Application note

SMP75. Trisil for telecom equipment protection. Features. Description. Applications. Benefits

ST10F271B/E, ST10F272B/E Errata sheet

AN2202 Application note

STMicroelectronics. STxP70-4 assembler. User manual Rev A. October

AN3975 Application note

RN0046 Release note. 1 Introduction. SimpleMAC library for STM32W108xx kits. About this release note

AN4321 Application note

AN3988 Application note

Main components 1 A, high efficiency adjustable single inductor dual mode buckboost DC-DC converter

AN3140 Application note

AN2792 Application note

Getting started with DfuSe USB device firmware upgrade STMicroelectronics extension

LD A very low drop adjustable positive voltage regulator. Description. Features

EMIF02-MIC01F2 2-line IPAD, EMI filter including ESD protection Features Application Description Complies with the standards:

AN4152 Application note

AN2408 Application note

AN2548 Application note

AN3155 Application note

AN3265 Application note

AN4440 Application note

ST33F1M, ST33F1M0, ST33F896, ST33F768, ST33F640, ST33F512

STM8L-PRIMER STM32-PRIMER STMPRIMER

AN2768 Application note LIS331DL 3-axis digital MEMS accelerometer: translates finger taps into actions Introduction

AN2606 Application note

Description of STM8 LIN software package (STSW-STM8A-LIN) release 4.1. Table 1. Release information. STM8 LIN package

AN3099 Application note

AN4058 Application note

L6460. SPI configurable stepper and DC multi motor driver. Features. Description

SMP30. Trisil for telecom equipment protection. Features. Applications. Description. Benefits


UM1719 User manual. The STPM3x evaluation software. Introduction

STM8L-PRIMER STM32-PRIMER STMPRIMER

UM1008 User manual. Demonstration kit for the ST7570 power line modem with graphical user interface. Introduction

Transcription:

Application note Managing the Driver Enable signal for RS-485 and IO-Link communications with the STM32F05x USART Introduction RS-485 and IO-Link are half-duplex communication protocols that offer easy ways of implementing the physical layer in industrial networks. The STM32F05x, which comes with 2 UART interfaces and features, fast DMA transfer and low interrupt latency, meets the RS-485 and IO-Link timing specifications. This application note aims at providing timing measurements of the DE signal (Driver Enable) switching. The application note is organized into three parts: it first explains why the timing of the DE signal is critical it then describes DE feature in the STM32F05x USARTs. and, finally, it gives measurement of the DE signal switching time Table 1. Applicable products and tools Type Microcontroller Part numbers STM32F05xx November 2012 Doc ID 023197 Rev 1 1/11 www.st.com

Contents AN4113 Contents 1 DE signal timing constraint................................... 5 2 Description of the DE feature in STM32F05x..................... 6 3 How to configure DE timing................................... 7 3.1 Case of oversampling by 16.................................... 7 3.2 Case of oversampling by 8..................................... 7 4 Measuring the DE signal switching time......................... 8 5 Conclusion................................................. 9 6 Revision history........................................... 10 2/11 Doc ID 023197 Rev 1

List of tables List of tables Table 1. Applicable products and tools................................................ 1 Table 2. Document revision history................................................. 10 Doc ID 023197 Rev 1 3/11

List of figures AN4113 List of figures Figure 1. DE timing constraint....................................................... 5 Figure 2. how to configure STM32F05x DE feature...................................... 6 Figure 3. Data sampling when oversampling by 16....................................... 7 Figure 4. Data sampling when oversampling by 8........................................ 7 Figure 5. Zoom in DE signal switching period........................................... 8 4/11 Doc ID 023197 Rev 1

DE signal timing constraint 1 DE signal timing constraint For serial half-duplex communication protocols like RS-485 & IO-Link, the master needs to generate a direction signal to control the transceiver (PHY). This signal informs the PHY if it must act in send or receive mode. The timing of this control is critical, especially when switching from the send to the receive mode, as the application has to make sure that the device is in reception mode before data is sent by the other entity. The master has to free the Tx/Rx line in no more than a bit time, otherwise there is a collision with the slave response. So the DE signal has to switch from high to low level within the bit time that follows the last bit of the last byte sent by the master. Figure 1. DE timing constraint t BIT C/Q line Master request Slave response t DE (Driver Enable) ai17356 The master should be able to guarantee the timing of the DE signal (imposed by the RS-485 & IO-Link specifications). The DE signal is managed by the USART. The DE signal is mapped to the RTS pin of the USART, and in this application it is connected with the pin 12 of port A (PA12). Doc ID 023197 Rev 1 5/11

Description of the DE feature in STM32F05x AN4113 2 Description of the DE feature in STM32F05x The driver enable signal is managed automatically via the USART. The driver enable feature is enabled using the USART_DECmd() function. This allows the user to activate the external transceiver control, through the DE (Driver Enable) signal. The assertion time is the time between the activation of the DE signal and the beginning of the START bit. It is programmed using the USART_SetDEAssertionTime() function. The de-assertion time is the time between the end of the last stop bit, in a transmitted message, and the de-activation of the DE signal. It is programmed using the USART_SetDEDeassertionTime() function. The polarity of the DE signal can be configured using the USART_DEPolarityConfig() function. Figure 2 describes how to configure STM32F05x DE feature. Figure 2. how to configure STM32F05x DE feature 6/11 Doc ID 023197 Rev 1

How to configure DE timing 3 How to configure DE timing The assertion and de-assertion values are expressed in term of simple time unit (stu) which depends on the data oversampling mode. There are 2 cases: 3.1 Case of oversampling by 16 In case of oversampling by 16 (see Figure 3), DE value must be less or equal to 16 stu. Figure 3. Data sampling when oversampling by 16 RX LINE stu sampled values Sample clock 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 7/16 7/16 One bit time 6/16 MS30362V1 3.2 Case of oversampling by 8 In case of oversampling by 8 (see Figure 4), DE value must be less or equal to 8 stu. Figure 4. Data sampling when oversampling by 8 Doc ID 023197 Rev 1 7/11

Measuring the DE signal switching time AN4113 4 Measuring the DE signal switching time This section gives some DE timing measurements using the two previously described oversampling cases. The timing to be measured is the time interval between the end of the stop bit of the last byte and the falling edge of the DE signal. It is measured in CPU clock cycles (refer to Figure 5). Figure 5. Zoom in DE signal switching period 1. (1) DE assertion period 2. (2) Start bit 3. (3) Data (8 bits) 4. (4) Stop bit 5. (5) DE de-assertion period DE measured timing value was 4.2 µs which is equal to one bit time with following configuration: 1. oversampling by 16 Data sent : 0x01 BaudRate = 230400 baud DE assertion time = 0x10 DE deassertion time = 0x10 2. oversampling by 8 Data sent : 0x01 BaudRate = 230400 baud DE assertion time = 0x08 DE deassertion time = 0x08 8/11 Doc ID 023197 Rev 1

Conclusion 5 Conclusion Thanks to the STM32F05x USART Driver Enable feature, the user can develop RS-485 & IO-link applications with reduced firmware and hardware resources. Doc ID 023197 Rev 1 9/11

Revision history AN4113 6 Revision history Table 2. Document revision history Date Revision Changes 07-Nov-2012 1 Initial release. 10/11 Doc ID 023197 Rev 1

Please Read Carefully: Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries ( ST ) reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any time, without notice. All ST products are sold pursuant to ST s terms and conditions of sale. Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no liability whatsoever relating to the choice, selection or use of the ST products and services described herein. No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein. UNLESS OTHERWISE SET FORTH IN ST S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. UNLESS EXPRESSLY APPROVED IN WRITING BY TWO AUTHORIZED ST REPRESENTATIVES, ST PRODUCTS ARE NOT RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY, DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVE GRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER S OWN RISK. Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any liability of ST. ST and the ST logo are trademarks or registered trademarks of ST in various countries. Information in this document supersedes and replaces all information previously supplied. The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners. 2012 STMicroelectronics - All rights reserved STMicroelectronics group of companies Australia - Belgium - Brazil - Canada - China - Czech Republic - Finland - France - Germany - Hong Kong - India - Israel - Italy - Japan - Malaysia - Malta - Morocco - Philippines - Singapore - Spain - Sweden - Switzerland - United Kingdom - United States of America www.st.com Doc ID 023197 Rev 1 11/11