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 Write

    Scheduled Pinned Locked Moved FiPy
    fipyuart
    1 Posts 1 Posters 257 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.
    • D Offline
      DDA
      last edited by DDA

      All,
      Trying to connect a PIC18F processor to FIPY. Fipy and PIC serial being tied together via level logic converter (TXS0108EPWR from Texas Instruments). Fipy receiving data from PIC perfectly, but when I pass the Fipy's date/time data back to PIC, the data is not making sense. Example, sending MM=08,DD=05, YY=19, Hr=14, Min=41 as
      uart1.write('0805191441') returns
      Received b'008600F6000000170000\r'
      or
      Received b'00008600F60000001700\r'
      or, after hex conversion of same:
      uart1.write(b'\x2FFE3F11') returns
      Received b'00008600F60000001700\r'
      on PIC side.

      import machine
      import struct
      import time
      import pycom
      from network import WLAN
      time.sleep(3) # add sleep to allow for TPS softstart
      pycom.heartbeat(True)
      uart1 = UART(1, baudrate=9600)
      uart1.init(9600,bits=8,parity=None, stop=1)
      while True:
          recv=uart1.readall()
          print('Received  %s' %recv)
          snd=hex(0805191441)
          #uart1.write('0805191441')
          uart1.write(b'\x2FFE3F11')
          time.sleep(2)    
               
      

      What am I doing wrong?? Eventually, I would like to pass the MMDDYYHRMIN variable, but at this time even a fixed made up known time is not making sense.
      Thanks

      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