-
Notifications
You must be signed in to change notification settings - Fork 57
External Keyboard Protocol
If a keyboard is connected to the external Interconnect Port, a serial connection is established in a peculiar way. The original keyboard comes with a DIN port and needs the Interconnect dongle to work with the MP2x00. The dongle forwards serial port 0 RXD+/-
, TXD+/-
, HandshakeIn
, and HandshakeOut
.
The keyboard sends data to the MessagePads RXD
at 10kbps, 8N1, LSB first.
When first connected, the keyboard announces itself to the Newton.
- A:
PortSel0
->L,RXD
->H,CTS
->H,DCD
->H - B: A+15us
DCD
->L - C: A+120us
CTS
->L,DTR
->H - D: C+15us
CTS
->H,DTR
->L - E: D+120us
RTS
->L - F: A+247.23ms
DCD
->H - G: A+247.31ms
RXD
sends an MNP encoded block:
0x16·0x10·0x02·0x64·0x5F·0x69·0x64·0x00
0x00·0x00·0x0C·0x6B·0x79·0x62·0x64·0x61
0x70·0x70·0x6C·0x00·0x00·0x00·0x01·0x6E
0x6F·0x66·0x6D·0x00·0x00·0x00·0x00·0x10
0x03·0xDD·0xE7
\x16\x10\x02d_id\0\0\0\x0Ckybdappl\0\0\0\x01nofm\0\0\0\0\x10\x03\xDD\xE7
- H: G+Data+18ms:
RTS
->H,DCD
->L,CTS
->L,RXD
->L(break?),PortSel0
->H - I: H+73ms:
DCD
->H(8us)->L,CTS
->H(120u)->L(15u)->H,RXD
->H,PortSel0
->L - J: I+237ms:
DCD
->H, - K: J+1us:
RXD
sends the same block again:
0x16·0x10·0x02·0x64·0x5F·0x69·0x64·0x00
0x00·0x00·0x0C·0x6B·0x79·0x62·0x64·0x61
0x70·0x70·0x6C·0x00·0x00·0x00·0x01·0x6E
0x6F·0x66·0x6D·0x00·0x00·0x00·0x00·0x10
0x03·0xDD·0xE7
\x16\x10\x02d_id\0\0\0\x0Ckybdappl\0\0\0\x01nofm\0\0\0\0\x10\x03\xDD\xE7
- L: K+88ms->L
From now on, the keyboard sends key events.
Key events are sent as single bytes. H level (5V) corresponds to logic 1, 0V is logic 0. The key code are the same as for Classic Mac keyboards. Bit 7 is set for a key-down event, bit 7 is clear for a key-up event.
Keycodes are for example 'A' = 0x01, 'S' = 0x02, 'D' = 0x03, etc. .