Close

ADAM KEYBOARD

A project log for ADAM+

THE EMULATED COMPUTER ENTERTAINMENT SYSTEM

dannyvandenheuveldannyvandenheuvel 07/04/2022 at 00:200 Comments

One wire technologie and negative serial data.

The advanced UARTs on the Teensy 4 can do this job for us that used to require a lot of
discrete components.

The Coleco ADAM peripherals are connected via a shared bus AdamNet.
This bus is described in the technical reference manual.
(https://console5.com/techwiki/images/b/b5/Coleco_ADAM_Technical_Reference_Manual.pdf)
the keyboard diagram can also be found online.

The cable is 6P6C.
Keep attention! this cable is twisted for the keyboard.
I believe that AdamNet works as a token passing network.
There is a bus master (the computer) and all device traffic responds to commands from the master,
just like USB.

The bus speed is 62.5K baud half-duplex serial
with standard framing, TTL levels and idle low.
The Teensy 4 MCU has a single-wire mode where both
input and output use the TX pin. A register bit controls this mux.
A pull request is required to set the Teensy to this mode.
The UART modules also support reverse polarity.
The Teensy 4 is 5V tolerant, so excelent for this keyboard project.
Despite that complexity, the keyboard only sends ASCII characters,
with special codes with the eighth bit set for the function keys.
There are no key-up transitions and no access to shift key states.

When I finnish coding of the keyboard routine I had a strange problem.
The problem I had, I could enter a character but  didn't recieve a return ACK.
After placing a very short delay after switching the one wire communication from
TX to RX it was fixed!

void send_command(uint8_t command) {
    s_pkuart->CTRL |= LPUART_CTRL_TXDIR;   // Set to TX Mode...
    Serial1.write(command);                // Write command
    Serial1.flush();                       // Wait for transmit complete
    s_pkuart->CTRL &= ~LPUART_CTRL_TXDIR;  // Set to RX Mode...
    delay(10);                             // <----- THIS WAS THE SOLUTION   
} 

Below the schematic connection of the Teensy to the ADAM keyboard. H7 is just a jumper to disconnect from the 5V (only for testing purposes.)

Discussions