6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Tue May 07, 2024 12:13 pm

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Thu Mar 14, 2019 4:10 am 
Offline

Joined: Sat Mar 11, 2017 1:56 am
Posts: 276
Location: Lynden, WA
I found your ps/2 keyboard interface stuff, and have many questions!


I'm not versed in AVR assembly, so your code is slow reading for me. Basically, I want to do an AVR based PS/2 keyboard controller that talks to the 6502 via a 6522.

I'm trying to do initial experimentation with Arduino just because its a quick way to try stuff out.

First, When I initially plug in the keyboard, i get an AA hex message (including start, parity, and stop bits; 11 total clks) roughly every 600 mS. Is this normal?

Next, do I need to do anything to set up the keyboard before it will send keypress codes? Right now, it only sends the aforementioned AA hex. Key presses do nothing.

I have another keyboard that seems to send proper data on key presses, and does not do the AA hex evrey 600 mS thing. Some keys do nothing, but I believe not all the traces on the zebra strip in the keyboard are making good contact (I've had it apart)

I'd like to try and get the first keyboard I mentioned working, since it's never been taken apart, such that I trust it is in good working order. I have no idea what is normal behavior, and since I have two keyboards doing different things, I'm not sure what is correct.

What I THINK I should be doing is having the clock trigger an interrupt on every pulse, and just keep track of which pulse I'm on, while handling the data pin appropriately. I just don't know if I need to do some initialization housekeeping first.

The PS/2 socket I am using is a Digilent part that is on a small PCB. It has all the needed pullups. Powering the keyboard from the Arduino.


Top
 Profile  
Reply with quote  
PostPosted: Thu Mar 14, 2019 4:45 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1685
Location: Sacramento, CA
Hi Dan,

I have to admit, I did that code 15 years ago so I'm pretty rusty on the details. You do need to send some initialization commands to the keyboard if I recall. Some of that is used to set the LED's in a known state.

I do not recall the AA, but that is binary '10101010', which could be telling us something. I've got a lot on my plate currently, but maybe I can dig up some free time on Saturday to refresh myself with the code and could then offer some suggestions.

In the mean time, if you are better with 6502 assembly, you could connect the keyboard directly to the 6522 and use my 6502 code to test the keyboard using this project:
http://sbc.rictor.org/pckb6522.html

Daryl

_________________
Please visit my website -> https://sbc.rictor.org/


Top
 Profile  
Reply with quote  
PostPosted: Thu Mar 14, 2019 1:46 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1207
Location: Soddy-Daisy, TN USA
I got Daryl's code working on my Potpourri6502 computer.

I haven't updated my project in a while, but the old code is found here:

https://github.com/cbmeeks/Potpourri6502

You need to be sure to init the keyboard like Daryl says. For me, I just did a JSR kbinit.

viewtopic.php?f=4&t=5345&hilit=potpourri6502

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Sat Mar 16, 2019 11:37 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1685
Location: Sacramento, CA
Hi Dan,

I looked over the code in my AVR project and my 6522 version. It should work fine if you initialize the keyboard and let the code run without interrupts. I am not familiar with the Arduino, so am not sure if it configures the processor differently or if it uses an interrupt system.

I have also heard that some keyboards do not initialize properly using my code. I have not run into issues with the 4 or 5 keyboards that I used.

We you able to try my 6522 version?

You may be able to add an LED to your Arduino on an unused port and use that as a diagnostic tool to see where the code may be misbehaving.

Daryl

_________________
Please visit my website -> https://sbc.rictor.org/


Top
 Profile  
Reply with quote  
PostPosted: Sun Mar 17, 2019 5:57 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1685
Location: Sacramento, CA
Hi Dan,

One more thought:
I offer free programming for AVR parts including the ATTINY26. You could sent one to me with return postage or I could buy one from Digikey or Mouser and ship the programmed one to you. All at cost... no mark up from me.

Just a thought to get you moving forward with your project and not have the keyboard IO hold you up.

Daryl

_________________
Please visit my website -> https://sbc.rictor.org/


Top
 Profile  
Reply with quote  
PostPosted: Sun Mar 24, 2019 7:13 pm 
Offline

Joined: Sat Mar 11, 2017 1:56 am
Posts: 276
Location: Lynden, WA
Thanks for the offer. I have made good progress on my keyboard code since I last posted. Thing are going well.


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 25, 2019 3:33 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1685
Location: Sacramento, CA
I'm gad to hear that!!

Daryl

_________________
Please visit my website -> https://sbc.rictor.org/


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: