espsoftwareserial icon indicating copy to clipboard operation
espsoftwareserial copied to clipboard

Invert software serial signal does not pulling serial pin idle low

Open midelic opened this issue 2 years ago • 8 comments

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?

midelic avatar Jul 21 '22 00:07 midelic

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);

dok-net avatar Jul 23 '22 10:07 dok-net

This issue will be closed soon due to lack of activity.

dok-net avatar Aug 14 '22 15:08 dok-net

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

midelic avatar Oct 01 '22 17:10 midelic

Isn't that what you would expect to happen when calling swSer.enableTx(false);?

dok-net avatar Oct 02 '22 13:10 dok-net

No, both RX and TX signals are inverted so I expect to be idle low not high.

midelic avatar Oct 02 '22 21:10 midelic

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).

dok-net avatar Oct 03 '22 15:10 dok-net

Thanks!Clear.

midelic avatar Oct 04 '22 00:10 midelic

@midelic If the issue is solved / invalid, could you please close it? Thank you.

dok-net avatar Nov 15 '22 23:11 dok-net

Assuming the issue is resolved.

dok-net avatar Dec 14 '22 21:12 dok-net