summaryrefslogtreecommitdiff
path: root/doc/protocols/ihu-ttx.txt
blob: c91c479382b7dca5a8f9a69028361be0df196995 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
Protocol Definition between IHU and TTX
=======================================


Bitstream
---------

IHU and TTX communicate using a simple serial synchronous bus (SDA,SCL).
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.
After the last octet, which will be a checksum generated by the slave, the master 
has to generate a single bit aknowledge. A logic low on SDA during a SCL pulse
instructs the slave to process the received frame whereas a logic high tells the 
slave to discard all data and proceed with normal operation.


     | wake up |               1st octet                        | break  |  2nd octet
               _________________               _________________
SDA           |                 |             |                 |
-----------//-+                 +---------//--+                 +----//------------
      _         ____              ____          ____                      ____
SCL  | |       |    |            |    |        |    |                    |    |
-----+ +---//--+    +------------+    +---//---+    +----------------//--+    +----
     
     |  3ms    | 4�s|     13�s   |                              |  50�s  |  


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
SDA to input and clocks in on byte as acknowledge. The aknowledge is a one byte XOR
checksum over all octets (including the CMD/LEN octet). 

Field-length:    1           LEN           1
            +---------+----------------+--------+
Name        | CMD/LEN |      DATA      |   CS   |
            +---------+----------------+--------+

As stated earlier a frame has only to be processed when a positive aknowledge has been
sent by the master.

Commands
--------

 Hex '0'
 ~~~~~~~

 This tells the TTX to shut up. The TTX will send out one aknowledge over CW and after
 that disables any further broadcasts. The 1 octet of data contains the ASCII code to 
 use for the CW aknowledge.

 Hex '1'
 ~~~~~~~
 
 This is the reverse of the '0' command. The TTX will send out an aknowledge over CW
 and reenables broadcasting of beacons. The 1 octet of data contains the ASCII code to 
 use for the CW aknowledge.

 Hex '2'
 ~~~~~~~
 
 The command sets a new beacon interval. The data is one octet containing the new beacon 
 interval in seconds.

 Hex '3'
 ~~~~~~~

 This sets a new CW speed. It is followed by four octets representing the dot, dash, 
 word space and tune times.

 Hex 'A'
 ~~~~~~~ 
 
 This instructs the TTX to send out an aknowledge frame over CW. The command
 has 1 octet of data containing the ASCII Code of the aknowledge to send out.

 Hex 'B'
 ~~~~~~~

 This inscructs the TTX to send out a beacon immediately. It also resets the timer
 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 TTX 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'
 ~~~~~~~

 This transmits a new format string for the standard beacon. The data is a variable
 length string containing ASCII characters each standing for a beacon element to send
 out.