??? 09/09/09 13:46 Read: times |
#168822 - Don't Have Book But General Principles... Responding to: ???'s previous message |
I don't have that book so I'm sorry if my reply is not 100% relevant. However, the principles for SPI peripheral use (not setup-that's specific to hardware & your design) are the same across all microcontrollers, with slight variances.
1. Hardware in the "master", if the feature is provided, activates the /SS line upon starting a messaging sequence. Optionally sometimes you can choose to do the same thing manually in software. Not hard. 2. The "accumulator" is probably not a good term to use-that implies an CPU register. The SPI register is a shift register, referred to a a "receiver regiser" or "receive buffer", etc. The answer is "maybe, it depends". When/if you receive useful data is dependent upon the slave you selected. For example, the SPI slave's data sheet will show after which number of clock pulses data will be shifted out, if applicable, depending on the command sent from the master. So you will know after how many bytes are sent you will begin receiving data you want. When clocking out data from the master, data bits are always clocked in regardless. However if the slave is not sending valid data yet the receive buffer will have 0xFF or similar, which you have to be aware of and discard. 3. Often the receive register must be read from, even if the data is not used, to clear receive flags and enable continued data reception, etc., even if you don't need the data at the time. Or at least it is in some cases (depends on the hardware design). |
Topic | Author | Date |
SPI communication (question from page 263) | 01/01/70 00:00 | |
Don't Have Book But General Principles... | 01/01/70 00:00 | |
those were the days![]() | 01/01/70 00:00 |