An Arduino-framework-based Teensy 4.0 software for SPARK-II rocket electronics for receivin and data logging telemetry of sensor data.
This software utilizes pseudo-asynchronous process to operate each type of operation in different phases and intervals. It also features Operational Mode, Simulation Mode (Coming soon), On-board SD Card Reading and DFU Mode (EEPROM Read/Write) via Serial command line.
There are three integers specifying the state of software:
os_state
is for controlling software operation mode. Available states are:
0
Operational State1
SD Directory listing2
Wait for User Input -> Filename3
Serial log Filename's File content for user/logger4
Delete all files at root of inserted SD Card (DANGEROUS)253
Simulation mode (Coming soon)254
DFU Mode255
End of operation
ss_state
is for controlling overall stages and phases of suboperation. Available states are:
0
Prelaunch Phase1
Ascending Phase2
At-Apogee Phase3
Deployment 1 Phase4
Deployment 2 Phase5
Final Descent Phase6
Touchdown Phase (End of operation)
dfu_state
is for controlling substates in DFU mode. Available states are:
0
DFU-off1
DFU-on from off (DFU Wait for Input)2
Serial log device_id4
Read EEPROM memory at memory index6
Write-update EEPROM memory at memory index with new value8
Clear EEPROM memory to ZERO (0) (DANGEROUS)
Commands can be written via Serial command line.
CHECK_STATE
will printos_state
,ss_state
anddfu_state
in each line.START_OP
triggers updateos_state
to0
in all conditions other than in SD Read Mode or DFU Mode (os_state
is2
or254
).READ_SD
triggers updateos_state
to1
in all conditions other than in SD Read Mode or DFU Mode (os_state
is2
or254
). AfterREAD_SD
, user can input Filename indefinitely until triggered byEND_READ
.ENTER_DFU
triggers updateos_state
to254
in all conditions other than in SD Read Mode or DFU Mode (os_state
is2
or254
).END_OP
triggers updateos_state
to255
in all conditions other than in SD Read Mode or DFU Mode (os_state
is2
or254
).END_READ
triggers updateos_state
to255
only when in SD Read Mode (os_state
is2
).SYS_ADMIN_CMD_DELETION_ALL_SD
(name to ensure no accidental deletion) deletes all files except directories in SD Card. This command must confirm again withCONFIRM_SYS_ADMIN_CMD_DELETION_ALL_SD
.SYS_CMD_REQUEST_DEVICE_ID
triggers updatedfu_state
to2
only when enabled DFU Mode (os_state
is254
anddfu_state
is not0
). The device will stay in DFU Mode (dfu_state
returns to1
). Will respong withSYS_RESPOND_DEVICE_ID_[x...]
when[x...]
is an integer device_id.READ_EEPROM
triggers updatedfu_state
to4
only when enabled DFU Mode (os_state
is254
anddfu_state
is not0
). AfterREAD_EEPROM
, user can input Memory index once. The device will stay in DFU Mode (dfu_state
returns to1
).WRITE_EEPROM
triggers updatedfu_state
to6
only when enabled DFU Mode (os_state
is254
anddfu_state
is not0
). AfterWRITE_EEPROM
, user can input Memory Index and then Value to write. If Memory Index or Value is blank,dfu_state
returns to1
. If Value is only written if and only if not already existed in Memory Index. This operation DOES NOT CHECK whether the EEPROM Memory Index or Value is available. The device will stay in DFU Mode (dfu_state
returns to1
).SYS_ADMIN_CMD_CLEAR_EEPROM
(name to ensure no accidental deletion) triggers updatedfu_state
to4
only when enabled DFU Mode (os_state
is254
anddfu_state
is not0
). The device will stay in DFU Mode (dfu_state
returns to1
). This command must confirm again withCONFIRM_SYS_ADMIN_CMD_CLEAR_EEPROM
.EXIT_DFU
triggers updatedfu_state
to0
andos_state
to0
only when enabled DFU Mode (os_state
is254
anddfu_state
is not0
).