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

    WiPy 2.0 + Expansion Board 2.0 SD Card and UART1

    Scheduled Pinned Locked Moved WiPy 2&3
    2 Posts 2 Posters 1.0k 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.
    • G Offline
      gdonaire
      last edited by

      Hi,

      It is possible to use the SD Card and the UART1 serial port at the same time?
      If not, Can I change the TX, RX pins for UART1?
      There is any table for the alternative function of the pins (alt parameter)?

      Thanks and best regards,

      1 Reply Last reply Reply Quote 2
      • D Offline
        drl
        last edited by

        Hi,

        I had the same problem. I resolve it using the next code:

        from machine import SD
        import os

        uart=UART(1,baudrate=115200,pins=('P12','P11')) ## it is important to create uart before sd
        #uart.init(115200, bits=8, parity=None, stop=1,pins=('P3','P4'))
        #uart.init(115200, bits=8, parity=None, stop=1,pins=('P10','P9'))
        #uart.init(115200, bits=8, parity=None, stop=1,pins=('P12','P11'))

        while(uart.any()==0):
        pass
        uart.readall()

        sd = SD()
        os.mount(sd, '/sd')

        check the content

        os.listdir('/sd')

        try some standard file operations

        f = open('/sd/test.txt', 'w')
        f.write('Testing SD card write operations + serial to HPoseidon')
        f.close()
        f = open('/sd/test.txt', 'r')
        f.readall()
        f.close()

        I hope it will be useful. Sorry for mi English.

        Regards

        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