Author |
Topic: PC Keybordadapter for AII (Read 1351 times) |
|
Prodos
Member



Posts: 32
|
 |
PC Keybordadapter for AII
« on: Dec 4th, 2003, 1:46pm » |
Quote Modify
|
Hi, i just serached for a keyboard adapter to connect an AII/+ to a PC keyboard. The situation is following. The PC Keyboard makes a serial scancode, but the a II wants a 7 Bit Asscii Parallel signal at the 16 pin keyboard connector. Anybody has an idea how a adapter with some IC`s could be build ?
|
|
Logged |
|
|
|
technerd
Member


Lonely Sailor :-P


Gender: 
Posts: 44
|
 |
Re: PC Keybordadapter for AII
« Reply #1 on: Dec 5th, 2003, 4:39am » |
Quote Modify
|
All you need to do is build a serial to parallel convertor and drop the high bit. This page should help you. http://www.eece.ksu.edu/~eece696/beta/digital/A/stop.htm You may need to modify it a little..
|
|
Logged |
"Happiness in life is what is important"
Steve Wozniak
|
|
|
Prodos
Member



Posts: 32
|
 |
Re: PC Keybordadapter for AII
« Reply #2 on: Dec 5th, 2003, 12:51pm » |
Quote Modify
|
Ok, i found out a real easy solution , i guess. I will just buy me an Amtel A90S232 PI. That is a universal programmable micorcontroller with flash. It has a build in UART. For around 3 Dollars i can get one uc. If somebody else want to view this magic uc, here are some tecnical data: http://www.atmel.com/dyn/resources/prod_documents/DOC0839.PDF
|
|
Logged |
|
|
|
vbriel
Member
  

Replica 1 is HERE!

Gender: 
Posts: 129
|
 |
Re: PC Keybordadapter for AII
« Reply #3 on: Dec 7th, 2003, 6:43pm » |
Quote Modify
|
In my Apple 1 replica I use an Atmel AVR to convert PS/2 code into ascii. This is not as easy as you may think as there is no pattern for the ps/2 scan codes. You need a look up table to do this. I only used the standard keys like on the apple II mostly due to the complexity of the other keys. Example: The key 'A' out puts hex F0 (going off memory, its been a year since I designed my adapter) as you press the key. Then the character code for 'A' gets sent. When you release the key, you get another code. The character code gets repeated if you hold down the key. Then there is shift and control keys. They are treated as a seperate key, so you must decode if you are pressing them while pressing 1,2, etc. There are web sites out there that can help you with the codes and some sample software out there. Since the Apple II only used 7 bit ascii you only need 8 bits out. Strobe the 8th bit as your strobe pin for a few milliseconds and the apple will pick up the 7 bits your sending. The scan codes alone is proof how screwed up IBM can be, they couldn't use any standard code to keep clones away. Well, that obviously didn't work. Good luck, Vince
|
|
Logged |
|
|
|
Prodos
Member



Posts: 32
|
 |
Re: PC Keybordadapter for AII
« Reply #4 on: Jan 2nd, 2004, 11:22am » |
Quote Modify
|
Ok i done the translation with an atmel and see now the pressed keys at 8 leds. I need now the apple II+ pin layout from the keyboard, i wasn`t able to find at google. I do not need the IIe kwyboard pinout
|
|
Logged |
|
|
|
vbriel
Member
  

Replica 1 is HERE!

Gender: 
Posts: 129
|
 |
Re: PC Keybordadapter for AII
« Reply #5 on: Jan 2nd, 2004, 3:19pm » |
Quote Modify
|
Good job. If you need help let me know, I'll guide you through it. The trick is CTRL and SHIFT. I use an interrupt for every bit that comes in on the ps/2 keyboard and that way I don't miss any data. Here's the pinout you requested. 1=5V 2=STROBE 3=/RESET 4=N/C 5=DATA 5 6=DATA 4 7=DATA 6 8=GND 9=N/C 10=DATA 2 11=DATA 4 12=DATA 0 13=DATA 1 14=N/C 15=-12V 16=N/C Obviously you don't need -12V but you can power your circuit from 5V and GND and reset from the /RESET line. According to the Apple reference manual 5V must be less than 120mA and strobe must be at least 10ms. I strobe the keyboard for about 20ms (either polarity works but I strobe high). That is a signal to the Apple II that a key is ready. Vince
|
| « Last Edit: Jan 2nd, 2004, 3:28pm by vbriel » |
Logged |
|
|
|
Prodos
Member



Posts: 32
|
 |
