Electronic – Correct SPI Configuration

avr32schematicsspi

I'm still not entirely clear on TTL, so please, forgive my ignorance in this.

I have a sensor and a microcontroller. The sensor is a BMI055 Gyroscope and accelerometer. The microcontroller is the Atmel AT32UC3C0512CAU-ALUT. With these two, I want to connect them with a correct 4-wire SPI interface.

Here is my proposed layout:
enter image description here

pins 13-17 are as follows from the datasheet (above):

13: (Function B) SPI0 MOSI

14: (Function B) SPI0 MISO

15: (Function B) SPI0 SCK

16: (Function B) SPI0 NPCS{0} (NPCS is chip select pin)

17: (Function B) SPI0 NPCS{1}

Thing I have questions on: Am I correct in using pull-down resistors? I hear Pull-up is more common, but I'm not sure why. Another thing is how would you make this schematic prettier? it's pretty bad right now. and my final concern is the value of these resistors. I'm not sure how to calculate that.

Best Answer

SPI uses a push-pull configuration, so you don't really need the resistors.

The resistors are only there to have a defined level while the pins of the MCU are configured as an input. So in this case you can use pretty large resistors (like 100k) to reduce the additional current draw of the resistors when you are actively driving the lines.

The direction in which you pull the line depends on the idle state of the connected line. If it is idle high, you use a pull-up, if it is idle low, you use a pull-down.

So for the BMI055 it seems like pulling CSx high would be better and SCK high as well (both idle high).


You can probably remove the diodes as the SDO state is High-Z (high impedance) when not active, so you won't get a short.

You are not supplying a voltage to VDDIO.

Place 100nF caps in parallel to the ones you have on VDD and VDDIO.

Ways to improve your schematic (in my view, as with coding styles, they differ from person to person):

  • make sure there is a junction point on every point a connection is made (there are missing a some on the pull-down resistors for example)
  • place the reference symbols in the "right" direction, GND points downwards, 3V3 upwards
  • Don't place parts of your question on your schematic only
  • Where are all the arrows going?
  • Laying out the components pins the way they are in the datasheet helps a peer greatly to do a review, currently it's hard to tell if they are right (also the names should be the same or more explanatory than those in the datasheet)
  • I miss the actual pin numbers (cannot check if labels and numbers are correctly matched to each other)