Questions tagged [spi]

SPI is a low-level 3 or 4 wire serial bus interface with clock (SCLK), data in (MISO) and data out (MOSI). The fourth wire is a Slave Select to uniquely select a device on the bus. This signal is usually active-low. Slave Select, Chip Select, CS#, SS# stand for the same function, typically. Be sure to check the datasheet, though. The SPI bus is a *de facto* standard lacking the formal specification.

Further reading:

1659 questions
121
votes
9 answers

Tradeoffs when considering SPI or I2C?

What tradeoffs should I consider when deciding to use an SPI or I2C interface? This accelerometer/gyro breakout board is available in two models, one for each interface. Would either one be easier to integrate into an Arduino…
Mark Harrison
  • 10,419
  • 27
  • 68
  • 95
55
votes
5 answers

Programming microcontrollers: JTAG, SPI, USB oh my!?

I've noticed, with regards to microcontrollers, there are several way to program them. I am sorta familiar with USB as my Arduino's can be programmed via USB. What is a JTAG or SPI interface? Ultimately I know that these interfaces provide a means…
jdiaz
  • 1,933
  • 4
  • 21
  • 20
41
votes
10 answers

SPI or I2C: which to use for a longish bus

I'm contemplating a project that would require several AVRs talking to each other over a bus. They'd be separated by as much as 6 feet. It seems like both I2C and SPI can let a series of micros communicate over a bus, but I haven't seen anything…
edebill
  • 2,509
  • 2
  • 20
  • 26
40
votes
4 answers

What's the catch with FRAM?

After recently acquiring an MSP430 Launchpad I've been playing with various microcontroller projects. Unfortunately, the MSP430G2553 only has 512 bytes of RAM, so doing anything complex requires external storage. After looking at SPI and I2C SRAM…
David Given
  • 1,173
  • 1
  • 8
  • 15
38
votes
13 answers

Software to create timing diagrams

In my professional life, I sometimes need to create timing diagrams for protocols: UART, SPI, etc. However, I can't find any good programs available. What programs can be recommended for this and what is the experience using them?
Seidleroni
  • 1,674
  • 2
  • 14
  • 19
30
votes
1 answer

MicroSD card performance deteriorates after long-term read-only usage

I'm using a STM32L432 microcontroller to read data from a microSD card via SPI. In my application, I'm playing a sound file with a length of 10 s in loop. I found out that after the application ran for approximately 20 - 25 hours, the audio stream…
Hermetica
  • 475
  • 4
  • 7
29
votes
5 answers

SPI bus termination considerations

So, in my previous question I asked about using the SPI bus over a short distance for board to board communication. I was recommended to try termination resistors. I placed a resistor close to the destination (but not exactly there, there was a…
Saad
  • 5,319
  • 12
  • 60
  • 93
26
votes
5 answers

What is dual/quad I/O?

Reading an SPI Flash datasheet, I encountered the concepts of "dual I/O" and "quad I/O". At first I thought that "dual I/O" was synonymous to "full duplex", but then what is "quad I/O"? What is dual I/O and quad I/O, and how do they compare do…
Randomblue
  • 10,953
  • 29
  • 105
  • 178
25
votes
5 answers

Is there a difference between using a built in SPI module and bit-banging?

Is there a difference between the two, or is it just a matter of abstraction? My intuition says there's no difference but I'd love to be wrong.
Skaevola
  • 251
  • 3
  • 4
25
votes
4 answers

Short Distance Board to Board Communication

My MCU runs a SPI bus with about 4 devices. I'd like to extend this bus to be off board as well i.e. have some PCBs connect to the "main" board and extend the functionality. The "pad to pad" distance would be: trace length of main board + Cable…
Saad
  • 5,319
  • 12
  • 60
  • 93
24
votes
2 answers

Alternatives to SPI because of EMI

I currently make a system consisting of a plastic enclosure which contains an MCU talking to 7 ADCs using 2MHz SPI over wires about 5cm long. The problem is that I'm concerned about EMI. Everything I have read suggests that any kind of digital…
Rocketmagnet
  • 26,933
  • 17
  • 92
  • 177
23
votes
3 answers

Do all microSD cards support SPI mode?

Have you ever encountered an SD card which does not support the SPI mode? I read microSD are not required to but I believe all do support SPI. EDIT: The information about optionality of SPI seems to come from Wikipedia and was recently removed (here…
jpc
  • 5,302
  • 1
  • 24
  • 45
21
votes
1 answer

SPI bus termination and pull-up resistors

My microcontroller (ATMEL series) needs to communicate to a slave device using SPI protocol. I am designing the hardware. The maximum SPI bus speed is 1 MHz. The distance between the master and slave is less than 50mm. Q1) Do I need to add…
Bharav
  • 722
  • 2
  • 7
  • 21
19
votes
2 answers

How should I route SPI lines?

In my schematic, I have 4 SPI devices to hook together. I am going to operate the SPI up to 8MHz. Should I be concerned with installing damping resistors? source termination resistors? Should I route them in a star formation, or in a serial fashion?…
cksa361
  • 3,814
  • 7
  • 33
  • 49
18
votes
2 answers

Is SPI safe to be interrupted?

I'm writing to a microSD card from within my firmware, but it's the lowest priority task, so it can be interrupted by other tasks while it's in the middle of reading/writing. Now suppose I communicated with this microSD card using a UART. The…
Maestro
  • 979
  • 1
  • 10
  • 24
1
2 3
99 100