Author Topic: Trying to understand Waveshare Servo Driver with ESP32  (Read 4257 times)

0 Members and 1 Guest are viewing this topic.

Offline ZbigTopic starter

  • Frequent Contributor
  • **
  • Posts: 927
  • Country: pl
Trying to understand Waveshare Servo Driver with ESP32
« on: January 08, 2024, 08:04:16 pm »
Hi

I've got some Waveshare "smart" serial servos and matching demo/driver board for 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) schematic with 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?
 

Online oPossum

  • Super Contributor
  • ***
  • Posts: 1495
  • Country: us
  • Very dangerous - may attack at any time
Re: Trying to understand Waveshare Servo Driver with ESP32
« Reply #1 on: January 08, 2024, 08:22:01 pm »
'125 is active low OE
'126 is active high OE

The circuit uses one of each
 
The following users thanked this post: Zbig

Offline ZbigTopic starter

  • Frequent Contributor
  • **
  • Posts: 927
  • Country: pl
Re: Trying to understand Waveshare Servo Driver with ESP32
« Reply #2 on: January 08, 2024, 09:45:14 pm »
'125 is active low OE
'126 is active high OE

The circuit uses one of each

WOW, 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.
« Last Edit: January 08, 2024, 09:59:14 pm by Zbig »
 

Offline DC02

  • Newbie
  • Posts: 1
  • Country: it
Re: Trying to understand Waveshare Servo Driver with ESP32
« Reply #3 on: May 15, 2024, 02:07:35 pm »
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!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf