Skip to main content
zabel
Associate III
January 2, 2013
Question

STM32F207 Uart polarity

  • January 2, 2013
  • 5 replies
  • 2068 views
Posted on January 02, 2013 at 15:55

Hi,

is there any possibility to change the polarity TX and RX of USART5? I.e. normally idle state is high, startbit is low. We need (due to bad specs of a foreign device) the opposite polarity (software only solution). I could not find anything in the reference manual, but maybe I missed something?

TIA

  Dirk

    This topic has been closed for replies.

    5 replies

    Tesla DeLorean
    Guru
    January 2, 2013
    Posted on January 02, 2013 at 16:02

    No you'll need to add external inverters.

    Remember the USARTs output ~3V CMOS levels, and not compatible with RS232 levels. The typical RS232 level converters have inverters in them, see MAX232
    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    zabel
    zabelAuthor
    Associate III
    January 3, 2013
    Posted on January 03, 2013 at 10:51

    Thank you, clive1.

    The hardware is fixed (and no RS232 level converter involved), so an external inverter is no option. I will have to emulate an USART by software. Fortunately, the baud rate is quite low.

    Regards

      Dirk

    jj2
    Associate
    January 3, 2013
    Posted on January 03, 2013 at 16:49

    To confirm & amplify Clive1's earlier response - the bit ''flips'' you need (via simple inverter) may be placed at ''either'' of your two boards.  (assuming you are communicating - via UART - w/2nd board)

    So - if your STM32 pcb is ''fixed'' - perhaps the 2nd board can accommodate some ''tacked on'' inverter.  Should there be a cable or wire-harness between boards - we've seen clients insert such inverters/level shifters - with some elegance - ''in the cable line.''

    Should yours be a single board project - agree that you're then stuck...

    Andrew Neil
    Super User
    January 3, 2013
    Posted on January 03, 2013 at 18:01

    ''Should there be a cable or wire-harness between boards''

     

    Maybe even a board-to-board connector? 

    ''insert such inverters/level shifters - with some elegance - 'in the cable line'.''

    Possibly ''within'' the connector?

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    jj2
    Associate
    January 3, 2013
    Posted on January 03, 2013 at 18:36

    A.W. Neil, ''Possibly ''within'' the connector?''

    elegance ++  (simply ideal - but may be hard, ''after the fact'')  beats the heck out of my suggestion...