Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    UART RTS/CTS are working correctly?

    Scheduled Pinned Locked Moved Issues & Bugs
    1 Posts 1 Posters 212 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Offline
      alvaroav
      last edited by alvaroav

      Dear all,

      Firmware version: 1.20.0.rc13

      Following UART pycom documentation: https://docs.pycom.io/firmwareapi/pycom/machine/uart/
      It is reported that
      "pins is a 4 or 2 item list indicating the TXD, RXD, RTS and CTS pins (in that order). Any of the pins can be None if one wants the UART to operate with limited functionality. If the RTS pin is given the the RX pin must be given as well. The same applies to CTS. When no pins are given, then the default set of TXD (P1) and RXD (P0) pins is taken, and hardware flow control will be disabled. If pins=None, no pin assignment will be made"

      However, following also the example given on the docs:

      from machine import UART
      
      # this uses the UART_1 non-default pins for TXD, RXD, RTS and CTS (``P20``, ``P21``, ``P22``and ``P23``)
      uart = UART(1, baudrate=9600, pins=('P20', 'P21', 'P22', 'P23'))
      uart.write('hello')
      

      I can't comunicate because RTS never raises.
      If I program a "hard-coded" RTS, like

      RTS = Pin('G16', mode=Pin.OUT, value=0, pull=Pin.PULL_DOWN)
      

      and just switch ON-OFF this RTS signal before UART TX, now it works!!

      RTS.value(1)
      uart.write('hello')
      time.sleep(0.1)
      RTS.value(0)
      

      Please notice that I have to give some time with th time.sleep to allow the write process to be completed. This is what I try to avoid making use of the supposely embedded RTS of the UART library, since it waits to all data to be sent.

      From previous topics, some users also claims that UART is not fully developed on the firmware, and it might be abug the implementation of the RTS/CTS.

      Has anyone checked that it works as expected?

      Thanks and BR
      Alvaro

      1 Reply Last reply Reply Quote 0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • 1 / 1
      • First post
        Last post

      Pycom on Twitter

      Pycom