SPI and Asyncronous Serial Connections with RedBoard Artemis ATP?

Hello. Our project uses two gimbal SparkFun 3-Phase BLDC motors with encoders Gimbal Motor with Encoder - 12V, 467RPM - SparkFun Electronics and two SparkFun 3-Phase Brushless motor-drivers. Therefore, there are two peripherals: two encoders. We have two ways to connect the peripherals to the SPI bus Serial Peripheral Interface (SPI) - SparkFun Learn :

  1. ‎each peripheral needs a separate CS line;
  2. single CS line goes to all the peripherals, in this case, the microcontroller board must have a daisy-chained shift register.

We chose to use the first way. I have the following questions:

  1. If we want to use two separate SPI connections, each connection for one encoder, can we use the SparkFun RedBoard Artemis ATP microcontroller board? Should the SparkFun RedBoard Artemis ATP have the full-up Universal Asynchronous Receiver/Transmitter in this case?
  2. Or, maybe it is enough to relate two SPI connections to two different clocks? Thank you.

You do not need two separate SPI buses. Connect both AS5048A encoders to the same SCK, MOSI and MISO lines, but give each encoder its own CS pin. Keep the inactive encoder’s CS high and read them sequentially.

UART is unrelated to SPI, so no additional UART is required. The RedBoard Artemis ATP has enough GPIO and supports multiple SPI-capable IOM peripherals, but using two independent SPI controllers would add unnecessary complexity. Simply assigning different clock pins does not create separate SPI buses.

The more important check is whether the Artemis provides enough suitable PWM outputs and timers to control both TMC6300 drivers while reserving two GPIOs for the encoder CS signals.

^ As above; each driver board will need its own CS line :slight_smile:

Thank you, Alice_Brown. How many timers do you think the RedBoard Artemis ATP should have to control both TMC6300 drivers? Thank you.

Hi TS-Russell. The motor encoder AS5048A board has three pins only. Could you please specify what pins to use for the CS line, SCK, MOSI, and MISO? That is, there should be four pins, shouldn’t? Thank you.

The wires are for PWM output. I believe it’s GND, 5V, PWM.

The SPI wires are not attached, you’ll have to solder your wires to use them. Sparkfun doesn’t appear to have a datasheet for the encoder but google will find what you are after.

Thank you, Yellowdog. I saw a device working. That device had just 4 wires for an encoder and 3 wires for a BLDC 3-Phase motor. In total just seven wires for one motor. Why does this encoder require eight SPI wires plus three PWM wires? Here is a discussion with the encoder AS5048A pins chart: Gimbal 12V motor with encoder AS5048A? - #42 by PaulZC Thank you.

It doesn’t.
You can choose PWM or SPI, you don’t need both.

Thank you, YellowDog. However, neither you nor Alice_Brown, nor TS-Russell have answered my question about the encoder AS5048A pins. The encoder has three pins only: GND, VDD5V, and PWM. Where is the pin to connect the CS line? Thank you.

You do not need CS, your driver is wired for PWM. SPI is more complex than PWM, I strongly encourage you to not use SPI.

There are multiple topics open for the same motor driver and encoder issue with relavent information spread across them all. Closing this topic to keep everything in fewer places.