3.10.2 SPI Handling

This section provides an overview of the SPI timings and describes the SPI data transfer in general. The timing is independent from the SPI mode used. Each SPI mode results in the same performance. For more details about the SPI hardware, see SPI – Serial Peripheral Interface from Related Links.
Figure 3-24. SPI Timing Parameters
Table 3-13. SPI Timing Example at 500 Kbit/s
TimeTiming at 40% Interrupt Load(1) DescriptionDepends OnExample
T00 or 25 µsTime from NSS LOW to AVR active (in case AVR sleep mode is enabled)AVR sleep mode (0 µs, 1 µs or 25 µs)25 µs
T1 17.6 µs Time from AVR active to beginning of first telegram byteInternal IRQ (falling edge)45 CPU cycles (ISR) + 15 CPU cycles interrupt response time
T216 µsTime to shift in one SPI-byte with SCKSCK frequency (maximum 500 kHz)8 bit/500 Kbit/s
T3Pause between two bytes. Can be any length including 0 µsExternal microcontroller timing0 µs
T435.1 µsTime for ATA8210/15 to handle last byteDepends on SPI command usedMaximum 120 CPU cycles(2)
T5 16.1 µs SPI idle time telegram Internal data processing 40 CPU cycles (ISR) + 15 CPU cycles interrupt response time
Note:
  1. Timing calculation done with AVR core of 5.7 MHz
  2. Needed for SPI command, Read RX FIFO and Read RSSI FIFO
Table 3-14. CPU Cycles for T4
Read Fill Level RX FIFO0Get Version ROM0
Get Version Flash0
Read Fill Level RSSI FIFO0Customer Configurable CommandXX
Get Event Bytes0System Reset0
Read RSSI FIFO120Trigger EEPROM Secure Write65
Read RX FIFO120Set Voltage Monitor85
Write SRAM Register110OFF Command0
Read SRAM Register120Read Temperature Value0
Write EEPROM55Init SRAM Service50
Read EEPROM0Start RSSI Measurement55
Get RSSI Value0
Read RX FIFO Byte Interrupt70
Set System Mode55Read RSSI FIFO Byte Interrupt70
Calibrate and Check50
Patch SPIXX

SPI Data Transfer Description

After NSS is set to LOW by the external microcontroller, the internal AVR core needs 25 µs to wake up from the configured AVR Sleep mode. If the FRC is kept alive by setting the FRC always-on (FRCAO) EEPROM bit in the clock configuration, the time is reduced to 1 µs. If the system never enters any of the available sleep modes, omit the T0. The falling edge of the NSS line triggers an internal interrupt. This interrupt resets and initializes the software state machine responsible for handling SPI communication. During the interrupt service routing, two event bytes (events.system and events.events) are written to the FIFO SPI output to provide early access to the event status. For this reason, finish the interrupt service routine before the transmission of the first telegram byte starts (T1).

After the communication setup is done (T0 + T1), the system is ready to receive the first byte of data. Data bytes can be written continuously or with a pause (T3) between the bytes. The maximum SCK frequency is 500 kHz, resulting in a maximum data rate of 500 Kbit/s.

The SPI communication is finished by setting NSS back to a logical HIGH level. A certain time, T4, must elapse after transmission of the last byte before allowing the NSS to return to HIGH level. T5 is required to internally process the end of the SPI transfer before receiving the next SPI command.