3

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.

  • And TTT logic is? – Fizz Nov 12 '15 at 17:02
  • Transistor to Transistor –  Nov 12 '15 at 17:07
  • 1
    You mean [TTL](https://en.wikipedia.org/wiki/Transistor–transistor_logic)? None of the chips you indicate are such. They're all CMOS as far as I can tell. – Fizz Nov 12 '15 at 17:07
  • CS-A and CS-G should have pull-ups to disable SDO while the MCU is reset (actually BMI055 has them integrated). Pull-up or pull-down resistors on SDI, SDO and SCK are a good practice although not critical in this case. Diodes on SDOs are wrong, use series resistors (e.g. 220 \$\Omega\$) instead (to protect outputs from short circuit in case of accidentally setting both CS# low). – venny Nov 12 '15 at 18:01
  • @venny is there any reliable way to calculate the value that these should be? –  Nov 12 '15 at 18:21
  • @venny disagree, you should let the MCU set the SCK idle via the SPI configuration so only weak pullups should be used (you can have idle high SCK and idle low SCK on the same bus) mainly as a precautionary measure in case of misconfigured pins or for boot up. – crasic Nov 12 '15 at 18:49
  • @crasic weak meaning weak pull or weak resistance? –  Nov 12 '15 at 19:04
  • As per the answer. SPI is push pull, either the slave or cpu will fight against the pull up/down (i.e. source or supply more current than is necessary to set the line). If you want a default line state for power up/error handling use a higher value resistance (weak pull). Ballpark 10-100k – crasic Nov 12 '15 at 21:57
  • 1
    Which I saw you did. You have weak pull ups. They aren't strictly necessary except perhaps CS. Just keep that in mind when prototyping – crasic Nov 12 '15 at 21:58

1 Answers1

6

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)
Arsenal
  • 17,464
  • 1
  • 32
  • 59
  • In response to the vddio, i thought that that was an output pin via an internal regulator? –  Nov 12 '15 at 18:25
  • I took your advice. is this better? http://i.imgur.com/tkrQ2dn.png –  Nov 12 '15 at 19:45
  • 2
    @tuskiomi " VDDIO is a separate power supply pin mainly used for the supply of the interface" So you have to supply a voltage to it, and you have to use decoupling capacitors like the one I mentioned in my answer. Your new schematic is better, but doesn't contain my advice on pulling the chip selects and clock high. If you pull the chip select low, it will be active, so currently you will enable both SPI interfaces of the BMI055 at the same time until your MCU starts - you certainly don't want to do that. – Arsenal Nov 12 '15 at 21:54
  • I improved on it a bit more, and took your advice. here is the new schematic: http://i.imgur.com/aqhFB1E.png –  Nov 13 '15 at 00:23
  • 2
    @tuskiomi That is looking better, but still not optimal. For further improvements there is [this](http://electronics.stackexchange.com/questions/28251/rules-and-guidelines-for-drawing-good-schematics) and [this](http://electronics.stackexchange.com/questions/26308/industry-practices-for-schematic-design) question already, with some very nice answers on how to improve schematics. – Arsenal Nov 13 '15 at 18:50