atmega328p supports USART in SPI Mode, which i'm guessing is different than UART in synchronous mode.
Why would this exist if one can either use UART, USART (for UART in synchronous mode) or SPI?
atmega328p supports USART in SPI Mode, which i'm guessing is different than UART in synchronous mode.
Why would this exist if one can either use UART, USART (for UART in synchronous mode) or SPI?
atmega328p supports USART in SPI Mode
USART in SPI mode, is buffered, so can send the data a bit faster then the unbuffered SPI.
Jim
Also, if the main SPI interface is occupied, you can simultaneously transfer with the UART-based SPI. Example: SPI sensor and SPI memory interface. Read from sensor and write to memory at the same time because they are two independent buses.
Jim
Note that SPI (synchronous peripheral interface) is synchronous, uart is asynchronous (Universal Asynchronous Receiver Transmitter).
Correct.
What makes it (relatively) simple conversion in hardware is the fact that both SPI and UART are "just" shift registers. Both use clocks inside. SPI routes that clock outside (when its a master). The relationship between the UART clock and the shifted data is a bit different from the relationship between the SPI clock and its data, but the change is pretty simple and can be handled in hardware.
What the OP seems to be having a bit of difficulty with is the functionality of the peripherals. EVERY peripheral (well, maybe there is some exception) appears to the MCU as "just a bunch of registers". These registers control how that particular peripheral works. SPI is actually a pretty simple peripheral and I encourage the OP to read the SPI chapter in the device manual. Not the combined UART/SPI chapters but the chapter on the dedicated SPI interface. In that relatively short chapter, you will read how various bits in various status and control registers work with the SPI hardware. There are block diagrams that are relatively easy to comprehend without going too deeply into the hardware. Once you have been through that, the other peripherals might not be so daunting.
Also, OP, please don't assume so much about how things work. So far, your assumptions have lead you quite astray. Instead, read the device manual. For the most part, that will dispel the false assumptions and lead you in a more productive direction.
Jim
SPI (synchronous peripheral interface)
Isn't the 'S' in "SPI" for Serial ?
But, whatever, it is still Synchronous.
uart is asynchronous (Universal Asynchronous Receiver Transmitter).
But the question was about USART = Universal Synchronous / Asynchronous Receiver / Transmitter