Difference between revisions of "TinyPS2"

From Land Boards Wiki
Jump to navigation Jump to search
Line 156: Line 156:
 
* Changed pin usage
 
* Changed pin usage
 
* Uses Hardware Transmitter in CPU
 
* Uses Hardware Transmitter in CPU
 +
* Keyboard runs at 5V
 +
* CPU runs at 3.3VV
 +
* 3.3V to 5V level shifter
  
 
=== Rev 3 ===
 
=== Rev 3 ===

Revision as of 07:12, 15 August 2022

TinyPS2 P899 cropped-720px.jpg

Introduction

It is getting difficult to find ASCII serial keyboards for use in Retro-Computer projects. This card fills that need. The card is a PS/2 keyboard to TTL Level Serial adapter. PS/2 keyboards are still widely available. This is based on the design from Scott Baker BLOG.

Keyboard PS2 MicrosoftNatural.jpg

Features

  • ATTiny85 8-bit CPU
    • Run at 8 MHz in this use-case
    • 8 KB of In System Programmable (ISP) flash
    • 8-MHz internal RC oscillator that can be used as the default clock
    • 512 bytes of EEPROM
    • 512 bytes of SRAM
  • 115,200 baud serial
    • 57,600-250,000 are build time options
  • 49x49mm ODAS form factor
  • (4) 4-40 mounting holes
  • 3.3V or 5V operation
  • Current measurement
    • 1 mA @ 5V (without keyboard)
    • 13 mA @ 5V (including keyboard)
    • 8mA @ 3.3V (including keyboard)
      • Requires a keyboard that works at 3.3V

ATTiny85 Connections

TinyPS2 CPU Pins.PNG

Connectors

J1 - TTL Serial Connector

TinyPS2 J1.PNG

  1. VCC (pin nearest to J1 silkscreem)
  2. SERTX
  3. N/C
  4. GND

J2 - PS/2

  • Standard PS/2 Mini-DIN-6 connector

TinyPS2 J2 kbd.PNG

H2 - In-System Programming Header

ICSP.PNG

  • SPI connector to download ATTiny85
  • 2x3 header
  • Program ATTiny85 without PS/2 keyboard attached
  • Pinout
  1. KBCLK
  2. VCC
  3. SERTX
  4. KBDAT
  5. RST*
  6. GND

Firmware Builds

Two software builds:

  • Scott Baker's build
  • Arduino IDE port

Scott Baker's Software Build

Programming Scott's Build

Tested Scott's Build

  • Works really well
  • 115,200 baud
  • Works at 3.3V or 5V
    • Drops out around 3.15V - may need BOD bit changed?

TinyPS2 Software Build Using Arduino IDE

  • Converted Scott Baker's build to the Arduino IDE
    • Move main init code to setup()
    • Move main inner loop to loop()
  • Compiled fairly easily
  • GitHub Software Repo
  • Resources (Arduino UNO)
Sketch uses 850 bytes (10%) of program storage space. Maximum is 8192 bytes.
Global variables use 15 bytes (2%) of dynamic memory, leaving 497 bytes for local variables. Maximum is 512 bytes.

Setting Baud Rate

  • The implementation is optimized for higher baud rates - please don't use anything below 57600 on an 8MHz clock
  • It does work at up to 250000 baud but you may experience a small amount of dropped packets at that speed.
  • Set in TinyPS2.ino file
#define BAUD_RATE 115200

Arduino IDE Setup for ATTiny85

https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json

Programming Card (Arduino IDE)

  • Select ATTiny85, 8 Mhz
  • Burn bootloader - Otherwise clock is way off

Arduino IDE ATTiny85.png

  • ATProgHead
    • Running Arduino as ISP
  • Can program from an Arduino UNO like this:

ProgramFromArduinoUNO.jpg

Schematic

Issues

Rev 4

  • Changed CPU
    • Was 8 MHz ATTiny85
    • Changed to QT PY or XAIO
  • Changed pin usage
  • Uses Hardware Transmitter in CPU
  • Keyboard runs at 5V
  • CPU runs at 3.3VV
  • 3.3V to 5V level shifter

Rev 3

  • Added D3 to J1 connector
  • Change from SMT parts to through hole parts
  • Silkscreen cleanups
    • Added ISP VCC/GND to silkscreen
    • Added silkscreen to J1 pins

TinyPS2 Rev3 3D.png

Rev 2

  • Fixed issues below

Rev 1

  • Missing pull-up resistors on PS/2
    • Rev 2 - add pull-up resistors
    • (There's pullups in the part so this may not be needed)
  • Missing C3 cap in sequence
    • Rev 2 - change C4 => C3

Assembly Sheet