Skip to content

Commit b10f913

Browse files
committed
added command lis tpage
1 parent b0d511a commit b10f913

File tree

2 files changed

+93
-2
lines changed

2 files changed

+93
-2
lines changed

obc-members/command.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
---
2+
title: OBC Software Test File
3+
parent: For OBC Team Members
4+
nav_order:
5+
# permalink: "/obc/test-file"
6+
nav_exclude: false
7+
layout: default
8+
lang: en
9+
---
10+
11+
---
12+
13+
## 🛰️ Mission Command List Guide
14+
15+
This guide explains how to structure and use UART commands sent to the COM PIC, which forwards them to the Main PIC. These commands are used for simulation and control during testing. While the actual command is **14 bytes**, the simulator expects **25 bytes**.
16+
17+
---
18+
19+
### 📦 Command Packet Format
20+
21+
Each **Mission Command** consists of the following:
22+
23+
| Byte Index | Field | Description |
24+
| ---------- | --------------------- | --------------------------------------------------- |
25+
| 0 | `Header` | Always `0x42` |
26+
| 1 | `Satellite ID` | Always `0x57` |
27+
| 2 | `Reservation Time` | Set to `0x00` |
28+
| 3 | `Command ID0` | Set to `0xB4` |
29+
| 4 | `Command ID1` | Varies – defines the operation (see below) |
30+
| 5–11 | `Mission Mode / Data` | Payload (mode settings, packet numbers, etc.) |
31+
| 12–13 | `CRC` | CRC0 (LSB), CRC1 (MSB) – Checksum of first 12 bytes |
32+
| 14–24 | `Padding` (0x00) | Simulator requires 25-byte total length |
33+
34+
**Note:** During actual command transmission, only the **first 14 bytes** are used.
35+
36+
---
37+
38+
### 🔧 Commands and Usage
39+
40+
| # | Command ID1 | Description | Mission Data | Example Command |
41+
| - | ----------- | ------------------------------- | ------------ | ----------------------------------------------- |
42+
| 1 | `0x00` | **TURN OFF DP** | All `0x00` | `42 57 00 B4 00 00 00 00 00 00 00 00 CRC0 CRC1` |
43+
| 2 | `0x00` | **ACTIVATE DP** (Default Mode) | All `0x00` | `42 57 00 B4 00 00 00 00 00 00 00 00 CRC0 CRC1` |
44+
| 3 | `0x01` | **ACTIVATE SF Mode** | All `0x00` | `42 57 00 B4 01 00 00 00 00 00 00 00 CRC0 CRC1` |
45+
| 4 | `0x01` | **Transfer 1 data packet** | All `0x00` | `42 57 00 B4 01 00 00 00 00 00 00 00 CRC0 CRC1` |
46+
| 5 | `0x00` | **Transfer all packets** | All `0x00` | `42 57 00 B4 00 00 00 00 00 00 00 00 CRC0 CRC1` |
47+
| 6 | `0x00` | **Transfer N packets (custom)** | Byte 4 = N | `42 57 00 B4 NN 00 00 00 00 00 00 00 CRC0 CRC1` |
48+
49+
---
50+
51+
### 🧮 CRC Calculation
52+
53+
Use CRC-16-CCITT (or your protocol-specific CRC) on the first 12 bytes (`[0]` to `[11]`) to generate:
54+
55+
* **CRC0 (LSB)**
56+
* **CRC1 (MSB)**
57+
58+
---
59+
60+
### 💻 Sending Over UART
61+
62+
1. Construct a 14-byte array: `[0] to [13]`
63+
2. Pad with 11 zeroes if needed for simulation: `[14] to [24]`
64+
3. Transmit the 25-byte buffer over UART to COM PIC
65+
4. COM PIC routes to MAIN PIC for action
66+
67+
---
68+
69+
### 📁 Add File Download
70+
71+
To allow downloading of the `.c` file (e.g., command handler or reset script) from your website:
72+
73+
```html
74+
<a href="/files/reset_pic_command.c" download>Download Reset PIC Command Code</a>
75+
```
76+
77+
> ✅ Ensure the file `reset_pic_command.c` is stored in the correct `/files/` directory on your web server.
78+
79+
---
80+
81+
### 📘 Summary
82+
83+
* Actual command = 14 bytes (Header + Payload + CRC)
84+
* Simulated command = 25 bytes (padded with zeroes)
85+
* All commands go through COM PIC to MAIN PIC
86+
* Command ID1 and payload define the operation
87+
* CRC must be valid to accept command
88+
89+
---
90+
91+
Let me know if you want a Markdown or downloadable PDF version of this guide—or help with the actual `.c` file content.

obc-members/test-file.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ This file helps catch software logic issues before they affect the satellite har
3838
| [`test_obc_main.c`](/assets/code/test_obc_main.c) | Main test runner that initializes the OBC environment and simulates execution |
3939
| [`mock_uart.c` ](/assets/code/mock_uart.c) | Simulated UART communication layer with buffers to emulate data exchange |
4040
| [`mock_uart.h` ](/assets/code/mock_uart.h) | Simulated UART communication layer with buffers to emulate data exchange |
41-
| [`mock_flash.c` ](/assets/code/mock_flash.c) | Emulated flash memory to verify write and read operations |
42-
| [`mock_flash.h` ](/assets/code/mock_flash.h) | Emulated flash memory to verify write and read operations |
41+
| `mock_flash.c` | Emulated flash memory to verify write and read operations |
42+
| `mock_flash.h` | Emulated flash memory to verify write and read operations |
4343
| [`test_commands.c` ](/assets/code/test_commands.c) | Functions for creating and dispatching test commands |
4444
| [`test_commands.h` ](/assets/code/test_commands.h) | Functions for creating and dispatching test commands |
4545
| [`assert_utils.c` ](/assets/code/assert_utils.c) | Custom assert functions for validating results |

0 commit comments

Comments
 (0)