Re: PC Keybordadapter for AII
« Reply #6 on: Jan 2nd, 2004, 3:56pm » |
Quote Modify
|
hi ok, i was able to send keys, but they are invers. I send $41 and get a invers little, althoug $41 is normally the ascii for a big A or ? here is a screenshot : http://home.knuut.de/natti/ausgabe.JPG if i start the main board the apple at the bottom is also invers
|
|
Logged |
|
|
|
vbriel
Member
  

Replica 1 is HERE!

Gender: 
Posts: 129
|
 |
Re: PC Keybordadapter for AII
« Reply #7 on: Jan 2nd, 2004, 5:36pm » |
Quote Modify
|
Good, your close, now you need to see where your error is. I ran an emulator really quick and I can't make the keyboard do inverse characters. Does the Apple II+ function correctly? If so, there is an error somewhere. If your using AVR studio 4, send me your code and I can error check it for you. I'll need a description of your I/O pins and which AVR you are using. Do all keys come out inverted?
|
|
Logged |
|
|
|
Prodos
Member



Posts: 32
|
 |
Re: PC Keybordadapter for AII
« Reply #8 on: Jan 2nd, 2004, 6:19pm » |
Quote Modify
|
Hi thats really very kind from you. I dunno know, i get this mainboard with nothing else: http://home.knuut.de/natti/appleII.JPG so I havent a real AII+ keyboard to test it here. the code is here : http://home.knuut.de/natti/keyboard.asm it just worked so far for one keypress, if you use hold down the bit counter is lost. I change A and S do big letter ascii, rest is still in small letter ascii in the lookuptable. PortA is the output for the ascii PortC is for keyboard strobe. If the letters loose teh bitcounter you have to make an device reset.
|
|
Logged |
|
|
|
vbriel
Member
  

Replica 1 is HERE!

Gender: 
Posts: 129
|
 |
Re: PC Keybordadapter for AII
« Reply #9 on: Jan 2nd, 2004, 6:40pm » |
Quote Modify
|
Well, part of the problem just looking at the picture is that it is not a II+ but a clone machine. When clones were made, not all machines followed the exact connector standard of the IIplus machines. Without looking too much at your code, it looks ok so far. You may have to trace the pins on the keyboard port and see where they go. Actually, the AVR code maybe good and the wiring maybe good but the character ROM onboard maybe bad or need reseating. Make sure all of the chips on the board are seated in the socket good. It will be a little more of a challange to help since this is a clone? Can anybody else verify the board for me?
|
|
Logged |
|
|
|
Prodos
Member



Posts: 32
|
 |
Re: PC Keybordadapter for AII
« Reply #10 on: Jan 2nd, 2004, 6:51pm » |
Quote Modify
|
I will just try out every "crazy" combination i can send
|
|
Logged |
|
|
|
Prodos
Member



Posts: 32
|
 |
Re: PC Keybordadapter for AII
« Reply #11 on: Jan 3rd, 2004, 1:45pm » |
Quote Modify
|
Hi , i managed so far everything like keyrepaet or Shift keys. At last step i still need to know the ascii values for the cursor left right keys and how the control key is working.
|
|
Logged |
|
|
|
vbriel
Member
  

Replica 1 is HERE!

Gender: 
Posts: 129
|
 |
Re: PC Keybordadapter for AII
« Reply #12 on: Jan 3rd, 2004, 4:18pm » |
Quote Modify
|
Arrow keys: left arrow is backspace or 0x08. Right arrow is 0x21. CTRL: if the key being pressed while CTRL is above 0x3F, subtract 0x40, if it is less than 0x40 the Apple II doesn't register it as a keypress. I don't allow "[" and "]" to be shifted to "{" and "}" as it wasn't available on IIplus keyboards to do that. How is the problem with inverting characters on the screen?
|
| « Last Edit: Jan 3rd, 2004, 4:18pm by vbriel » |
Logged |
|
|
|
Prodos
Member



Posts: 32
|
 |
Re: PC Keybordadapter for AII
« Reply #13 on: Jan 3rd, 2004, 7:59pm » |
Quote Modify
|
Yes, sure, but that is a problem from the charrom at my AII Clone. The numbers are not invers. The Integer Basic is working well with my ascii codes , so i assume that everything is ok. That is really good information. At my side you can take a look at my code so far.
|
|
Logged |
|
|
|
vbriel
Member
  

Replica 1 is HERE!

Gender: 
Posts: 129
|
 |
Re: PC Keybordadapter for AII
« Reply #14 on: Jan 4th, 2004, 7:08am » |
Quote Modify
|
Check your email
|
|
Logged |
|
|
|
|