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

    Scheduled Pinned Locked Moved WiPy 2&3
    9 Posts 4 Posters 2.7k Views 4 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
      acheesehead
      last edited by

      Hooked up an FTDI USB/3_3 TTL cable to P3 and P4 as described in the quickref. I tried the command uart = UART(1, baudrate=9600) and get resource not available. Then, I discovered that uart is already a variable. Looked at boot.py and it reads

      '# boot.py -- run on boot-up\r\nimport os\r\nfrom machine import UART\r\nuart = UART(0, 115200)\r\nos.dupterm(uart)\r\n'

      Not the same port as defined in quickref and I do not get any characters on the USB/serial interface, nor can I type any.

      1 Reply Last reply Reply Quote 0
      • X Offline
        Xykon administrators
        last edited by

        It's a bad choice in the example... replace uart (the lower case ones) with uart1.

        Also I think the TX and RX pins should be the other way around. TX on the FTDI to P3 and RX to P4

        Christian Ehlers

        1 Reply Last reply Reply Quote 0
        • A Offline
          acheesehead
          last edited by

          Tried both ways with fTDI RX & TX to WiPy RX & TX. Still nothing. Tried other variations of UART(x, baudrate=9600), using different values of x. Always throws resource not available exception. I have not been able to do anything useful with the board so far. I need 1-wire, I2C and analogs to work. UART is useful for debugging.

          1 Reply Last reply Reply Quote 0
          • X Offline
            Xykon administrators
            last edited by Xykon

            Are you using the latest firmware version? MicroPython 7713d55 on 2016-10-28 release='0.9.2.b2'? I only have a LoPy so this might be something specific to the WiPy2?

            I've been working with SPI and I2C the last few days and they've been working as expected. I also did some UART1 tests earlier today and also didn't have any problems. I wouldn't image there being any difference in the UART module between LoPy and WiPy 2 as they both use the same chip.

            Christian Ehlers

            1 Reply Last reply Reply Quote 0
            • A Offline
              acheesehead
              last edited by

              Can't try anything until Mon. morning when I get back to work. Board is at work and only connects to my laptop, which is now at home.

              1 Reply Last reply Reply Quote 0
              • U Offline
                ubiq_01 Pybytes Beta
                last edited by

                I made an annotated photo of a working setup. Please see https://twitter.com/_rac01/status/795201584846217216

                best regards
                Ralf

                A 1 Reply Last reply Reply Quote 0
                • A Offline
                  acheesehead @ubiq_01
                  last edited by

                  @ubiq_01 Thanks. I am looking at the pinout released this weekend. It shows UART0 RX on P0 and UART0 TX on P1. I see no UART function on P3 and P4..

                  1 Reply Last reply Reply Quote 0
                  • A Offline
                    acheesehead
                    last edited by

                    OK. So I updated the firmware using the same FTDI cable attached to P0 (RX) and P1 (TX), with jumper for safe mode. Am now at release 0.9.3.b2, version d78a5a3 2016-11-05. uart shows up as 0 at 115200, which is the REPL port. Was able to hook the FTDI cable up to P3 (TX) and P4 (RX) and create a uart1 object using uart1=UART(1, baudrate=115200). I was able to send characters to the port and receive from it.

                    What I really wanted was the REPL port though, so I switched the FTDI cable back to P0 and P1 and it is working as expected.

                    1 Reply Last reply Reply Quote 0
                    • A Offline
                      averri
                      last edited by

                      This post is deleted!
                      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