• Home
  • QUESTIONS & ANSWERS
  • Integrated Circuits (ICs)
  • How to handle data transfer when SPI is set to host?

    * Question

    How to handle data transfer when SPI is set to host?


    *
    Answer

    1 Set the SPCCR register to get the corresponding SPI clock.

    2 Set the SPCR register to control the SPI as the host.

    3 Control the chip select signal and select the slave.

    4 The data to be sent is written to the SPDR register, which initiates the SPI data transfer.

    5 Read the SPSR register and wait for the SPIF bit.


    COMMENTS

    WORDPRESS: 0
    DISQUS: 0