ARM Subsystem – STM32F103C8T6 Communication Protocol
This project implements a custom communication protocol between two STM32 microcontrollers. The protocol uses GPIO lines, buttons, LEDs, and control signals for synchronized data transfer, all orchestrated by a timer-driven finite state machine (FSM). The system runs on an STM32F103C8T6 development board and was built in STM32CubeIDE using the STM32 HAL libraries.
This project implements the following features:
- Custom communication protocol between STM32 microcontrollers.
- Utilizes GPIO for data transfer and control signals.
- Timer-driven finite state machine (FSM) for synchronization.
-
Clone the repository:
git clone https://github.com/AMihneaa/ARM-Subsystem
-
Open with STM32CubeIDE
- File → Open Project from File System → point to folder
-
Build & Flash
- Compile project and flash via ST-Link or USB bootloader
- STM32F103C8T6 (Blue Pill)
- LEDs, buttons, and jumper wires (see GPIO assignments in code)
- Second MCU (optional, for testing communication)
FSM logic is driven by the variable Q. Each 10 ms, depending on GPIO input states (START, DAT, MOD, PREG), the FSM moves to a new state. Here's the high-level behavior:
- Waits for START or DAT button press
- Updates status LEDs accordingly
- Waits for START to follow
- Configure data pins as output
- Setup control lines
- Move to transmission state
- Waits for DAT to follow
- MOD = 1 → Go to Read
- MOD = 0 → Go to Write
- CLK = input, ACK = output
- Transition to actual data sending
- CLK = output, ACK = input
- Set data pins as input
- Sends 2-bit command via GPIO (CDA0/CDA1)
- Synchronizes with ACK pin from receiver
- Sends 4-bit data through DATA0-DATA3
- Sync with ACK
- Receives 4-bit data from GPIO
- Uses CLK to sample
- ACKs back to sender
Each state updates LEDs to reflect system state and transitions automatically based on GPIO signals and conditions.
This project is licensed under the MIT License. See the LICENSE file for details.
- Implement external interrupts for event-driven transitions (EXTI_Init stub already exists)
- Add debouncing on buttons
- Expand protocol to handle more bits or multi-byte transfers
- Add UART debug logging