====== Introduction ====== The 6850 is a serial port controller. It is used on Thomson TO9 to connect the keyboard to other parts of the system, allowing a detachable keyboard. The joystick/mouse connector is on the detachable keyboard, so it is scanned through the same serial protocol. Later machines use bit-banging on the system 6846 to implement the keyboard scan, to avoid using this chip and reduce costs. ====== Registers ====== ^Address^Name ^Description^ |E7DE|SCR/SSDR |Control (write)/Status (read)| |E7DF|STDR/SRDR|Data transmit/receive | ====== Keyboad communication protocol (TO9) ====== The communication happens at a rate of 9600 bauds. It is asynchronous, there is no clock signal on the keyboard connector. ===== Reading ===== ==== When no peripherals are connected ==== This always uses an odd parity * When a single key is pressed, its key code is sent every 70 milliseconds (keyboard repeat) * When more than one key are pressed, they key codes are sent only once (on press), until only one is pressed. * When no key is pressed, nothing is sent. ==== With peripherals ==== When a joystick or mouse is connected, the protocol is made of 4 bytes every 10 milliseconds. * The first byte has odd parity and holds the key code as above. If no key is pressed, it has value 0. If key repeat is active, it is 0 6 times out of 7, and the key code of the repeated key for the 7th time, leading to the same 70ms key repeat delay. The 3 other bytes have even parity and hold data for the peripheral: * The second code is the relative X coordinate (from 0 to 255). * The third code is the relative Y coordinate. * The last byte is the buttons (bits 0 and 2) and X and Y overflows (bits 6 and 7, when the mouse or joystick moves too far, this is set).