u/KaYaK_88

Schematic

Hi. I'm creating a STM32 based Motor Control Board that utilizes multiple peripheral boards with magnetic encoders and LEDs.

The DC power cables for the motors are connected via a JST-PH connector and all control signals for the LEDs and the SPI-Bus are on a seperate JST-ZH connector.

Each external board features 2 motors, 2 magnetic SPI encoders and 8 WS2812B LEDs.

So my Pin-Out is 5V, 3V3, SPI_SCK, SPI_MISO, CS1, CS2, LED_CTRL, GND.

I've noticed the occational bit-error in the MSB on my MISO line. Flipping only from 1 to 0.

I've implemented a fix in my firmware, where angle jumps with a certain magnitude are simply ignored. But I'd like to fix my BUS as well.

Since my cable runs are abour 20-30cm I've decided on buffering both signals with voltage translation ICs. You could do the same with an AND-Gate or similar of course. My thought was to translate my logic levels to 5V and eliminating the need for a 3V3 supply on my motor PCBs. The encoders are also 5V compatible.

My question is: Is this the best approach? I've layed out all the components and this a lot of additional hardware I need. Can anyone think of a better solution? Keeping hand-soldering in mind. I do have a reflow gun, but I'm not that comfortable with very small footprints.

I'd like to keep all encoders on one SPI Bus, but I could split it further.

On the control PCB, I'm running with 50Ohm impedance controlled traces for the SPI lines with additional series resistance on the controller (0 Ohm for now - but I can increase it of course should ringing arise).

Both SCK and MISO would then run along my Headers and feed into the SOT23-5 Logic Level shifters.

Architecture

reddit.com
u/KaYaK_88 — 16 days ago