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 P0 and P1

    Scheduled Pinned Locked Moved Getting Started
    2 Posts 2 Posters 226 Views 2 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.
    • Z Offline
      Zinoex
      last edited by

      Hi People

      I'm working on a project using the LoPy for its LoRa communication, but the important thing is that it interacts with the other components through UART (technically only a single microcontroller but that interactions with all other components).
      Naturally, I would need like most operations to be non blocking. I know, I can acheive it using uart.any().
      However, as of now, it is connected through Pin 0 and 1, which is also the Pins where there REPL loop connects to.
      As such I cannot instantiate the UART for these pins, and I cannot acheive this non blocking operation of the system.
      Is there any way to either manually create the UART for these pins to have the UART-object or otherwise use input() or sys.stdin in a non blocking fashon?

      Thanks beforehand!

      robert-hhR 1 Reply Last reply Reply Quote 0
      • robert-hhR Offline
        robert-hh @Zinoex
        last edited by

        @Zinoex You can open UART0 like any other uart, even if it is used by REPL, and use uart.any() for checking, whether a character arrived. REPL is only active when no code is running. Be aware that this channel is not fully transparent, since by default the input stream is still checked for Ctrl-C and Ctrl-F. You can deactivate this test off by calling micropython.kbd_intr(-1).

        1 Reply Last reply Reply Quote 3

        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