Abraham is the SD logging board. It receives framed telemetry over I2C, validates and reassembles fixed 98-byte packets, then writes raw packets to SD while logging operational events to a text log.
- Listens for framed I2C traffic and queues frames from ISR context.
- Accepts only SD-destination frames (header bit0).
- Validates payload checksum and start/continuation ordering.
- Reassembles exactly 98 bytes, then appends packet to binary log file.
- Writes diagnostic entries to rolling text log.
Wire.onReceive ISR
|
v
Frame queue (size 8)
|
v
processI2CFrame:
- header length check
- destination SD filter
- checksum verify
- packet assembly state machine
|
v
on 98 bytes complete -> writeTelemetryPacket() -> current-data.bin
+
appendLog() -> current-log.txt
| Item | Value |
|---|---|
| Telemetry packet size | 98 bytes |
| I2C max frame size | 32 bytes |
| I2C header size | 2 bytes |
| I2C payload per frame | up to 30 bytes |
| Packet assembly timeout | 1000 ms |
| Frame queue size | 8 |
| SD destination flag | byte0 bit0 |
| Start flag | byte0 bit7 |
| Checksum byte | byte1 (sum of payload bytes) |
At boot:
- Existing
current-log.txtandcurrent-data.binare rotated to numbered archive names when possible. - Fresh
current-log.txtandcurrent-data.binare created. - Runtime status entries are appended to the log.
During operation:
- Valid packet writes append exactly 98 bytes to
current-data.bin. - Invalid conditions (checksum failure, overflow, timeout, short frame, queue overflow) are counted and logged.
| Condition | Action |
|---|---|
| Frame shorter than header | Drop frame and discard partial packet |
| Destination bit0 not set | Ignore frame |
| Checksum mismatch | Increment checksum failure counter and discard partial |
| Continuation without active packet | Drop continuation |
| Buffer overflow risk | Discard partial packet |
| Timeout before 98 bytes | Discard partial packet |
| Queue overflow | Increment dropped frame counter and discard partial packet |
- Spencer repo includes
telemetry_packet_viewer.py, which decodes the same 98-byte packet format written by Abraham tocurrent-data.bin.
This firmware does not drive a status LED. There is no on-board blink pattern for I2C or SD activity.
This firmware does not call Serial or Serial1. Runtime diagnostics go to the SD card:
current-log.txt— human-readable timestamps (millis()), I2C/assembly errors, write results, queue overflows.current-data.bin— raw length-prefixed telemetry records (same layout asTelemetryDataon the wire).
If you add Serial1 logging on a Teensy, use a 3.3 V USB–UART adapter:
- GND — common ground with the Teensy
- Adapter RX → Teensy TX1 (pin 1)
- Adapter TX → Teensy RX1 (pin 0)
Use 115200 baud unless you change it in code. Do not use 5 V TTL on Teensy pins.
Abraham listens as I2C slave 0x09 and only accepts frames with the SD destination bit set (header byte 0 bit 0). See AbrahamBoardCode.ino for framing constants.