Cummunicating with VESC using I2C and arduino

General topics and discussions about the VESC and its development.
MikeLemon
Posts: 7
Joined: 29 Apr 2017, 22:58
Location: none

Cummunicating with VESC using I2C and arduino

Postby MikeLemon » 14 Jul 2017, 21:55

Hello,

I'm interested to communicate with the vesc using I2C and the arduino to read RPM's battery voltage and other stuff from it as well as controlling it like how you would do with the PPM on current mode and I just wanted to ask:

Is there an arduino library to write or read from it with I2C?
if not what is the protocol for communicating with it(device addres, registers address, and stuff like that)?

pf26
Posts: 309
Joined: 28 Mar 2016, 14:37
Location: FR Valence

Re: Cummunicating with VESC using I2C and arduino

Postby pf26 » 15 Jul 2017, 07:26

You better use UART instead of I2C since there is currently no implementation of I2C communication on VESC.
UART has the same number of wires, is sligthly more reliable for relatively long wires and is fast enough for most applications.

MikeLemon
Posts: 7
Joined: 29 Apr 2017, 22:58
Location: none

Re: Cummunicating with VESC using I2C and arduino

Postby MikeLemon » 15 Jul 2017, 20:44

I'm just 2 wires short for that sins I'm using two VESCS anyways what would be the protocol to communicate with UART as well?

pf26
Posts: 309
Joined: 28 Mar 2016, 14:37
Location: FR Valence

Re: Cummunicating with VESC using I2C and arduino

Postby pf26 » 16 Jul 2017, 08:26

As said on another thread with 4 VESCs, you can connect your UART to the first (=master) VESC, and connect both VESCs using CAN bus. This way, you can command both VESCs independently via just one UART. Each VESC has to have a different ID (bldc-tools programmable), and there are 2 more bytes in the frame header to specify the target VESC.
http://vedder.se/2015/10/communicating-with-the-vesc-using-uart/


Return to “General”

Who is online

Users browsing this forum: Bing [Bot], rapedrag and 1 guest