UART Write
-
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
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