Hello,
I was setting up open drain UART on Teensy 4.1.
Function description of setTX(pin,opendrain) mentions it "may be called before begin(baud)"
so I thought I should set the same default pin first to open drain and use it like this:
Serial1.setTX(1, true);
Serial1.begin(115200, SERIAL_8N1);
...and then I got confused when I measured 3.3V on the TX1 pin.
Swapping the function calls the other way around, however, makes the pin open drain (measured 0V) as expected. Looks like begin() overwrites the open drain status.
Seems like a bug to me, or am I understanding something wrong?
Also, is there any realistic chance to get an option to initialize the RX pin without its internal pull-up, or would that be too big a change for a rare(?) use case?
I was thinking something like an optional parameter in setRX() or something. Currently the easiest way for me to do that seems to be commenting out "| IOMUXC_PAD_PKE | IOMUXC_PAD_PUE" in HardwareSerial.cpp.
My (maybe a bit unconventional) use case is interfacing a slightly lower voltage (2.8V) UART device that has pull-ups for both TX and RX already.
I was setting up open drain UART on Teensy 4.1.
Function description of setTX(pin,opendrain) mentions it "may be called before begin(baud)"
so I thought I should set the same default pin first to open drain and use it like this:
Serial1.setTX(1, true);
Serial1.begin(115200, SERIAL_8N1);
...and then I got confused when I measured 3.3V on the TX1 pin.
Swapping the function calls the other way around, however, makes the pin open drain (measured 0V) as expected. Looks like begin() overwrites the open drain status.
Seems like a bug to me, or am I understanding something wrong?
Also, is there any realistic chance to get an option to initialize the RX pin without its internal pull-up, or would that be too big a change for a rare(?) use case?
I was thinking something like an optional parameter in setRX() or something. Currently the easiest way for me to do that seems to be commenting out "| IOMUXC_PAD_PKE | IOMUXC_PAD_PUE" in HardwareSerial.cpp.
My (maybe a bit unconventional) use case is interfacing a slightly lower voltage (2.8V) UART device that has pull-ups for both TX and RX already.