espsoftwareserial
espsoftwareserial copied to clipboard
Invert software serial signal does not pulling serial pin idle low
I'm using a one wire communication on ES8266 and I have the signal on idle high. Serial data is ok but signal is not in spec. Normal HW Inverted signals are idle low. Any idea how to fix that?
Seriously, I doubt you have it all configured correctly. You haven't posted the usually required MCVE. Please make sure you are setting up the inverted mode?
SoftwareSerial(int8_t rxPin, int8_t txPin = -1, bool invert = false);
void begin(uint32_t baud, SoftwareSerialConfig config,
int8_t rxPin, int8_t txPin, bool invert,
int bufCapacity = 64, int isrBufCapacity = 0);
This issue will be closed soon due to lack of activity.
Sorry for delay. This is my begin routine.I used the serial library provided with ESP8266 core. That is also yours. Single wire serial half duplex.I checked with logic analyzer.
It is working, I receive and sent correct data(inverted signal) , but I see line idle high instead of Idle low. Inverted signal start the line with idle low and return back to low.
swSer.begin(57600, SWSERIAL_8N1,3, 3,true, 256); and send data with #ifdef SW_SERIAL swSer.flush(); swSer.enableTx(true); //for tx swSer.write((uint8_t *)TxData, (size_t) sport_count); swSer.enableTx(false);//for rx #endif
Isn't that what you would expect to happen when calling swSer.enableTx(false);
?
No, both RX and TX signals are inverted so I expect to be idle low not high.
That doesn't make sense. You are turning the pin into rx mode. The line level is driven by the peer now. If you don't want rx pullup, use void enableRxGPIOPullUp(bool on)
on supporting pins (constexpr bool hasRxGPIOPullUp(int8_t pin) const
).
Thanks!Clear.
@midelic If the issue is solved / invalid, could you please close it? Thank you.
Assuming the issue is resolved.