??? 07/06/11 07:35 Read: times Msg Score: +2 +2 Good Answer/Helpful |
#182812 - Always important to follow up the progress of technology Responding to: ???'s previous message |
Richard Erlacher said:
BTW, I didn't spend a lot of time with the WIKI article, but did scan it to ensure it covered most of the details for Per. But I was not in need of any details about SPI since I have been using it extensively. The advantage with hw-driven SPI? That you can write a byte into a data register and then jump to other tasks while the processor generates 8 shifts and 8 clock pulses (or some controllers may be configured for anything between say 4 and 32 bits in a single operation). The traditional SPI master and slave just have a 8-bit shift register, a baudrate configuration and some configurable gates to specify flank and steady state of the clock. More "cool" SPI implementations also have a FIFO allowing a program to quickly inject a complete SPI message for a device (where some of the bits may represent a command and some of the bits may represent data for the device). Because the clocking is off-loaded, you may run the SPI at 10 kHz without having to spend 50us sleeping between every tick (or having lots and lots of interrupts every 50 us). Or you may run the SPI at 15MHz, where the processor would have to spend all its time busylooping since it's impossible to use timer interrupts. In some situations, you can also use SPI as a hardware-accelerated Dallas/Maxim one-wire controller, where you may decide that 32 SPI bits is one Maxim one-wire bit. Then you would automatically get the input from the one-wire slave sampled at 1/32 of the bit time to figure out if the slave sent back a zero or a one. Microcontrollers are part of an area where everything is constantly moving. It isn't enough to know how something worked 20 years ago. Every little aspect has to regularly been questioned for relevance. |