Microcontrollers on shelves to read RFID tags on products.
Data transmission to a central database for real-time inventory tracking.
Technical Challenge & Solution
The hardware (STM32-based) was already manufactured when it turned out that the used RFID transceiver required a non-standard SPI-like protocol. It showed different behavior during initialization and the actual reading process (e.g., changing clock edge requirements).
A classic software bit-banging worked, but blocked the MCU so much that parallel network communication was no longer stable.
”Hardware Bitbanging” via DMA & Timer
As a workaround, the communication was offloaded to the hardware peripherals:
- The protocol pattern (states of lines and time spans) was stored in memory.
- Using DMA (Direct Memory Access) and Timer Interrupts, this memory content was output directly to the GPIOs.
- This enabled bit-banging “out of the hardware”, relieving the CPU to continue processing network tasks.
Although this solution was complex and potentially error-prone due to the dependency on precise timing and DMA channels, it ultimately allowed any protocol to be mapped directly in hardware. This kept MCU resources free for critical tasks such as network communication and RTOS scheduling – a decisive advantage when the hardware is already fixed and standard peripherals can no longer be used.