Update Pins and Peripherals authored by Adham Beshr's avatar Adham Beshr
---
title: Pins and Peripherals
---
# 🛠️ **Pins & Peripherals**
![Pins List](https://mygit.th-deg.de/ab11885/autonomous-line-following-car-with-camera-based-navigation/-/raw/main/Images/ressourcenliste_pins_v1.png?ref_type=heads)
## 📌 **Overview**
This page provides a detailed breakdown of the **pin configuration** for our **autonomous car system**. The pin list outlines the **specific microcontroller (MCU) pins** assigned to various peripherals such as **motors, sensors, communication interfaces, and input/output controls**.
The purpose of this list is to:
**Define** which MCU pins are connected to each peripheral.
**Ensure** optimal hardware functionality and avoid conflicts.
**Improve** debugging by providing a clear hardware reference.
---
## 📡 **Peripheral-to-Pin Mapping**
Below is a summary of the key **hardware peripherals** and the **corresponding pins** used:
### 🔹 **Motor Control (FTM – FlexTimer Module)**
| **Peripheral** | **Pin** | **Function** | **MCU Module** |
|--------------|--------|------------|--------------|
| **BLDC Motor** | PTC3, PTC4 | Direction Control | GPIO |
| **Servo Motor** | PTB12 | PWM Steering Signal | FTM0_CH0 |
| **H-Bridge** | PTA26, PTA27 | Motor Enable & Direction | GPIO |
### 🔹 **Sensor Inputs (ADC – Analog-to-Digital Converter)**
| **Peripheral** | **Pin** | **Function** | **MCU Module** |
|--------------|--------|------------|--------------|
| **Line Scan Camera** | ADC0_SE12, ADC0_SE13 | Track Detection | ADC0 |
| **Potentiometer** | ADC0_SE16 | Analog Input for Calibration | ADC0 |
| **Rotary Switch** | PTB10, PTB11 | Mode Selection | GPIO |
### 🔹 **Communication Interfaces**
| **Interface** | **Pin** | **Protocol** | **MCU Module** |
|--------------|--------|------------|--------------|
| **SPI for WS2812B LEDs** | PTD2, PTD3 | SPI0 | SPI0 |
| **I2C for Sensors** | PTA3 (SCL), PTA2 (SDA) | I2C0 | I2C0 |
| **UART Debugging** | PTC6, PTC7 | UART1_TX, UART1_RX | UART1 |
### 🔹 **DMA & Interrupts**
| **Feature** | **Peripheral** | **Usage** |
|------------|--------------|------------|
| **DMA (Direct Memory Access)** | Line Scan Camera | Fast image data transfer |
| **Interrupts (NVIC)** | Motor Control, UART | Real-time processing |
| **PWM (Pulse Width Modulation)** | Servo Motor | Precision steering |
---
## ⚙️ **Pin Configurations & Electrical Properties**
Each pin is configured with specific electrical properties to ensure stable operation. Key parameters include:
**Drive Strength**: Low to minimize power consumption.
**Slew Rate**: Fast for real-time responsiveness.
**Pull-Up/Pull-Down Resistors**: Ensuring correct logic levels at startup.
**Interrupts & DMA**: Optimized for high-speed signal processing.
---
## 🏆 **Why This Pinout?**
**Optimized for Performance** – Each peripheral is mapped to minimize signal delays.
**Avoids Pin Conflicts** – Ensuring smooth integration of multiple peripherals.
**Scalability** – Designed with flexibility for future expansions.
---