From 6652b6812299a713aa2d0545eb7fcc86c7df7d93 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 26 Jul 2011 00:27:12 +0000 Subject: renamed cpu to mpu at docs some improvments and fixes at doc/protocols git-svn-id: https://svn.spreadspace.org/mur.sat@61 7de4ea59-55d0-425e-a1af-a3118ea81d4c --- doc/protocols/ground-crx.txt | 14 ++-- doc/protocols/ihu-cpu.txt | 173 ------------------------------------------ doc/protocols/ihu-mpu.txt | 175 +++++++++++++++++++++++++++++++++++++++++++ doc/protocols/ihu-ttx.txt | 31 +++++--- doc/protocols/ttx-down.txt | 29 +++---- 5 files changed, 219 insertions(+), 203 deletions(-) delete mode 100644 doc/protocols/ihu-cpu.txt create mode 100644 doc/protocols/ihu-mpu.txt (limited to 'doc/protocols') diff --git a/doc/protocols/ground-crx.txt b/doc/protocols/ground-crx.txt index 08b87fb..e89733a 100644 --- a/doc/protocols/ground-crx.txt +++ b/doc/protocols/ground-crx.txt @@ -5,10 +5,10 @@ Protocol Definition between Ground Stations and Command RX Introduction ------------ -using DTMF on FM -receiver should be activated for min. 200ms every 5s to listen for new commands -signs get scrambled using a secret Code Table -every command must be aknowledge by a beacon with the unscrambled code +- using DTMF on FM +- receiver should be activated for min. 200ms every 5s to listen for new commands +- signs get scrambled using a secret Code Table +- every command must be aknowledged by a beacon with the unscrambled code Frame ----- @@ -18,7 +18,7 @@ Frame Checksum: --------- -Xor over Signs intrepreted as HEX (0-9A-D#*) +XOR over Signs intrepreted as HEX (0-9A-D#*) -> (0-9A-F) Codes: ------ @@ -26,8 +26,8 @@ Codes: 0 .. shut up (rfkill) 1 .. unshut up (no rfkill) -8 .. activate payload reciever +8 .. activate payload receiver C .. cancel all commands # .. reset -* .. safe mode +* .. safe mode (stop all activties and harvest energy) diff --git a/doc/protocols/ihu-cpu.txt b/doc/protocols/ihu-cpu.txt deleted file mode 100644 index 90678ff..0000000 --- a/doc/protocols/ihu-cpu.txt +++ /dev/null @@ -1,173 +0,0 @@ -Protocol Definition between IHU and CPU -======================================= - - -Introduction ------------- - -The two controllers use SPI to communicate with each other. In -addition to the 4 Lines needed for SPI there are 2 extra connections -between IHU and CPU. One is for the IHU to reset the CPU. Holding -this pin low prevents the CPU from running and therefore keeps -power consumption at a minimum, after a low to high transition the CPU -has to perform a hardware reset. -The second line is used by the CPU to inform the IHU that it wishes -to communicate. After this line goes high the IHU has to start the -communication by starting the SPI clock. - - -Frames ------- - -The following chart shows a single frame which is used for communication - -Field-length: 1 1 1 LEN 1 - +------+------+------+--------------+------+ -Name | 0xAA | MSG | LEN | DATA | CS | - +------+------+------+--------------+------+ - -Every message frame starts with 0xAA followed by a message code and -the length of the following DATA field. The length field might be zero -if the message doesn't need any additional data. The last byte of every -frame contains a checksum. It is calculated by XORing every variable byte -of the message. In a message N bytes long, where Byte 1 is the first and Byte -N the last Byte, CS is calculated starting with Byte 1 (0xAA) and ending -with Byte N-1 (last DATA Byte) -The minimum frame length is 4 Bytes and the maximum is 260 Bytes. -The bytes have to be sent LSB first. Multi byte fields have to be sent -in Little-Endian format. - - -Messages --------- - -Messages are separated in request and responses. Requests use upper case -letters and replies use lower case. - - 'A' - Activate Payload receiver (IHU -> IHU) - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - This command tells the CPU to activate the payload receiver and - listen for incoming commands from ground stations. - - Expected response: 'a' - - - 'C' - Cancel active and all pending commands (IHU -> IHU) - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - This command cancels all downlinḱ commands in terms of - communication between the satellite and an ground station. - - Expected response: 'c' - - - 'F' - Finish up (IHU -> CPU) - ~~~~~~~~~~~~~~~ - - Sent by the IHU. - - This command tells the CPU that the IHU is planning to shut down - the CPU after ?? ms. The CPU has to write pending flash pages and put - payload hardware into deep sleep. After finishing everything up the CPU - has to go into power down. - This command doesn't send any data. - - Expected response: 'f' - - - 'P' - Ping, Time and Power Budget (IHU -> CPU) - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - This command is sent by the IHU every minute (??) and contains the - following data: - - 2Bytes Power Budget (see Power Management for details) - 4Bytes Timestamp (seconds since EPOCH) - - Expected response: 'p' - - - 'T' - Get Time (CPU -> IHU) - ~~~~~~~~~~~~~~ - - This command requests the current time. - - Expected response: 't' - - - 'V' - Config Value update (CPU -IHU) - ~~~~~~~~~~~~~~~~~~~~~~~~~ - - Tell the IHU that the configuration values have been updated by a ground - station. - Config Values: - - Beacon Interval in seconds (1 Byte) - - - - 'a' - Ack to activate receiver (CPU -> IHU) - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Sent as an acknowledge to a received 'A' when the - receiver is enabled. - - 'c' - Ack to cancel commands (CPU -> IHU) - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Sent as an acknowledge to a received 'C' when all commands - are canceled. - - - 'f' - Ack to finish up (CPU -> IHU) - ~~~~~~~~~~~~~~~~~~~~~~ - - Sent as an acknowledge to a received 'F'. - - - 'p' - Ack to finish up (CPU -> IHU) - ~~~~~~~~~~~~~~~~~~~~~~ - - Sent as an acknowledge to a received 'P'. - - - 't' - Get Time (IHU -> CPU) - ~~~~~~~~~~~~~~ - - Sends the current Timestamp after receiving a 'T' request. - This message sends the 4 Byte Timestamp (seconds since EPOCH) - as data. - - - 'v' - Ack to config value change (IHU -> CPU) - ~~~~~~~~~~~~~~~~~~~~~~~~~ - - Sent as an acknowledge to a received 'V' when the new configuraion - is in place. - - - -Example Communication ---------------------- - -IHU sends a Ping to CPU, telling it that the current power -budget is 2424 units of power and the current time is -1305501574 seconds since epoch. The CPU acknowledges the -message. - -IHU->CPU: 0xAA 'P' 0x06 0x09 0x78 0x4d 0xd0 0x5f 0x86 0xc9 -CPU->IHU: 0xAA 'p' 0x00 0xda - - -Power Management ----------------- - -FIXME - - - -Notes ------ - -EPOCH is the arbitrary point in time where Timestamp is 0x00000000. -(depending on choice of RTC, probably 1970-01-01 00:00) diff --git a/doc/protocols/ihu-mpu.txt b/doc/protocols/ihu-mpu.txt new file mode 100644 index 0000000..9a25432 --- /dev/null +++ b/doc/protocols/ihu-mpu.txt @@ -0,0 +1,175 @@ +Protocol Definition between IHU and MPU +======================================= + + +Introduction +------------ + +The two controllers use SPI to communicate with each other. In +addition to the 4 Lines needed for SPI there are 3 extra connections +between IHU and MPU. One is for the IHU to control the power of the MPU. +Holding this pin low prevents the MPU from running and therefore keeps +power consumption at a minimum also the whole payload electronic connected +to the MPU has to be in powerdown when this PIN goes low. The second line +is for reset. After a high to low transition the MPU has to perform a +hardware reset. This also resets any payload hardware. +The third line is used by the MPU to inform the IHU that it wishes +to communicate. After this line goes high the IHU has to start the +communication by starting the SPI clock. + + +Frames +------ + +The following chart shows a single frame which is used for communication + +Field-length: 1 1 1 LEN 1 + +------+------+------+--------------+------+ +Name | 0xAA | MSG | LEN | DATA | CS | + +------+------+------+--------------+------+ + +Every message frame starts with 0xAA followed by a message code and +the length of the following DATA field. The length field might be zero +if the message doesn't need any additional data. The last byte of every +frame contains a checksum. It is calculated by XORing every variable byte +of the message. In a message N bytes long, where Byte 1 is the first and Byte +N the last Byte, CS is calculated starting with Byte 1 (0xAA) and ending +with Byte N-1 (last DATA Byte) +The minimum frame length is 4 Bytes and the maximum is 260 Bytes. +The bytes have to be sent LSB first. Multi byte fields have to be sent +in Little-Endian format. + + +Messages +-------- + +Messages are separated in request and responses. Requests use upper case +letters and replies use lower case. + + 'A' - Activate Payload receiver (IHU -> IHU) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + This command tells the MPU to activate the payload receiver and + listen for incoming commands from ground stations. + + Expected response: 'a' + + + 'C' - Cancel active and all pending commands (IHU -> IHU) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + This command cancels all downlinḱ commands in terms of + communication between the satellite and an ground station. + + Expected response: 'c' + + + 'F' - Finish up (IHU -> MPU) + ~~~~~~~~~~~~~~~ + + Sent by the IHU. + + This command tells the MPU that the IHU is planning to shut down + the MPU after ?? ms. The MPU has to write pending flash pages and put + payload hardware into deep sleep. After finishing everything up the MPU + has to go into power down. + This command doesn't send any data. + + Expected response: 'f' + + + 'P' - Ping, Time and Power Budget (IHU -> MPU) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + This command is sent by the IHU every minute (??) and contains the + following data: + + 2Bytes Power Budget (see Power Management for details) + 4Bytes Timestamp (seconds since EPOCH) + + Expected response: 'p' + + + 'T' - Get Time (MPU -> IHU) + ~~~~~~~~~~~~~~ + + This command requests the current time. + + Expected response: 't' + + + 'V' - Config Value update (MPU -IHU) + ~~~~~~~~~~~~~~~~~~~~~~~~~ + + Tell the IHU that the configuration values have been updated by a ground + station. + Config Values: + - Beacon Interval in seconds (1 Byte) + + + + 'a' - Ack to activate receiver (MPU -> IHU) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Sent as an acknowledge to a received 'A' when the + receiver is enabled. + + 'c' - Ack to cancel commands (MPU -> IHU) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Sent as an acknowledge to a received 'C' when all commands + are canceled. + + + 'f' - Ack to finish up (MPU -> IHU) + ~~~~~~~~~~~~~~~~~~~~~~ + + Sent as an acknowledge to a received 'F'. + + + 'p' - Ack to finish up (MPU -> IHU) + ~~~~~~~~~~~~~~~~~~~~~~ + + Sent as an acknowledge to a received 'P'. + + + 't' - Get Time (IHU -> MPU) + ~~~~~~~~~~~~~~ + + Sends the current Timestamp after receiving a 'T' request. + This message sends the 4 Byte Timestamp (seconds since EPOCH) + as data. + + + 'v' - Ack to config value change (IHU -> MPU) + ~~~~~~~~~~~~~~~~~~~~~~~~~ + + Sent as an acknowledge to a received 'V' when the new configuraion + is in place. + + + +Example Communication +--------------------- + +IHU sends a Ping to MPU, telling it that the current power +budget is 2424 units of power and the current time is +1305501574 seconds since epoch. The MPU acknowledges the +message. + +IHU->MPU: 0xAA 'P' 0x06 0x09 0x78 0x4d 0xd0 0x5f 0x86 0xc9 +MPU->IHU: 0xAA 'p' 0x00 0xda + + +Power Management +---------------- + +FIXME + + + +Notes +----- + +EPOCH is the arbitrary point in time where Timestamp is 0x00000000. +(depending on choice of RTC, probably 1970-01-01 00:00) diff --git a/doc/protocols/ihu-ttx.txt b/doc/protocols/ihu-ttx.txt index e5ff572..9eb46e9 100644 --- a/doc/protocols/ihu-ttx.txt +++ b/doc/protocols/ihu-ttx.txt @@ -6,13 +6,15 @@ Bitstream --------- IHU and TTX communicate using a simple serial synchronous bus (SDA,SCL). -The IHU is the master and drives the clock. On idle the SCL and SDA are both -at logic 0. When the IHU want's to communicate it has to generate a wakeup pulse -with a minimun length of 1µs. After this it has to wait at least 3ms for the TTX -to wake up and switch to a higher oscillator frequency. The data is transferred -MSB first in groups of 8bits (1 Octet). SDA must be stable before the clock goes -high. A Clock pulse must be at least 4µs long and the data has to stay valid for -at least 17µs. After each octet there must be a break of 50µs. +The IHU is the master and drives the clock. On idle SCL is at logic 0 and SDA +should be tristate to save power. When the IHU want's to communicate it has to +generate a wakeup pulse with a minimun length of 1µs. After this it has to wait +at least 3ms for the TTX to wake up and switch to a higher oscillator frequency. +The data is transferred MSB first in groups of 8bits (1 Octet). SDA must be +stable before the clock goes high. A Clock pulse must be at least 4µs long and +the data has to stay valid for at least 17µs. After each octet there must be a +break of 50µs. + | wake up | 1st octet | break | 2nd octet _________________ _________________ @@ -29,9 +31,9 @@ Frames ------ Every frame starts with 4 bit command code and a 4 bit length field. After this follow -len octets of data. When all the data has been transferred the master (IHU) switches +LEN octets of data. When all the data has been transferred the master (IHU) switches SDA to input and clocks in on byte as acknowledge. The aknowledge is a one byte XOR -checksum over all octets (including the command/len octet). +checksum over all octets (including the CMD/LEN octet). Field-length: 1 LEN 1 +---------+----------------+--------+ @@ -45,7 +47,7 @@ Commands ~~~~~~~ This tells the TTX to shut up. The TTX will send out one aknowledge over cw and after - that disables any further broadcasts. (Safe mode) + that disables any further broadcasts. Hex '1' ~~~~~~~ @@ -78,6 +80,15 @@ Commands so that the next beacon will follow after the normal beacon period. This command has no data. + Hex 'D' + ~~~~~~~ + + This command sends the latest telemetry values to the TTX. This values will be used + in the very next beacon and until new values get transmitted. In case of a power fail + these values will be reset by the IHU so the TTY doesn't have to store this values in + non volatile memory. + The contents and length of the data field are to be defined. + Hex 'F' ~~~~~~~ diff --git a/doc/protocols/ttx-down.txt b/doc/protocols/ttx-down.txt index bc06d4f..81ede35 100644 --- a/doc/protocols/ttx-down.txt +++ b/doc/protocols/ttx-down.txt @@ -5,9 +5,10 @@ Protocol Definition for TTX Beacon to Ground Stations Introduction ------------ -using CW on FSK -transceiver should send a beacon about every 60s -transceiver sends a aknowledge frame if requested +- using CW on FSK +- transceiver should send a beacon about every 60s +- transceiver sends a aknowledge frame if requested +- parity Signs (Char Table) ------------------ @@ -26,30 +27,32 @@ Base32 Coded Signs | 0 1 2 3 4 5 6 7 8 9 A B C D E F ------------------------------------- 00 | A B C D E F G H I J K L M N O P -10 | Q R S T U V W X Y Z 0 1 2 3 4 5 +10 | Q R S T U V W X Y Z 2 3 4 5 6 7 Beacon Frame: ------------- -CALLSIGN (4 Signs) .. the satellites call sign (i.e. OE0M) -CNT (3 Signs) .. beacon counter -STATE (1 Sign) .. Base32 coded bitfield -CMDQLEN (1 Sign) .. Number of commands in queue (Base32) +'N' (1 Sign) .. Start Character (-.) +CALLSIGN (4 Signs) .. the satellites call sign (i.e. OE0M) +CNT (3 Signs) .. beacon counter (Base32) +STATE (1 Sign) .. Base32 coded bitfield +CMDQLEN (1 Sign) .. Number of commands in queue (Base32) ... tba -CHECKSUM (1 Sign) .. Parity Sign +CHECKSUM (1 Sign) .. Parity Sign Bitfields ~~~~~~~~~ - + STATE: - LSB RX_STATE .. Payload Receiver State (0 = OFF, 1 = ON) + LSB RX_STATE .. Payload Receiver State (0 = OFF, 1 = ON) ... tba MSB Aknowledge Frame ---------------- -'A' (1 Sign) .. Preamble for Aknowledgments -CRXCODE (1 Sign) .. unscrambled command code from CRX +'A' (1 Sign) .. Start Character (.-) +CRXCODE (1 Sign) .. unscrambled command code from CRX +CHECKSUM (1 Sign) .. Parity Sign -- cgit v1.2.3