I have been trying to understand SPI Interrupt i.e. what does it do and why is it used ? Reading about it on the web has not helped me. Can some one please explain it in a simple terms ?
Electronic – arduino – SPI Interrupt (SPIE) in SPI control register
arduinomicrocontrollerspistm32
Related Topic
- Electronic – SPI Interrupt Handler delay in STM32F303
- Electronic – Problem initializing SPI TX interrupt in STM32F103
- Electronic – the difference between Periodic and Non-Periodic Tx/Rx FIFO in USB
- Electronic – Interrupt control in STM32
- Electrical – STM32 – HAL SPI receive interrupt not entering EXTI callback
- Electrical – STM32 Spi receive problem
Best Answer
SPIE or "SPI Interrupt Enable" is used to enable the interrupt.
(Assuming you are in Master mode) There are two ways of transferring data using SPI:
1.Polling: Here you write data in SPI's data register (SPDR) and then poll on the flag for SPI Transmission complete (SPIF).
2.Interrupt based: In this case, when you enable Interrupt for SPI, you write data in SPDR. Controller will transmit the data and will raise an interrupt when transmission is completed.
A question may arise that why there is interrupt for transmission but not for the reception, I am tempted to answer but It would be better if you figure that out! :-)