Trying to understand Waveshare Servo Driver with ESP32 - Page 1
Forum section: electronics / projects

author: Zbig
author_rank: Frequent Contributor
timestamp: January 08, 2024, 08:04:16 pm
content: HiI've got some Waveshare "smart"serial servosand matchingdemo/driver boardfor my project. My goal is not to use their driver board for finished project but to re-implement the serial interface part on my custom PCB. Before I do that though, I want to understand how their original implementation works and I struggle with that badly. They publish a (heavily abridged)schematicwith only the serial sending and receiving parts shown.In a nutshell, it's using UART in half-duplex, multi-drop configuration over single wire. From what I understand, they're using TX signal from the ESP32's UART (pulled-up, idle-high) to drive TXEN signal high when TX goes low (i.e. active/transmitting a bit). TXEN in turn drives OE input of the top SN74LVC1G high, effectively passing TX to DATA and thus actively driving the bus during transmission pulse. So far so good.What I don't understand is how the receiving part works. The second SN74LVC1G (the bottom one on the schematic) has its OE input also tied to TXEN which, in my understanding, makes its output go from HI-Z to actively repeating what it sees on the bus (DATA) during the same TX pulse to the ESP32's RX line. No matter how hard I try to understand it, I end up with nonsensical situation where the ESP32's UART receives echo of its own transmissions repeated on its RX and sits with its RX pulled high (TXEN low, so "bottom" driver's Y output is tristated), oblivious to external transmissions when servos drive the bus. I have checked and TXEN doesn't seem to be connected to any of the ESP32's GPIOs so it seems it's only driven "automatically" when the micro is driving TX line. I was almost convinced there's an error in the schematic and the "receiving" driver's OE input is actually driven by ~TXEN or TX which would make more sense to me but nope: it really is wired like in the schematic. And the sample programs actually work, i.e. the board seems to be receiving data being sent by servos properly. How is that possible? What dumb mistake am I making trying to understand this circuit?

author: oPossum
author_rank: Super Contributor
timestamp: January 08, 2024, 08:22:01 pm
content: '125 is active low OE'126 is active high OEThe circuit uses one of each

author: Zbig
author_rank: Frequent Contributor
timestamp: January 08, 2024, 09:45:14 pm
content: Quote from: oPossum on January 08, 2024, 08:22:01 pmWOW, you're right, I missed that! Thanks! But why introduce another BOM item when TXEN is just inverted TX? Just for the sake of more descriptive signal names? Oh well, I guess we'll never know. The important thing is I'm not (that) crazy after all, just not very observant.Edited to add:Or to avoid possible glitches due to different propagation delays; just occurred to me.

author: DC02
author_rank: Newbie
timestamp: May 15, 2024, 02:07:35 pm
content: Hi, I hope I am not disturbing you but I would like to ask if you could kindly share your experience regarding the motors in use, whether the PCB you made works well (I am making it too but I don't trust the schematic they gave too much) and if you would possibly like to send me or release here on the forum the gerber and schematic file of the PCB so that I can compare my work with yours and see if I did everything correctly.Thank you!