Samsung YP-P10 User Manual Page 502

  • Download
  • Add to my manuals
  • Print
  • Page
    / 596
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 501
S3C2440A RISC MICROPROCESSOR SPI
22-3
SPI OPERATION
Using the SPI interface, S3C2440A 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(1): SPCONn's TAGD bit disable = normal mode
7. ¡ write 0xFF to SPTDATn, then confirm REDY to set, and then read data from Read Buffer.
8. Rx data(2): SPCONn's TAGD bit enable = Tx Auto Garbage Data mode
9. ¡ confirm REDY to set, and then read data from Read Buffer (then automatically start to transfer).
10. Set a GPIO pin, which acts as nSS, high to deactivate the MMC or SD card.
Page view 501
1 2 ... 497 498 499 500 501 502 503 504 505 506 507 ... 595 596

Comments to this Manuals

No comments