Cant Get RS485 TTL Convertor Working
-
Trying to get this working, but am unable to send/receive anything at all https://shop.m5stack.com/products/rs485-module
Ive tried on the core (pins 17/16) and core 2 (pins 14/13).
For testing im just running this very basic code but can only get 'None' as a response. To send data im just using YAT and a USB->RS485 convertor which I have tested using a known-working device. Any ideas of what might be wrong?
from m5stack import * from m5ui import * from uiflow import * uart1 = machine.UART(1, tx=14, rx=13) uart1.init(9600, bits=8, parity=None, stop=1) while True: print(uart1.readline()) wait_ms(500)
-
@jkeyser if anyone comes across this in the future, at least on the core 2 the correct pins are 33/32
-
Hi @jkeyser, Did you get it working on pins 32/33?
If not, these posts might help you.
https://forum.m5stack.com/topic/5615/m5-tough-uart-communication/12
https://forum.m5stack.com/topic/1546/micro-bit/8I just wanted to clarify because I think that UART is indeed on pins 13/14.
If you see the table in this document
https://docs.m5stack.com/en/core/core2PORT. PIN Note:
PORT-A(Red) 32/33 I2C
PORT-B(Black) 26/36 DAC/AD
PORT-C(Blue) 13/14 UARTThe Groove port on the side of the Core2 is I2C (A/Red), which is probably where the 32/33 comes from (you may be able to switch mode and run on 32/33, please confirm if you can). The port of the TTL to RS485 convertor is UART (C/Blue). You can pin this directly onto a naked Core2 with a Groove to Dupont cable or a base with UART (C/Blue) port. In my case, I have CatM IoT base or you might have the blue port on the M5GO2 base available, which I think is default supplied with the Core2. Best of luck.
-
This, at approx. 5 mins in, might help with the I2C port reassigning for UART (I recalled I used it for StickC).
https://www.youtube.com/watch?v=zSUyC-SQOEU -
@gavin67890 I was able to get it working with 32/33 just by assigning with
uart1 = machine.UART(1, tx=32, rx=33)
which it looks like is the same the guy did in the video