Domanda

I was going through an article related to SPI. There was a configuration named 'Daisy Chaining', in case of multiple slaves.

So far, what I have understood about SPI (based on wikipedia) is,

SPI can transfer and receive some data simultaneously.

My questions are,

1) In case of multiple slaves, does it mean, that it transfers data to many slaves, or it transfers data to one of the slaves, amidst a connection to many slave devices?

2) According to this link Figure 4, it is given that, the master keeps its SS low, until all the data it needs to send to the 3 slave devices is sent and then it makes the pin high. If so, what data & from which slave device, the master receives at the end?

3) As given in this link, in enhanced mode the load enable(LDEN) & WCOL is checked for moving next byte into the buffer. Why do we need to check them both? Isn't the WCOL sufficient for that?

4) It's given that, Master configures the clock - frequency less than or equal to the maximum frequency the slave device supports. Such frequencies are commonly in the range of 1–100 MHz. How does the master finds the clock frequency of the slave?

5) Does the SPSR, SPCR and SPDR registers remain in both master and slave?

6) It is given that, the SPIF flag is set after the completion of transmission. If the SPIE is also enabled, then interrupt is produced. Does the flags get set in both master and slave? Does the interrupt is produced in both master and slave?

Kindly guide me. Thanks in advance.

È stato utile?

Soluzione

1) Any combination of one or more slaves simultaneously (on rising edge of /CS).

2) Regard the combination of slaves a one big shift register. Say each of three slaves has an eight bit register, the total being 24 bits. The master will clock out 24 bits, the first 8 will be clocked into the last slave, the second 8 to the second and the last 8 to the first slave. The data in each slave is accepted when the /CS is de-asserted (rising edge), so only those slaves that had the /CS low during the clocking of data will be affected.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top