AT/PS2 Keybord - PIC Interface?


Closed Thread
Results 1 to 40 of 74

Hybrid View

  1. #1
    Join Date
    Jun 2004
    Posts
    24


    Did you find this post helpful? Yes | No

    Default PS2/AT Keyboard

    There is a pre-programmed PIC called PAK-VI available from milford instuments. I beleive they cost around £25. I've used them in the past and seems to work fine.

  2. #2
    mytekcontrols's Avatar
    mytekcontrols Guest


    Did you find this post helpful? Yes | No

    Arrow PS2 interface code Updated to Version 1.2

    srob:
    There is a pre-programmed PIC called PAK-VI available from milford instuments. I beleive they cost around £25.
    $29.95 USD

    Yes I am familiar with this chip, and it certainly is an option. However when a person can go out and buy something like a PIC18F252 for about $8.00, put this ready-to-run piece of code into it, and still have 14K worth of programming space left, it really doesn't make much sense to do it the other way. The PAK-VI was really aimed more at a situation where a) you don't have an alternative method (i.e.; no keyboard code), or b) the existing processor is just not fast enough, or has enough memory to do this, and be able run your main program as well (i.e; BASIC Stamp).

    Well I think I solved the "A" problem.

    But don't get me wroung srob, it is always good to look at a problem from different angles and avail yourself of all the possible solutions.

    Here is another update to the PS2 interface code. In this version I've added the ability to decode the Print Screen and Pause/Break keys. Also I've included an example of how to read the "alt" register and do something usefull. In the example a Ctrl+Alt+Delete key combo will do a Reset of your PIC. To really see this in action, initiate CapsLock, ScrollLock, or NumLock prior to the reset, and you should see the LED indicator turn off when the PIC re-initializes.
    Attached Files Attached Files
    Last edited by mytekcontrols; - 11th November 2005 at 23:46.

  3. #3
    mytekcontrols's Avatar
    mytekcontrols Guest


    Did you find this post helpful? Yes | No

    Exclamation I moved the KBDAT I/O assignment...

    On the last PS2 Keyboard Interface update (V1.2) I failed to mention that I moved KBDAT from PortB.3 to PortB.4

    This allowed me to use the hardware PWM aspect of PortB.3 for something else. As I had stated in an earlier post, the KBDAT I/O line can be freely moved anywhere of your choosing, by simply changing one equate, and without impacting anything else in the code. I simply took advantage of this fact.

  4. #4
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    Thanks for all the time ur putting into this mytekcontrols.

    I was thinking about the problem of fitting this onto a 16F84 (which will be a problem), and i remembered that the 16F84 has 64 bytes of EEPROM data memory. I wonder if I could put some of the lookup tables on that memory in order to free up program memory.

  5. #5
    mytekcontrols's Avatar
    mytekcontrols Guest


    Did you find this post helpful? Yes | No

    Smile

    Kamikaze47:
    Thanks for all the time ur putting into this mytekcontrols
    Actually I have a self-serving interest in doing this as well. I am designing a product that incorporates this code (along with a lot of other stuff), and I find it gives me incentive to improve it when someone else is in need of the same thing.

    Kamikaze47:
    I was thinking about the problem of fitting this onto a 16F84 (which will be a problem)
    Just curious. Any reason you are persistant on using this particular processor? You really would be much better off using an 18F series chip like the PIC18F252 or PIC18F2525. Does it have something to do with not having a programmer for these?

    Kamikaze47:
    ...i remembered that the 16F84 has 64 bytes of EEPROM data memory. I wonder if I could put some of the lookup tables on that memory in order to free up program memory
    You certainly could. But it will only be of value if can you preload the eeprom with the DATA function in PBP, or have some other way to do it through your programmer.


    Have fun with your project, and the best of luck squeezing it into your F84. <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=615&stc=1&d=1131930010 " align="absmiddle">
    Attached Images Attached Images  

  6. #6
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    There are 2 reasons I would like to get it going on the 16F84. First its the most avaliable chip to me (can get them at my local electronics store), and secondly ive got a programmer for it. However, if need be i could modify the programmer to suit a different processor.

    Anyway, ive been through the code to get familiar with it, and changed anything that would be different for a 16F84 (i dont think i missed anything). When I compile I get these warnings:

    warning: unable to fit variable fsave in requested bank 16.
    warning: unable to fit variable t1 in requested bank 16.
    warning: unable to fit variable ssave in requested bank 16.
    warning: unable to fit variable wsave in requested bank 16.
    warning: unable to fit variable kbcnt in requested bank 16.
    warning: unable to fit variable kbcode in requested bank 16.
    warning: unable to fit variable kbindxi in requested bank 16.
    warning: unable to fit variable kbindxo in requested bank 16.
    warning: unable to fit variable kbbuf in requested bank 16.


    *edit* Was just reading the F84 data sheet and looks like it labels the banks Bank0 and Bank1, so I changed the BankA's to Bank0's and the warnings disapeared... Got a bunch of new errors now, so will have to look at whats happening with them
    Last edited by Kamikaze47; - 14th November 2005 at 18:32.

  7. #7
    mytekcontrols's Avatar
    mytekcontrols Guest


    Did you find this post helpful? Yes | No

    Default

    Well if you are successful, please post your completed code, i'd love to see it .

Similar Threads

  1. MXcom "C-BUS" interface to PIC question
    By tcbcats in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st May 2014, 03:59
  2. Interface a pic with a Iphone/Itouch
    By Luckyborg in forum General
    Replies: 1
    Last Post: - 6th May 2009, 16:02
  3. 4 pin 4 x 4 keypad interface using pic basic pro
    By dunlao_john in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th January 2009, 05:21
  4. USB Interface using PIC
    By Tissy in forum mel PIC BASIC Pro
    Replies: 21
    Last Post: - 22nd May 2006, 16:04
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts