Serial Interface Buffer Overflow Control via Slave Busy Signal
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In serial communication protocols like SPI, slave devices often face data corruption due to the lack of control over data flow, as they are unable to prevent the master device from initiating transactions before all data is loaded into the shift register, leading to potential data loss or corruption.
Innovation Solution
The implementation of an electronic data processing device with buffers and counters that allow slave devices to indicate when they cannot accept more data, enabling the master device to re-transmit data at a later time, and featuring separate reception and transmission buffers with overflow and overread management, along with a semaphore for controlled access to these buffers.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the slave device uses high priority interrupts to prevent data corruption, then data integrity is improved, but the CPU is overwhelmed by other high priority tasks
Solution Approach 1:
The slave device monitors its own shift register status and autonomously generates the BUSY signal when full, without requiring CPU intervention. This self-service mechanism allows the slave to control data flow independently, preventing corruption while freeing the CPU for other tasks.
Solution Approach 2:
The slave device provides feedback to the master device through the BUSY signal, which is generated based on the actual status of the shift register. This feedback loop allows the master to pause transmission when the slave is full, ensuring data integrity without continuous CPU monitoring.
2Device complexity
If the slave device has no control over data flow, then the protocol is simple, but data corruption occurs when the shift register is not updated in time
Solution Approach 1:
The slave device autonomously monitors its shift register status and generates the BUSY signal when full, providing self-service control over data flow. This adds minimal complexity while significantly improving reliability by preventing data corruption.
Solution Approach 2:
The BUSY signal acts as an intermediary mechanism between the slave and master devices. It mediates the data flow control, allowing the master to pause transmission when the slave is full, thus preventing corruption without requiring complex protocol changes.
3Loss of information
If the slave device sends a rejection message to indicate it cannot accept data, then data loss is prevented, but the master device must implement re-transmission logic
Solution Approach 1:
The slave device provides feedback to the master through the BUSY signal, which directly indicates when the shift register is full. This simple feedback mechanism prevents data loss by allowing the master to pause transmission, and the re-transmission logic is straightforward compared to complex rejection handling systems.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
An electronic data processing device comprises: a processor (1); a serial interface comprising a connection for incoming data (16) and a connection for outgoing data (18); a hardware serial-interface controller (6) for controlling the serial interface; and a reception buffer (22) for receiving incoming data. The processor is arranged automatically to read data written to the reception buffer. The device is arranged so that the processor can indicate to the serial interface controller that it is unable to accept data. The controller is arranged to respond to incoming data by sending a rejection message from the outgoing serial connection and to prevent incoming data from being placed in the reception buffer.