@@ -40,18 +40,30 @@ STM32 microcontroller with:
4040
4141## 🧪 Example Workflow
4242
43- 1 . Startup
44- 2 . Wait for trigger input (PA8 HIGH)
45- 3 . Sample 1000 accelerometer values (XYZ)
46- 4 . After sampling:
47- - Send data over UART (CSV format)
48- - Send header + chunked payload via CAN
43+ 1 . ** Boot**
44+ 2 . ** Wait** for trigger (PA8 ↑)
45+ 3 . ** Acquire** 1000 XYZ samples (1 ms cadence)
46+ 4 . ** Transmit**
47+ - UART: CSV line per sample
48+ - CAN FD: Header + chunked payload → CRC-8 terminator
49+
50+ ---
4951
5052## 💬 CAN Protocol Overview
5153
52- - ** Request:** ID 0x123, single byte 0xAB to request data
53- - ** Header:** ID 0x321, first frame = 2 bytes length (e.g. 0x27 0x11 = 10001)
54- - ** Payload:** subsequent frames with raw buffer data
54+ | Frame | CAN ID | DLC | Payload |
55+ | -------| --------| -----| ---------|
56+ | ** Request** | ` 0x123 ` | 1 | ` 0xAB ` (host → logger) |
57+ | ** Header** | ` 0x321 ` | 3 | ` LEN_H ` , ` LEN_L ` , ` CHUNK_CNT ` |
58+ | ** Payload** | ` 0x322 ` … ` 0x32F ` | up to 64 | Raw data bytes (XYZ buffer) |
59+ | ** CRC** | ` 0x330 ` | 1 | CRC-8 (XOR of ` LEN ` + payload) |
60+
61+ - ** LEN** = 2000 bytes (1000 samples × 2 bytes per axis)
62+ - ** CHUNK_CNT** = ceil(LEN / 64)
63+ - CRC is calculated after the final payload frame and sent in its own frame.
64+
65+ > * Default bitrate:* 500 kbit/s nominal.
66+
5567
5668## 📂 Folder Structure
5769
0 commit comments