I've been experimenting with PS2 Keyboards for the last couple of days, and made a handy user module up if anyone is interested.
You can find it here swKBD.bas
While the above module can, and does use TMR2 interrupts - they are for timeouts only (and plug-and-play polling). They can be disabled via simple options, and driven purely by blocking calls (ie, wait for a key to be pressed before returning).
Thoughts/ideas welcomed
PS/2 Keyboard User Module
Moderators: David Barker, Jerry Messina
PS/2 Keyboard User Module
digital-diy.com - Hobby microcontroller projects and tutorials. Assembly, PICBasic and C examples.
Australian distributor for the Swordfish Compiler
Australian distributor for the Swordfish Compiler
Version 1.1 Notes
- FIX: Swordfish version 2.2.0.1 no longer generates an error on KBD_UCASE elements.
- FEATURE: Detects if the PS/2 Keyboard is connected, and handles all re-programming on-the-fly (allows keyboards to be disconnected/connected and remain functional).
- IMPROVEMENT: Increased performance up to 250 samples/second (4mS per packet ... MAX).
- IMPROVEMENT: Removed all interrupt routines - completely software driven (frees up TMR2 for other tasks)
- IMPROVEMENT: In the unlikely event that a packet fails validation, the module will attempt to retrieve the packet instead of resetting the keyboard (up to 3 attempts)
digital-diy.com - Hobby microcontroller projects and tutorials. Assembly, PICBasic and C examples.
Australian distributor for the Swordfish Compiler
Australian distributor for the Swordfish Compiler
Re: PS/2 Keyboard User Module
Hi... does anyone have this module... looks like is not longer available in the digital-diy website...
Thanks
Thanks
-
- Swordfish Developer
- Posts: 1473
- Joined: Fri Jan 30, 2009 6:27 pm
- Location: US
Re: PS/2 Keyboard User Module
It's still there, but you have to dig around to find it.
Here's a copy...
Here's a copy...
- Attachments
-
- swKBD.zip
- (5.7 KiB) Downloaded 219 times
Re: PS/2 Keyboard User Module
thanks...!
Re: PS/2 Keyboard User Module
Just for reference the links can also be found at the bottom of the swordfish module page too.. I updated all the broken links sometime ago..
http://www.sfcompiler.co.uk/wiki/pmwiki ... er.Modules
http://www.sfcompiler.co.uk/wiki/pmwiki ... er.Modules