STMicroelectronics AN1445 Application Note: Using the ST7 SPI to Emulate a 16-Bit Slave

Describes how to use ST7 microcontroller's 8-bit SPI to emulate a 16-bit SPI slave


STMicroelectronics AN1445 Application Note: Using the ST7 SPI to Emulate a 16-Bit Slave - cover page
Brand
STMicroelectronics
Document type
Application Note
Language
English
Pages
7
File format
PDF
File size
62 KB
Published
07 August, 2012
Updated
30 September, 2023
MD5 checksum
D4A25B38ACA8C50A8EE01EAF0A7604B4

About this manual

The document describes a method for receiving 16-bit words via the ST7 SPI cell, which utilizes double buffering with two 8-bit registers (a read register and a shift register). The hardware manages the shifting of bits while software accesses the read register to retrieve previously received data before the next byte arrives.

The note details the timing analysis required for this emulation, calculating that the maximum achievable baud rate is 2 MBaud when the internal frequency (fcpy) is 8 MHz. It provides C code examples for interrupt routines and assembly disassembly, along with measurement results confirming that the software can read data fast enough to prevent bit loss at this speed.

What's inside

  • Introduction
  • Principle of Double Buffering
  • Maximum Baud Rate Calculation
  • Interrupt Routine Implementation
  • Measurement Verification

Frequently asked questions

What is the maximum baud rate supported for emulating a 16-bit slave?

The maximum baud rate that can be reached is 2 MBaud.

How much time is needed to release the data register at 2 MBaud?

The time needed to release the data register is 4 microseconds at 2 MBaud.

Download PDF (62 KB)

More STMicroelectronics Manuals


View all STMicroelectronics manuals →