FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    How to interchange the RX and TX pins and levels of the UART in STM32

     

    Today, I will share some new features about STM32 on the UART, mainly for UARTs of newer series STM32 (eg STM32H7, G0, G0, etc.), can change the RX and TX pin, level reversal, high and low inward , Introduce timeout, etc.. It supports RXD and TXD pin swap Sometimes, when we add RS232 chip, might RXD and TXD two lines reversed. Such low-level errors, usually older drivers will be made. If you know of USART TXD and RXD pins are interchangeable, so when connecting RS232 chip peripherals, if an error occurs, you do not have to modify the hardware, the software will simply direct inversion RXD and TXD pin that is coming correctable errors. Referring the FIG., SWAP bit set, to the RXD and TXD pin swap. Supports transmission and reception level of the polarity inversion The second new feature: Tx and Rx level of the polarity inversion. Typically the default serial level is high to a logic 1, a logic 0 is low. In the new features of the STM32 USART is set to a logic high level may be 0, 1 is set to a logical low level. This feature, let us flexibility in the use of some special scenarios, such as: when the external inverter can be used directly USART. Receiving transmission data register, the data also may be reversed, the original 0 to 1, the original 1 becomes 0, and this level is similar to the polarity inversion. To note that, at the time of polarity inversion, the start and stop bits are also reversed, all signal levels are inverted; and in the data registers only the inverted data bits, which also includes the parity bit, there is no start and stop bits of the polarity inversion signal. Referring the figure, in register USART_CR2 TXINV, RXINV DATAINV bits and set. Upper and lower supports data transmission or reception antitone The third new feature: when transmitting and receiving data, may be provided is the starting or starting lower in the upper register. The default configuration is to transmit or receive a low signal (bit 0), the practical application, after the USART_CR2 MSBFIRST provided by USART may allow to transmit or receive a signal high (bit 7/8), which is in pair when the data in reverse order will often use it. We can consider the case, then if you need the serial data received by the first operation carried out in reverse order, and then calculated that this hardware feature can help us save a lot of the workload of the software. The USART supports DMA transfers Finally, STM32 USART are in support of the DMA, which is conducive to the continuous buffer for data sent and received data. In some STM32 product lines, such as STM32F4 and H7 series with a dedicated serial port FIFO, which can be used for serial wake up, let the MCU into Sleep mode when receiving a complete packet, the packet may be 100 bytes or 200 bytes, then after a wake-up so that either do not lose the data and can reduce the frequency of wakeups MCU. In addition, the USART receiving function also has a time-out, a time can be manually set, it is set in the register of the USART RTOR, when the serial data frames between the received exceeds the set value, it will trigger a timeout interrupt, the serial port there will be a flag RTOF called a timeout to display events, we break through the application of this code can know the serial data interruption occurred, that the other side can approximate the data has been sent. In this way, in the development of serial upper-layer protocols, there are many application scenarios. USART New Features Summary Support swap RXD and TXD pins Logically inverting the logic level of the support pin and inverted data registers Supports high data transmission or reception and the low reverse order, either to transmit or receive low, may be sent or received first high Support timeout function to receive data, and each USART can support DMA transfers, read the full text of the original title: How UART Rx and Tx pins are interchangeable, how to level inversion Article Source: [Micro Signal: strongerHuang, micro-channel public number: embedded program ape] Add welcome attention! Please indicate the source of the article.

     

     

     

     

    List all Question

    Nickname

    Email

    Questions

    Our other product:

    Professional FM Radio Station Equipment Package

     



     

    Hotel IPTV Solution

     


      Enter email  to get a surprise

      fmuser.org

      es.fmuser.org
      it.fmuser.org
      fr.fmuser.org
      de.fmuser.org
      af.fmuser.org ->Afrikaans
      sq.fmuser.org ->Albanian
      ar.fmuser.org ->Arabic
      hy.fmuser.org ->Armenian
      az.fmuser.org ->Azerbaijani
      eu.fmuser.org ->Basque
      be.fmuser.org ->Belarusian
      bg.fmuser.org ->Bulgarian
      ca.fmuser.org ->Catalan
      zh-CN.fmuser.org ->Chinese (Simplified)
      zh-TW.fmuser.org ->Chinese (Traditional)
      hr.fmuser.org ->Croatian
      cs.fmuser.org ->Czech
      da.fmuser.org ->Danish
      nl.fmuser.org ->Dutch
      et.fmuser.org ->Estonian
      tl.fmuser.org ->Filipino
      fi.fmuser.org ->Finnish
      fr.fmuser.org ->French
      gl.fmuser.org ->Galician
      ka.fmuser.org ->Georgian
      de.fmuser.org ->German
      el.fmuser.org ->Greek
      ht.fmuser.org ->Haitian Creole
      iw.fmuser.org ->Hebrew
      hi.fmuser.org ->Hindi
      hu.fmuser.org ->Hungarian
      is.fmuser.org ->Icelandic
      id.fmuser.org ->Indonesian
      ga.fmuser.org ->Irish
      it.fmuser.org ->Italian
      ja.fmuser.org ->Japanese
      ko.fmuser.org ->Korean
      lv.fmuser.org ->Latvian
      lt.fmuser.org ->Lithuanian
      mk.fmuser.org ->Macedonian
      ms.fmuser.org ->Malay
      mt.fmuser.org ->Maltese
      no.fmuser.org ->Norwegian
      fa.fmuser.org ->Persian
      pl.fmuser.org ->Polish
      pt.fmuser.org ->Portuguese
      ro.fmuser.org ->Romanian
      ru.fmuser.org ->Russian
      sr.fmuser.org ->Serbian
      sk.fmuser.org ->Slovak
      sl.fmuser.org ->Slovenian
      es.fmuser.org ->Spanish
      sw.fmuser.org ->Swahili
      sv.fmuser.org ->Swedish
      th.fmuser.org ->Thai
      tr.fmuser.org ->Turkish
      uk.fmuser.org ->Ukrainian
      ur.fmuser.org ->Urdu
      vi.fmuser.org ->Vietnamese
      cy.fmuser.org ->Welsh
      yi.fmuser.org ->Yiddish

       
  •  

    FMUSER Wirless Transmit Video And Audio More Easier !

  • Contact

    Address:
    No.305 Room HuiLan Building No.273 Huanpu Road Guangzhou China 510620

    E-mail:
    [email protected]

    Tel / WhatApps:
    +8618078869184

  • Categories

  • Newsletter

    FIRST OR FULL NAME

    E-mail

  • paypal solution  Western UnionBank OF China
    E-mail:[email protected]   WhatsApp:+8618078869184   Skype:sky198710021 Chat with me
    Copyright 2006-2020 Powered By www.fmuser.org

    Contact Us