0

Metro M4 UART on pins D10/D11 not sending
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Metro M4 UART on pins D10/D11 not sending

by celkins on Wed Jun 12, 2019 2:22 pm

Folks,
since these's no UART over USB available, I'm hooking a USB<->TTL convertor in to achieve PC communications: reading is fine, I can see command requests coming in from the PC, my CircuitPython code processes them, and "sends" the reply - it shows the expected number of bytes sent from serial.write(), and the byte buffer appears correct, too, but my logic analyser shows no transitions on the TX pin, just a constant high level, whereas I can clearly see the incoming byte stream on RX

Code: Select all | TOGGLE FULL SIZE
# Create UART for ASCOM link
serial = busio.UART(
    board.D10,
    board.D11,
    baudrate=9600,
    bits=8,
    parity=None,
    stop=1,
    timeout=0.25,
    receiver_buffer_size=64,
)

[snip]
Code: Select all | TOGGLE FULL SIZE
wrote= ascom.write(bytes(ascom_reply_buf))   # send reply
print("   Sent[", wrote, "]:", bytes(ascom_reply_buf), end='')

shows:-
Code: Select all | TOGGLE FULL SIZE
Sent[ 8 ]: b'00002A00'


I can't see anything obviously wrong in my python (I'm pretty new to this - PERL, csh, & C are more my area): the only area that I can't really check is that the TX muxing is correct - the CircuitPython source appears to be correctly setting direction & no-pull, but I've no way to check whether the pad mux is correct.


Any thoughts, please?

celkins
 
Posts: 2
Joined: Thu May 23, 2019 8:22 pm

Re: Metro M4 UART on pins D10/D11 not sending

by tannewt2 on Thu Jun 13, 2019 2:42 pm

I don't see anything immediately wrong. Have you tried it on the designated TX and RX pins?

Not many drivers use UART TX so it's totally possible there is a bug.

We'd love help debugging it if you want to dig into the C side of CircuitPython. Build instructions are here: https://learn.adafruit.com/building-circuitpython

tannewt2
 
Posts: 1266
Joined: Thu Oct 06, 2016 8:48 pm

Re: Metro M4 UART on pins D10/D11 not sending

by celkins on Thu Jun 13, 2019 3:50 pm

I’m using the 0/1 UART to drive a serial LCD display, which is why I’m having to use another UART (in the absence of CDC communications) for the PC link.
I’ll dig out the data sheet, and see if the code looks correct, but I did note a post in one of the other forums (using Arduino IDE, IIRC) that someone observed that additional UART TX didn’t work correctly due to an incorrect pad setting - was 0, should have been 2, and it worked when they changed this...
Thanks for looking,
Carl

celkins
 
Posts: 2
Joined: Thu May 23, 2019 8:22 pm

Re: Metro M4 UART on pins D10/D11 not sending

by tannewt2 on Fri Jun 14, 2019 12:57 pm

Ah ok. Please file an issue here for it: https://github.com/adafruit/circuitpython/issues

tannewt2
 
Posts: 1266
Joined: Thu Oct 06, 2016 8:48 pm

Please be positive and constructive with your questions and comments.