Skip to content

Using I2C to bit bang UART

JJTech edited this page Feb 5, 2022 · 7 revisions

This requires that the servo be programmed to operate at 100,000 baud. Use a programmer such as my Raspberry Pi Pico script to write 0x013 to register 0x04. Cannot change baud rate on some servos, need a new plan...

Methods

Function Address Byte Data Byte(s) Total Bytes
read(1) 7 bits + 1 Only 0xFF 2
write8() 7 bits + 0 Must be in form 0b10XXXXXX, will be output as 0bXXXXXX10
If the first bit of the data byte is not 1, then it will be discarded
May also use multiple 1 bits to move the ending 10 around in the data
2

Important things to consider

  • Java will output things in big endian (i.e. MSB first), while the servo will interpret them as little endian (i.e. LSB first).
  • Address byte will be treated as regular data by the servo.

Clone this wiki locally