Zumo 32u4 high speed connection to Raspberry Pi

Hey guys,

i was wondering if there is any possibility to create an SPI connection to another microcontroller (e.g. Raspberry Pi) with a Zumo 32u4, as I want to recreate some robotic projects from uni, where we basically read out all the sensors from an arduino platform, send the data to a Pi (with a level shifter in between) and have our control system on there and then send the calculated values back.
I intend to connect the two platforms as it is shown in this forum post with some additional fixation:
Mount Raspberry Pi on Zumo 32U4

As i always used SPI connection in uni because of its speed compared to serial and I2C, is it possible to utilize PB1 and PB2 without interferring with the motor direction control?
Or alternatively is it equally fast if i use UART (or a combination of UART and I2C, assuming that i can directly use the I2C line on the Pi with this) if i want to update the motor directions and speeds every 20 to 50ms and basically send all the sensor data?

Cheers,
Jan

Hi, Jan.

As you have noticed, it is not very practical to use the AVR’s SPI interface on the Zumo 32U4 since the SPI pins are used for other purposes. Doing SPI communication without interfering with motor control might be possible, but it would require some careful programming (for example, by disabling the motor PWM signal while performing SPI transfers), and we don’t have any libraries or example code available for that.

For sending motor commands and sensor data at the frequencies you mentioned, I would expect UART and/or I2C to work fine. We have an example project that interfaces a Raspberry Pi with an A-Star 32U4 Robot Controller, which is similar to the Zumo 32U4, and you might find that useful if you decide to use I2C.

Kevin