273 lines
9.9 KiB
Markdown
273 lines
9.9 KiB
Markdown
|
||
# TurboCobalt
|
||
|
||
> **High-Performance Desktop Multi-Tool for Software Developers**
|
||
|
||
📘 **Project Specifications**
|
||
|
||
**Version:** 1.0
|
||
**Core System:** STM32G491 (Arm Cortex-M4F @ 170MHz)
|
||
**Operating System:** FreeRTOS
|
||
**Development Status:** Design Phase
|
||
**Target Market:** Professional Software Development Tools
|
||
|
||
## Table of Contents
|
||
|
||
- [1. Concept Overview](#1-concept-overview)
|
||
- [2. System Architecture](#2-system-architecture)
|
||
- [3. Component Selection & Rationale](#3-component-selection--rationale)
|
||
- [4. Bill of Materials (BOM)](#4-bill-of-materials-bom)
|
||
- [5. Hardware Architecture](#5-hardware-architecture)
|
||
- [6. Software Architecture (FreeRTOS Tasks)](#6-software-architecture-freertos-tasks)
|
||
- [7. Operational Modes](#7-operational-modes)
|
||
- [8. System Data Flow Summary](#8-system-data-flow-summary)
|
||
- [9. Technical Specifications](#9-technical-specifications)
|
||
|
||
---
|
||
|
||
## 💡 1. Concept Overview
|
||
|
||
TurboCobalt is a high-end desktop multi-tool designed for software developers. It merges retro-analog aesthetics with modern digital power to provide:
|
||
|
||
- **Analog Monitoring:** PC resource tracking (CPU/RAM) via physical galvanometers
|
||
- **Audio Synthesis:** 2 channel sound engine via I2S protocol
|
||
- **Interactive Interface:** Graphical LCD and rotary encoder for system navigation
|
||
- **Industrial Gateway:** USB bridge to fieldbus protocols (CAN-FD, Modbus/RS485)
|
||
|
||
### Key Design Principles
|
||
|
||
- **Real-Time Performance:** FreeRTOS ensures deterministic response times
|
||
- **Professional Grade:** Industrial-standard communication protocols
|
||
- **Developer Focused:** Productivity tools integrated into hardware
|
||
- **Extensible Architecture:** Modular design for future enhancements
|
||
|
||
---
|
||
|
||
## 🏗️ 2. System Architecture
|
||
|
||
```mermaid
|
||
graph TB
|
||
PC[PC/Host Computer] --> USB[USB-C]
|
||
USB --> MCU[STM32G491<br/>ARM Cortex-M4F]
|
||
|
||
subgraph MEM ["Memory Subsystem"]
|
||
EEPROM[24LC512<br/>64KB EEPROM]
|
||
PSRAM[APS1604M<br/>16MB PSRAM]
|
||
RTC[DS3231<br/>RTC + Battery]
|
||
end
|
||
|
||
subgraph ANALOG ["Analog Monitoring"]
|
||
PWM1[PWM + Filter] --> GAL1[CPU Meter<br/>SO-45]
|
||
PWM2[PWM + Filter] --> GAL2[RAM Meter<br/>SO-45]
|
||
end
|
||
|
||
subgraph AUDIO ["Audio Chain"]
|
||
I2S[I2S Interface] --> DAC[PCM5102<br/>Audio DAC] --> OUT[🎵 Audio Out]
|
||
end
|
||
|
||
subgraph UI ["User Interface"]
|
||
LCD[128x64 Display<br/>NHD-C12864LZ]
|
||
ENC[Rotary Encoder<br/>+ Button]
|
||
end
|
||
|
||
subgraph FIELDBUS ["Industrial I/O"]
|
||
CAN_TX[TJA1050] --> CAN_BUS[CAN-FD Bus]
|
||
RS485_TX[MAX485] --> MODBUS[Modbus RS485]
|
||
end
|
||
|
||
subgraph PWR ["Power"]
|
||
POWER[USB 5V] --> LDO[3.3V Regulator]
|
||
end
|
||
|
||
MCU -.-> MEM
|
||
MCU --> ANALOG
|
||
MCU --> AUDIO
|
||
MCU --> UI
|
||
MCU --> FIELDBUS
|
||
LDO --> MCU
|
||
```
|
||
|
||
---
|
||
|
||
## 🔧 3. Component Selection & Rationale
|
||
|
||
### Primary MCU: STM32G491
|
||
|
||
**Selection Criteria Met:**
|
||
- **Performance:** 170MHz ARM Cortex-M4F with DSP instructions
|
||
- **Audio Processing:** Hardware CORDIC accelerator for real-time synthesis
|
||
- **Connectivity:** Integrated CAN-FD controller eliminates external chips
|
||
- **Memory:** 128KB SRAM sufficient for FreeRTOS + audio buffers
|
||
- **Package:** LQFP-80 provides adequate I/O for all peripherals
|
||
|
||
**Key Advantages:**
|
||
- Mathematical accelerator reduces CPU load for audio algorithms
|
||
- Advanced timer units enable precise PWM generation for galvanometers
|
||
- Fast ADC enables potential future analog input expansion
|
||
|
||
### Memory Subsystem
|
||
|
||
| Component | Part Number | Capacity | Interface | Purpose | Rationale |
|
||
|-----------|-------------|----------|-----------|----------|-----------|
|
||
| EEPROM | 24LC512 | 64KB | I2C | Config Storage | Non-volatile, reliable for settings |
|
||
| PSRAM | APS1604M | 16MB | SPI/QPI | Audio Buffer & Samples | Premium capacity, 144MHz, future-proof |
|
||
|
||
### 📊 **PSRAM Capacity Analysis**
|
||
|
||
**Calculated Requirements:**
|
||
- **Audio Buffers (48kHz, 24-bit, 2ch):** ~200KB (multiple buffers + safety margin)
|
||
- **Sample Storage:** ~10-15MB (extensive soundbanks, high-quality samples, user recordings)
|
||
- **Communication Buffers:** ~50KB (USB, CAN-FD, Modbus queues)
|
||
- **UI Graphics Buffer:** ~50KB (advanced display cache, animations, menus)
|
||
- **System Overhead:** ~200KB (FreeRTOS heap extension)
|
||
|
||
**<EFBFBD> Selected: APS1604M 16MB PSRAM**
|
||
- **Studio-Grade Capacity:** 1000+ high-quality samples (24-bit, 48kHz)
|
||
- **Multi-Project Storage:** Multiple soundbanks and user configurations
|
||
- **Advanced Features:** Real-time convolution, complex synthesis algorithms
|
||
- **Recording Capability:** Store user recordings directly to PSRAM
|
||
- **Performance:** 144MHz clock - fastest available option
|
||
- **Future-Proof:** Extensive room for firmware expansion
|
||
|
||
### Audio Chain
|
||
|
||
**DAC Selection: PCM5102**
|
||
- 24-bit resolution, 192kHz sampling rate
|
||
- I2S interface directly compatible with STM32
|
||
- Low THD+N: 0.0008% typical
|
||
- Self-clocking eliminates need for external crystal
|
||
|
||
### Analog Indicators
|
||
|
||
**Galvanometer Choice: SO-45 Series**
|
||
- Vintage aesthetic with modern reliability
|
||
- Fast response time (<200ms full scale)
|
||
- Linear voltage-to-deflection characteristics
|
||
- Standard 0-5V input range matches PWM filtering
|
||
|
||
---
|
||
|
||
## 🛠️ 4. Bill of Materials (BOM)
|
||
|
||
### Core Components
|
||
|
||
| Category | Component | Part Number | Specs | Rationale |
|
||
|----------|-----------|-------------|-------|------------|
|
||
| **MCU** | Microcontroller | STM32G491RET6 | 170MHz ARM-M4F, 512KB Flash | CORDIC accelerator + CAN-FD integrated |
|
||
| **Memory** | PSRAM | APS1604M-3SQR | 16MB, 144MHz SPI/QPI | Premium audio capacity + performance |
|
||
| **Memory** | EEPROM | 24LC512-I/P | 64KB I2C | Non-volatile config storage |
|
||
| **RTC** | Real-Time Clock | DS3231SN | ±2ppm, I2C, Battery backup | Precision timekeeping |
|
||
| **Audio** | DAC | PCM5102A | 24-bit, 192kHz I2S | Studio-grade audio quality |
|
||
| **Display** | LCD | NHD-C12864LZ | 128x64, SPI | Professional readability |
|
||
| **Analog** | Galvanometer (x2) | SO-45 | 0-5V, <200ms response | Vintage aesthetic + reliability |
|
||
| **CAN** | Transceiver | TJA1050T | CAN-FD compatible | Industrial fieldbus standard |
|
||
| **RS485** | Transceiver | MAX485CSA | Full-duplex RS485 | Modbus communication |
|
||
|
||
### Technology Choices Summary
|
||
|
||
**🎯 Key Design Decisions:**
|
||
- **STM32G491:** Best-in-class for audio (CORDIC) + industrial connectivity (CAN-FD)
|
||
- **16MB PSRAM:** Premium capacity enabling studio-grade sample storage
|
||
- **PCM5102:** Professional DAC with excellent THD+N performance
|
||
- **SO-45 Galvanometers:** Authentic retro aesthetic with modern reliability
|
||
- **I2S Audio Chain:** Eliminates noise, ensures digital precision to DAC
|
||
- **SPI/QPI Memory:** High-speed access for real-time audio processing
|
||
|
||
---
|
||
|
||
## ⚡ 5. Hardware Architecture
|
||
|
||
### 🖥️ Processing & Memory
|
||
|
||
- **MCU:** STM32G491 (High-performance, CORDIC math accelerator for audio, integrated FDCAN)
|
||
- **EEPROM (I2C):** 24LC512 (64 KB) for presets, logs, and persistent configuration storage
|
||
- **PSRAM (SPI/QPI):** APS1604M (16MB) for extensive audio sample storage and real-time processing
|
||
- **RTC:** DS3231 for precise alarm and clock functions
|
||
|
||
### 🔌 Connectivity & I/O
|
||
|
||
- **USB:** Main USB-C interface supporting Composite Device Classes: CDC (Data) and HID (Keyboard/Control)
|
||
- **Audio:** I2S bus connected to an external DAC (e.g., PCM5102)
|
||
- **Display:** Newhaven NHD-C12864LZ (128x64 pixels) via high-speed SPI
|
||
- **Indicators:** 2x SO-45 Galvanometers driven by filtered PWM (Pulse Width Modulation) outputs
|
||
|
||
### Fieldbus Ports
|
||
|
||
- **CAN-FD Port:** Dedicated connector via TJA1050 (or equivalent) transceiver
|
||
- **RS485/Modbus Port:** Dedicated connector via MAX485 (or equivalent) transceiver
|
||
|
||
---
|
||
|
||
## 💻 6. Software Architecture (FreeRTOS Tasks)
|
||
|
||
The FreeRTOS implementation ensures low-latency audio processing and responsive UI handling by isolating critical tasks.
|
||
|
||
| Task Name | Priority | Description |
|
||
|-----------|----------|-------------|
|
||
| Task_Audio | 1 (Critical) | Signal synthesis and I2S DMA buffer management |
|
||
| Task_USB_Comm | 2 (High) | USB stack management, receiving PC stats and HID commands |
|
||
| Task_Gateway | 3 (Medium) | Packet routing between USB and CAN/Modbus interfaces |
|
||
| Task_UI | 4 (Medium) | NHD display refresh and rotary encoder debouncing/logic |
|
||
| Task_Sensors | 5 (Low) | Periodic RTC, Temperature, and EEPROM housekeeping |
|
||
|
||
---
|
||
|
||
## ⚙️ 7. Operational Modes
|
||
|
||
- **Studio Mode:** Operates as a standalone synthesizer or MIDI controller
|
||
- **Monitor Mode:** Visualizes real-time dev-machine performance (CPU/RAM load)
|
||
- **Gateway Mode:** Acts as a transparent bridge between the PC and industrial buses (CAN/Modbus)
|
||
- **Dev-Tool Mode:** Physical password vault (HID injection) and Pomodoro productivity timer
|
||
|
||
---
|
||
|
||
## 🔄 8. System Data Flow Summary
|
||
|
||
### Primary Data Paths
|
||
|
||
- **PC → USB:** Streams CPU/RAM utilization data to the MCU
|
||
- **STM32 → PWM:** Maps data to voltage levels to move the SO-45 needles
|
||
- **STM32 → I2S:** Outputs real-time generated waveforms to the audio DAC
|
||
- **External Bus ↔ STM32 ↔ USB:** Bi-directional data transit for CAN/Modbus debugging
|
||
|
||
### Performance Metrics
|
||
|
||
- **USB Latency:** <1ms for HID commands
|
||
- **Audio Latency:** <5ms buffer (configurable)
|
||
- **Galvanometer Update Rate:** 60Hz
|
||
- **Display Refresh Rate:** 30Hz
|
||
- **CAN/Modbus Throughput:** Up to 1Mbps (CAN-FD), 115.2kbps (RS485)
|
||
|
||
---
|
||
|
||
## 📋 9. Technical Specifications
|
||
|
||
### Power Requirements
|
||
|
||
- **Input:** USB-C 5V, 500mA maximum
|
||
- **Consumption:**
|
||
- Idle: ~150mA @ 5V
|
||
- Active Audio: ~300mA @ 5V
|
||
- Peak (All peripherals): ~450mA @ 5V
|
||
|
||
### Environmental Specifications
|
||
|
||
- **Operating Temperature:** 0°C to +70°C
|
||
- **Storage Temperature:** -40°C to +85°C
|
||
- **Humidity:** 10-90% RH, non-condensing
|
||
- **Dimensions:** TBD (Desktop form factor)
|
||
|
||
### Compliance & Standards
|
||
|
||
- **USB:** USB 2.0 Full Speed compliant
|
||
- **CAN:** ISO 11898-1 (CAN-FD)
|
||
- **RS485:** TIA/EIA-485-A
|
||
- **EMC:** Designed for CE marking compliance
|
||
- **Safety:** Low voltage, USB powered design
|
||
|
||
### Development Tools
|
||
|
||
- **RTOS:** FreeRTOS v10.x
|
||
- **HAL:** STM32 HAL Driver
|
||
- **Debug:** SWD interface with ST-Link
|
||
- **Version Control:** Git-based workflow |