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

    Interrupt/Callback for UART 1 ?

    Scheduled Pinned Locked Moved Discussion
    lopywipy
    3 Posts 3 Posters 1.5k Views 3 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.
    • M Offline
      mkharibalaji
      last edited by

      Hi Guys,
      Is there a way to use interrupt/callback for UART 1 so that it triggers whenever data arrives ?
      If it is not available....then I would love to have that feature.....

      Thanks & regards,
      MK HB

      1 Reply Last reply Reply Quote 0
      • S Offline
        Shaun
        last edited by Shaun

        A UART callback on data arrival would be very nice but would have to be implemented well to be truly useful.

        A call back on every byte/symbol received would be too processing intensive in Python code, at higher baud rates.
        Symbol buffering should be done at the C driver level (as it is now) and the callback initialiser would be passed 2 parameters;

        Example:
        buffCount = callback triggered if the rx buffer holds this many bytes/symbols
        (Useful when the rx message length is known/fixed)
        idleCount = callback triggered if the rx buffer contains 1 or more symbols, but the rx line has now been idle for this many symbols
        (Useful for communication gap driven flow control with variable length messages)
        (Also catches broken/incomplete messages)

        idleCount, should accept fractions of a symbol, EG 1.5 symbol idle time, or it could simply be a timeout period and the caller must convert the symbol delay required into a time delay.

        1 Reply Last reply Reply Quote 0
        • D Offline
          daniel
          last edited by

          @mkharibalaji that callback is not yet available, but it's planned to have it implemented.

          1 Reply Last reply Reply Quote 1

          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