Better SPI Bus Design in 3 Steps




Most Arduino SPI tutorials show this simple but poor SPI bus design:

 

Better SPI Bus Design in 3 Steps

A much better SPI bus design can prevent conflicts.  3 simple improvements are needed:

  1. Use pullup resistors on all chip select signals.

  2. Verify tri-state behavior on MISO: use a tri-state buffer chip if necessary.

  3. Protect bus access with SPI.beginTransaction(settings) and SPI.endTransaction().

Click “Read more” for details on these 3 steps.

Step 1: Pullup Resistors for Chip Select & Reset Signals

When multiple SPI devices are used, and especially when each is supported by its own library, pullup resistors are needed on the chip select pins.

Without a pullup resistor, the second device can “hear” and respond to the communication taking place on the first device, if that second device’s chip select pin is not pulled up.  This is easy to understand in hindsight, but it can be temendously confusing and frustrating to novice Arduino users who purchase shields or breakout boards without pullup resistors.  Each SPI device works when used alone, but they sometimes mysteriously fail when used together, only because both devices are hearing communication meant to initialize only the first device!

 

For more detail: Better SPI Bus Design in 3 Steps




READ  Using BMP180 for temperature, pressure and altitude measurements

Leave a Comment

*
= 5 + 4

(Spamcheck Enabled)

Read previous post:
ADI shrinks package size of 16-bit DACsADI shrinks package size of 16-bit DACs
ADI shrinks package size of 16-bit DACs

The AD5689R nanoDAC+™ is a dual, 16-bit, rail-to-rail, voltage output DACs. The device includes a 2.5 V, 2 ppm/°C internal...

Close
Scroll to top