8SPI1 30
Copyright © 2018, www. bluetrum.com. All Rights Reserved
30
6. Set SPIIE ‘1’ if needed
7. Write data to SPIBUF to kick-start the process
8. Wait for SPIPND to change to ‘1’, or wait for interrupt
9. Read received data from SPIBUF if needed
10. Go to Step 8 to start another process if needed or turn off SPI1by clearing SPIIE and SPIEN
SPI Normal multi-bit-Mode Operation Flow:
1. Set data bus width(bus 2) and select the pin map
2. Select RXSEL for Transmit or receive
3. Configure clock frequency
4. Select one of the four timing mode
5. Enable SPI module by setting SPIEN ‘1’
6. Set SPIIE ‘1’ if needed
7. Write data to SPIBUF to kick-start the process
8. If data bus width are 2 bit, write SPIBUF twice kick-start the transmission
9. However, when receive data, only need write once to kick-start receive process
10. Wait for SPIPND to change to ‘1’, or wait for interrupt
11. Read received data from SPIBUF if needed
12. Go to Step 8 to start another process if needed or turn off SPI by clearing SPIIE and SPIEN
SPI1 DMA Mode Operation Flow:
1. Set IO in the correct direction and data width mode.
2. Select RXSEL for DMA direction
3. Configure clock frequency
4. Select one of the four timing modes
5. Enable SPI module by setting SPIEN to ‘1’
6. Set SPIIE ‘1’ if needed
7. configure SPI1DMAADR;
8. Write data to SPI1_DMACNT to kick-start a DMA process
9. Wait for SPIPND to change to ‘1’, or wait for interrupt
10. Go to Step 8 to start another DMA process if needed or turn off SPI1 by clearing SPI1EN