Programming & Connectors
This guide provides detailed information about programming the Multiflexmeter 3.7.0 board and explains all external connectors.
Programming Requirements
Section titled “Programming Requirements”Required Hardware
Section titled “Required Hardware”To program the Multiflexmeter 3.7.0, you need:
- Atmel-ICE (or compatible AVR ISP programmer)
- USBasp
- AVR Dragon
- Arduino as ISP
- 6-pin ISP cable (2x3 connector, 2.54mm pitch)
- Power source (battery or external 3.3V supply)
Programming Connection
Section titled “Programming Connection”Connect your programmer to the J5 - ICSP Header on the board.
J5 - ICSP/ISP Programming Header
Section titled “J5 - ICSP/ISP Programming Header”Location: Main board
Type: 2x3 pin header (male, 2.54mm pitch)
Purpose: In-System Programming for firmware upload
Pinout Diagram
Section titled “Pinout Diagram” ┌─────────────┐ │ 1 MISO VCC 2 │ │ 3 SCK GND 4 │ │ 5 RST MOSI 6 │ └─────────────┘Pin Assignments
Section titled “Pin Assignments”| Pin | Signal | Direction | Description |
|---|---|---|---|
| 1 | MISO | ← | Master In Slave Out (data from MCU to programmer) |
| 2 | VCC | → | +3.3V power (can power board from programmer) |
| 3 | SCK | → | Serial Clock (programming clock signal) |
| 4 | GND | - | Ground reference |
| 5 | RESET | → | MCU Reset (active low, pulled high on board) |
| 6 | MOSI | → | Master Out Slave In (data from programmer to MCU) |
Connection to Atmel-ICE
Section titled “Connection to Atmel-ICE”The Atmel-ICE uses a standard 6-pin AVR ISP cable. Connect as follows:
Atmel-ICE J5 Header========= =========Pin 1 (MISO) ───── Pin 1 (MISO)Pin 2 (VCC) ───── Pin 2 (VCC)Pin 3 (SCK) ───── Pin 3 (SCK)Pin 4 (MOSI) ───── Pin 6 (MOSI)Pin 5 (RST) ───── Pin 5 (RST)Pin 6 (GND) ───── Pin 4 (GND)J4 - FTDI Debug Connector
Section titled “J4 - FTDI Debug Connector”Location: Main board
Type: 1x6 pin header (female socket, 2.54mm pitch)
Purpose: Serial UART debugging and monitoring
Pinout
Section titled “Pinout”| Pin | Signal | Description |
|---|---|---|
| 1 | NC | No connection |
| 2 | TXD | UART Transmit from MCU (AVR_TX0) |
| 3 | RXD | UART Receive to MCU (AVR_RX0) |
| 4 | NC | No connection |
| 5 | NC | No connection |
| 6 | GND | Ground |
FTDI Adapter Connection
Section titled “FTDI Adapter Connection”Connect a standard FTDI USB-to-Serial adapter:
FTDI Adapter J4 Header============ =========GND ────────────── Pin 6 (GND)TXD ────────────── Pin 3 (RXD) ← Cross connectionRXD ────────────── Pin 2 (TXD) ← Cross connectionVCC ────────────── Leave disconnectedSerial Settings:
- Baud Rate: 115200
- Data Bits: 8
- Parity: None
- Stop Bits: 1
- Flow Control: None
J3 - SMBus/I²C Connector
Section titled “J3 - SMBus/I²C Connector”Location: Main board
Type: 2x3 pin header (male, 2.54mm pitch)
Purpose: External I²C/SMBus device connection
Pinout
Section titled “Pinout” ┌─────────────┐ │ 1 SCL VCC 2 │ │ 3 SDA VCC 4 │ │ 5 ALERT SCL 6 │ └─────────────┘| Pin | Signal | Description |
|---|---|---|
| 1 | SCL | I²C Clock line |
| 2 | VCC | +3.3V Power output |
| 3 | SDA | I²C Data line |
| 4 | VCC | +3.3V Power output (duplicate) |
| 5 | SMBALERT | SMBus Alert signal (optional) |
| 6 | SCL | I²C Clock line (duplicate) |
I²C Specifications:
- Bus Speed: 80kHz (configured in firmware)
- Pull-up Resistors: Onboard 4.7kΩ
- Default Sensor Address:
0x36
J1 & J2 - Module Connectors
Section titled “J1 & J2 - Module Connectors”Location: Main board
Purpose: Sensor module expansion slots
J1 - Module Left (1x3 socket)
Section titled “J1 - Module Left (1x3 socket)”| Pin | Signal | Description |
|---|---|---|
| 1 | SCL | I²C Clock |
| 2 | SDA | I²C Data |
| 3 | SMBALERT | SMBus Alert |
J2 - Module Right (1x3 socket)
Section titled “J2 - Module Right (1x3 socket)”| Pin | Signal | Description |
|---|---|---|
| 1 | VCC | +3.3V Power |
| 2 | SDA | I²C Data |
| 3 | SCL | I²C Clock |
Programming Workflow
Section titled “Programming Workflow”Step 1: Hardware Setup
Section titled “Step 1: Hardware Setup”- Connect Atmel-ICE to your computer via USB
- Connect the 6-pin ISP cable from Atmel-ICE to J5 on the board
- Verify cable orientation (Pin 1 to Pin 1)
- Power the board if not powering from programmer
Step 2: Configure Programmer
Section titled “Step 2: Configure Programmer”Set your programmer to 3.3V target voltage:
# Atmel-ICE automatically detects voltage from target board# Verify with:pio run -t upload --verboseStep 3: Upload Firmware
Section titled “Step 3: Upload Firmware”Using PlatformIO:
# Build and uploadpio run -t upload
# Upload only (if already built)pio run -t upload --target nobuildUsing AVRdude directly:
avrdude -p m1284p -c atmelice_isp -P usb -B 0.25 \ -U flash:w:.pio/build/mfm_v3_m1284p/firmware.hex:iStep 4: Program Fuses (First Time Only)
Section titled “Step 4: Program Fuses (First Time Only)”avrdude -p m1284p -c atmelice_isp -P usb \ -U lfuse:w:0xFF:m \ -U hfuse:w:0xD1:m \ -U efuse:w:0xFF:mFuse Settings Explained:
- LFUSE (0xFF): External crystal oscillator, no clock divide
- HFUSE (0xD1): EEPROM preserved on chip erase, 2.7V brownout
- EFUSE (0xFF): Brown-out detection enabled
Step 5: Verify Programming
Section titled “Step 5: Verify Programming”Connect FTDI adapter to J4 and open serial monitor:
pio device monitorYou should see:
Build at: Oct 25 2025 00:13:00Initializing...EV_JOININGTroubleshooting
Section titled “Troubleshooting”Programming Issues
Section titled “Programming Issues”Problem: avrdude: initialization failed, rc=-1
Solution:
- Check cable connections at J5
- Verify programmer voltage is set to 3.3V
- Ensure board is powered
- Try slower programming speed:
-B 2.0
Problem: avrdude: Expected signature for ATmega1284P is XX XX XX
Solution:
- Wrong chip selected - verify
-p m1284pin command - Check if board uses ATmega1284P (not 328P)
- Verify oscillator is running (fuse settings)
Problem: Device not responding after fuse programming
Solution:
- Fuses may have disabled external oscillator
- Requires high-voltage parallel programmer to recover
- Contact board manufacturer for recovery service
Serial Debug Issues
Section titled “Serial Debug Issues”Problem: No output on serial monitor
Solution:
- Verify FTDI connections (TX ↔ RX are crossed)
- Check baud rate is set to 115200
- Confirm firmware was compiled with debug output enabled
- Verify GND connection between FTDI and board
Problem: Garbage characters on serial monitor
Solution:
- Wrong baud rate - set to 115200
- Check that board crystal is 16MHz as expected
- Verify FTDI adapter is 3.3V compatible
Next Steps
Section titled “Next Steps”- Pin Mappings - Complete GPIO assignments
- Hardware Specifications - Board technical details
- Quick Start - Initial setup guide
- Development Guide - Development workflow