Low-level EMG signal processing system for robotic arm control using direct memory-mapped I/O, custom interrupt handlers, and hand-optimized assembly
A bare-metal embedded system that translates electromyographic (EMG) muscle signals into precise robotic arm movements with minimal latency.
Interrupt-driven signal processing with 1664-cycle ISR budget at 16MHz
Q15 fixed-point arithmetic throughout for consistent, FPU-free performance
Direct hardware register access with custom linker scripts
Hand-optimized assembly for tensor operations and activation functions
Surface electrodes detect muscle potentials
9.6 kHz continuous sampling
64-sample rolling average
Full-wave rectification
IIR low-pass filter (5Hz)
Servo actuation (1-2ms pulse)
Watch the neural-controlled robotic ARM in action
Kernel/
βββ main.c # Core signal processing loop
βββ peripherals.c # Register-level hardware abstraction
βββ interrupt_vector_handler.s # Custom interrupt vector table
βββ startup.s # Boot sequence & stack initialization
βββ neural_matrix_ops.s # Neural network operations
βββ real_time_scheduler.s # Real-time task scheduling
βββ syscalls.c # Minimal C runtime support
System/
βββ filter.h # Q15 fixed-point DSP filters
βββ fixed_point.h # Fixed-point arithmetic macros
βββ robot_mem_map.h # Memory-mapped I/O addresses
βββ peripherals.h # Hardware register definitions
linker/
βββ atmega328p.ld # Custom memory layout
stm32f407/
βββ src/ # STM32F407 extensions
Neural Robotic Interface Board β NRX-22: A next-gen embedded controller designed for EMG-driven robotic systems
The NRX-22 is a specialized embedded controller capable of running neural signal decoding, predictive control loops, and real-time adaptive actuation. Built for high-performance EMG processing with deterministic latency and minimal power consumption.
4Γ Memory Dies (M1βM4) with 8 sub-memory controllers each (MCU0βMCU7)
0x00000000 β 0x0FFFFFFF
0x1A000000 β 0x3FFFFFFF
0x40000000 β 0x47FFFFFF
22 auxiliary dies (A1βB22) arranged in dual-tier topology:
0x50000000 β 0x5000007C0x60000000 β 0x600000FF48 MHz quartz base with 12-stage digital synthesizer
Effective Range: Up to 3.84 GHz
8 miniature thermal diodes linked to sensor controller
Address: 0x70000000
Built-in JTAG & SWD debug ports (top row header)
512 KB for ISR profiling and DMA overflow diagnostics
The firmware kernel maps directly to hardware address spaces for optimal performance:
Runs directly on vector unit
Fast interrupt dispatch
Executes @ 1 Β΅s tick
Runtime stack frame bridging
Install the required toolchain for AVR development:
# Ubuntu/Debian
sudo apt-get install avr-gcc avr-libc avrdude
# macOS
brew install avr-gcc avrdude
# Arch Linux
sudo pacman -S avr-gcc avr-libc avrdude
Get the source code from GitHub:
git clone https://github.com/InboraStudio/Neural-Controlled-robotic-ARM-With-Kernal-.git
cd Neural-Controlled-robotic-ARM-With-Kernal-
Compile the firmware from the build directory:
cd build
make all
# Check size constraints (must fit in 32KB Flash, 2KB SRAM)
make size
Upload the compiled firmware to ATmega328P:
# Update programmer settings in Makefile if needed
# Default: arduino programmer on /dev/ttyUSB0
make flash
# For custom port (e.g., /dev/ttyACM0)
avrdude -c arduino -p m328p -P /dev/ttyACM0 -b 115200 -U flash:w:../output/emg_servo.hex:i
Demo hardware only. Not for medical use.
make all
Compile, link, generate HEX + disassembly
make flash
Program ATmega328P via AVRDUDE
make size
Display Flash/SRAM usage
make disasm
View assembly listing with symbols
make clean
Remove build artifacts
_implg_sample_count volatile counter