Difference between revisions of "TinyPS2"
Jump to navigation
Jump to search
Blwikiadmin (talk | contribs) |
Blwikiadmin (talk | contribs) |
||
Line 95: | Line 95: | ||
Sketch uses 850 bytes (10%) of program storage space. Maximum is 8192 bytes. | 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. | Global variables use 15 bytes (2%) of dynamic memory, leaving 497 bytes for local variables. Maximum is 512 bytes. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</pre> | </pre> | ||
Revision as of 15:00, 5 May 2022
Contents
Features
- PS/2 keyboard or mouse to TTL Level Serial converter based on Scott Baker BLOG
- 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
- 49x49mm ODAS form factor
- 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
TinyPS2 Connections
Connectors
J1 - TTL Serial Connector
- VCC (pin nearest to J1 silkscreem)
- SERTX
- N/C
- GND
J2 - PS/2
- Standard PS/2 Mini-DIN-6 connector
H2 - In-System Programming Header
- SPI connector to download ATTiny85
- 2x3 header
- Program ATTiny85 without PS/2 keyboard attached
- Pinout
- KBCLK
- VCC
- SERTX
- KBDAT
- RST*
- GND
Firmware
Scott Baker's build
- Scott's GitHub page
- Scott appears to have used Crosspack for AVR software development
- Scott uses two libraries from other projects
- ATTiny85 UART Library - The Garage Lab
- Interrupts: Interfacing a Microcontroller with a PS/2 Keyboard - PS/2 Keyboard Library
- Scott has hex file
- FUSES = -U lfuse:w:0x62:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m
- Downloaded using TL866i
- Used Fuse bits from Programmer
- Matched lfuse values already
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 (Arduino IDE)
- 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.
TinyPS2V03
- Test routine
- Sends out A-Z in serial line at 9600 baud (~100uS bit time)
- Software Serial library
- Verifies SoftwareSerial works
- Test with TinyPS04 sketch
- 2 mS off/on on serial output pin verifies delay(2)
- Caught missing bootloader (sets speed fuses)
- 2 mS off/on on serial output pin verifies delay(2)
TinyPS04
- Test with TinyPS04 sketch
- Toggle serial output line every 2 mS
- Verifies delay(2)
TinyPS05
- Intent: Verify interrupt from keyboard does not conflict with Software Serial
- Toggles serial out line if char comes in
- Never toggles
Programming Card
- Programming procedure is taken from here
- Add ATTiny Board support to Preferences, Path:
https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json
- Select ATTiny85, 8 Mhz
- Burn bootloader - Otherwise clock is way off
- ATProgHead
- Running Arduino as ISP
Other People's Videos
Schematic
Issues
- 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