Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

SPI question: how does the slave know the start of Byte?

Status
Not open for further replies.

saudrehman

Member level 1
Joined
Dec 20, 2005
Messages
40
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
1,697
spi running clock

If a microcontroller only needs to talk to 1 SPI peripheral, the CS pin on that slave may be grounded
But how does the slave know where the commands start and stop i.e. how does the slave know the start of Byte
 

Re: Basic SPI question

G'day saudrehman,

The SPI protocol has an enable data and clock line.
If you only have one slave on the bus and hold the cs low you only need a data and clock line.

The basic answer to your question is when the master is not sending out data it will not strobe the clock line and the slave will therefore not grab data off the bus. So as long as the master sends out complete comands the slave should stay in sync.

It is actually a little more complicated than that, with the clock and data lines being held in different states between commands depending on the SPI mode, but you should not really need to know about any of that.

Darren J.
 

Basic SPI question

Hi,

I would like to make one point clear here: spi clock is NOT a free running clock. It will be clocked only when there is valid data. So, the start of the byte can always be captured with the start of the clock.
I hope it clarifies it.

Regards,
Naren
 

Re: Basic SPI question

I have been working on a scheme in which i am monitoring the SPI Data communication happening between an SPI Master and a Slave ,using basically a microcontroller with two SPI ports (one for monitoring each SI and SO).
I have configured both the SPI ports of my Board in slave mode with the same clock phase and polarity as the communication to be monitored connecting the SI and SO to SI's of my board.
But sometimes i get incorrect data,
Is my scheme incorrect?
i donot connect the slave select and SO pins of my board at all.
are they required to be connected?
 

Basic SPI question

SPI Flash memories are using CS as command strobe line.
 

Re: Basic SPI question

saudrehman said:
I have been working on a scheme in which i am monitoring the SPI Data communication happening between an SPI Master and a Slave ,using basically a microcontroller with two SPI ports (one for monitoring each SI and SO).
I have configured both the SPI ports of my Board in slave mode with the same clock phase and polarity as the communication to be monitored connecting the SI and SO to SI's of my board.
But sometimes i get incorrect data,
Is my scheme incorrect?
i donot connect the slave select and SO pins of my board at all.
are they required to be connected?

Till you understand a problem, don't take short cuts. If you don't have SO connected then how to you expect it to work, and you probably need CS for almost everything except shift registers.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top