-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathprotocols.txt
62 lines (52 loc) · 2.8 KB
/
protocols.txt
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
SPI-Protocol
============
SPI is a synchronous serial protocol, therefore on every cycle a bit is transmitted. If the Master sends an octet, the Slave will also send an octet.
In this project commands and responses have 3 octets each:
Master -> Slave: $ff CMD PAR $FF $FF
Slave -> Master: XXX $AA STA STB RES
XXX: Undefined
$FF: All bits set
$AA: Hex AA can be used to detect ATMega
CMD: Command octet
$02: write octet into buffer towards terminal
PAR: octet to be written to terminal
RES: number of free octets in write buffer or $ff for error
$03: read from Terminal
RES: received octet or $ff in case of error
STB: number of bits in buffer or $ff if nothing there
$04: set tone
PAR=$01: silent (level 0, this is not the idle between octets)
PAR=$02: 425 Hz (used during connection)
PAR=$03: 1300 Hz (used during connection)
PAR=$04: switch to data mode
$05: set LED
Bits 0-1: Number of the LED
Bits 2-7: State of the LED in each one of the 6 phases
$06: get free octets of buffer to terminal
STA: Status A
Bit 7: Octet to be read from terminal
Bit 6: Free space in buffer to terminal
Bit 5: More than 8 octets free in buffer
Bit 4: S input 1=> Terminal wants to dial
Bit 0: always on
STB: Status B: depends on command
DBT-03 Protocol
================
1. Terminal legt S auf 5V
2. Modem legt 425 Hz auf ED (ca 1s)
3. Modem legt ED auf 5V (ca 2s)
4. Modem legt ED auf 425 Hz (ca 0.5s)
5. Modem legt ED auf 5V (ca 0.5s)
6. Modem legt ED auf 1300 Hz (ca 0.5s)
7. Modem legt ED auf Daten 1=>0V 0=>5V
8. Terminal legt Daten auf SD: 1=>5V 0=>0V
Somit ist der Idlezustand der Datenphase ED auf 0V (=>1). Die Daten müssen mit 1200bps 8N1 übertragen werden.
SD enthält die Sendedaten. Hier ist der 1=>5V 0=>0V. Somit ist die Leitung im Idlezustand bei 5V.
Das Interface scheint auf Optokoppler im Modem ausgelegt zu sein. Somit sollte ED im Terminal mit einem Pull-Up ausgestattet sein, und S und SD sollten in der Lage sein ein paar Milliampere für die Sendedioden liefern können. In echten Modems wird so die Potentialfreiheit sichergestellt. Anderweitig könnten sonst gefährliche Spannungen anliegen oder zumindest Brummschleifen entstehen.
IP Protocol
============
This protocol is spoken on the IP end of things. Essentially when the Terminal starts a connection by putting S to 5V, a TCP/IP connection will be made to a server. Octets will be exchanged transparently.
Optional parts:
When a 0 octet is received via IP, the output buffer will be discarded. This allows to react quickly to user input while a page is being transmitted. This could, for example be sent before a new page is transmitted after user input.
Data units that are not supported by BTX terminals could be filtered out.
Maybe we could have a special data unit sent from the server to disconnect from that server and re-connect to a new server.