SC32442B RISC MICROPROCESSOR
SPI
22-3
SPI OPERATION
Using the SPI interface, SC32442B can send/receive 8-bit data simultaneously with an external device. A serial
clock line is synchronized with the two data lines for shifting and sampling of the information. When the SPI is the
master, transmission frequency can be controlled by setting the appropriate bit in SPPREn register. You can
modify its frequency to adjust the baud rate data register value. When the SPI is a slave, other master supplies the
clock. When the programmer writes byte data to SPTDATn register, SPI transmit/receive operation will start
simultaneously. In some cases, nSS should be activated before writing byte data to SPTDATn.
PROGRAMMING PROCEDURE
When a byte data is written into the SPTDATn register, SPI starts to transmit if ENSCK and MSTR of SPCONn
register are set. You can use a typical programming procedure to operate an SPI card.
To program the SPI modules, follow these basic steps:
1. Set Baud Rate Prescaler Register (SPPREn).
2. Set SPCONn to configure properly the SPI module.
3. Write data 0xFF to SPTDATn 10 times in order to initialize MMC or SD card.
4. Set a GPIO pin, which acts as nSS, low to activate the MMC or SD card.
5. Tx data
→
Check the status of Transfer Ready flag (REDY=1), and then write data to SPTDATn.
6. Rx data : SPCONn’s TAGD bit enable = Tx Auto Garbage Data mode
Î
confirm REDY to set, and then read data from Read Buffer (First 2 datas are garbages)
7. Set a GPIO pin, which acts as nSS, high to deactivate the MMC or SD card.
Содержание SC32442B54
Страница 1: ...SC32442B54 USER S MANUAL Revision 1 0 ...
Страница 43: ...PRODUCT OVERVIEW SC32442B RISC MICROPROCESSOR 1 42 NOTES ...
Страница 59: ...PROGRAMMER S MODEL SC32442B RISC MICROPROCESSOR 2 16 NOTES ...
Страница 123: ...ARM INSTRUCTION SET SC32442B RISC MICROPROCESSOR 3 64 NOTES ...
Страница 167: ...THUMB INSTRUCTION SET SC32442B RISC MICROPROCESSOR 4 44 NOTES ...
Страница 187: ...MEMORY CONTROLLER SC32442B RISC MICROPROCESSOR 5 20 NOTES ...
Страница 250: ...DMA SC32442B RISC MICROPROCESSOR 8 14 NOTES ...
Страница 308: ...PWM TIMER SC32442B RISC MICROPROCESSOR 10 20 NOTES ...
Страница 330: ...UART SC32442B RISC MICROPROCESSOR 11 22 NOTES ...
Страница 417: ...SC32442B RISC MICROPROCESSOR LCD CONTROLLER 15 45 NOTES ...
Страница 427: ...ADC AND TOUCH SCREEN INTERFACE SC32442B RISC MICROPROCESSOR 16 10 NOTES ...
Страница 511: ...BUS PRIORITIES SC32442B RISC MICROPROCESSOR 24 2 NOTES ...
Страница 562: ...K5D2G13ACM D075 Revision 1 0 December 2006 7 MCP MEMORY 2Gb 256Mb x8 NAND Flash Memory A Die ...
Страница 599: ...K5D2G13ACM D075 Revision 1 0 December 2006 44 MCP MEMORY 512Mb 16Mb x32 Mobile SDRAM C Die ...