summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorChristian Pointner <equinox@mur.at>2011-05-10 22:50:22 +0000
committerChristian Pointner <equinox@mur.at>2011-05-10 22:50:22 +0000
commitafae77620563164d1d32ab18a62a1beab0bfcbf5 (patch)
tree238ecab0b361e5e27f062b1280ebe29ebb743243 /doc
parentadded xro to AUTHORS (diff)
added ihu-cpu protocol defs
git-svn-id: https://svn.spreadspace.org/mur.sat@19 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'doc')
-rw-r--r--doc/protocols/ihu-cpu.txt93
1 files changed, 93 insertions, 0 deletions
diff --git a/doc/protocols/ihu-cpu.txt b/doc/protocols/ihu-cpu.txt
new file mode 100644
index 0000000..47fc55f
--- /dev/null
+++ b/doc/protocols/ihu-cpu.txt
@@ -0,0 +1,93 @@
+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 also prevents the CPU from running and therefore keeps
+power consumption at a minimum.
+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
+
+Fieldlength: 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. 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 byte of the message.
+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 seperated in request and responses. Requests use upper case
+letters and replies use lower case.
+
+ '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. This command doesn't send any data.
+
+ Expected response: 'f'
+
+
+ 'P' - Ping, Time and Power Budget (IHU -> CPU)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Thic 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'
+
+
+
+ 'f' - Ack to finish up (CPU -> IHU)
+ ~~~~~~~~~~~~~~~~~~~~~~
+
+ Sent as an aknowledge to a preceding 'F'.
+
+
+ 'p' - Ack to finish up (CPU -> IHU)
+ ~~~~~~~~~~~~~~~~~~~~~~
+
+ Sent as an aknowledge to a preceding 'P'.
+
+
+ 't' - Get Time (IHU -> CPU)
+ ~~~~~~~~~~~~~~
+
+ Sends the current timestamp after a preceding 'T' request.
+ This message sends the 4 Byte timestamp (seconds since EPOCH)
+ as data.