PS/2 -> PCjr keyboard conversion

Hardware questions and modifications

Re: PS/2 -> PCjr keyboard conversion

Postby jharre » Fri Sep 26, 2014 9:09 pm

Wow, that appeared as I was making pizza tonight. Thanks for including the link, Mike.

That's kind of what was in my mind when starting this thread. It gives me something to twiddle with this weekend - much to the dismay of my wife. ;)

<*> Jim
jharre
 
Posts: 61
Joined: Tue Jun 18, 2013 9:48 pm
Location: Placitas, New Mexico

Re: PS/2 -> PCjr keyboard conversion

Postby jmetal88 » Wed Mar 25, 2015 6:25 am

So, I picked up my own PIC version of this project again last night. I've had some recent experience re-learning C, so I'm re-writing what I've done so far in C, as C makes it much nicer to manage complex code. Luckily, I documented my assembly code really well, so I was just able to follow my comments to reconstruct the routines I needed in C. I've only reconstructed about a third of what I've done so far, but I'm also attempting to add buffer routines this time (the data transfer rate of PS/2 is faster than the data transfer rate for the PCjr keyboard, and I think for some of the keys that send more than one key code at a time a buffer will be necessary).
jmetal88
 
Posts: 793
Joined: Sun Jul 25, 2010 10:22 am

Re: PS/2 -> PCjr keyboard conversion

Postby Hargle » Wed Mar 25, 2015 11:46 am

we're cheerleading from the sidelines...
this plus the VGA adapter discussion in the other thread are getting me very close to having the dream of KVM switchery with my other machines. I've wanted that for years and years, so don't let me down now. No pressure or anything... :)
Hargle
 
Posts: 115
Joined: Wed Apr 27, 2011 3:53 pm

Re: PS/2 -> PCjr keyboard conversion

Postby jmetal88 » Wed Mar 25, 2015 4:15 pm

I also just ordered a PICkit 3 I found listed for about half the normal price on eBay. This will allow me to actually run the Microchip debugger if I need to, as opposed to writing my own debugging routines that output over UART. It will also allow me to program over USB instead of tying me to machines with parallel ports.

I'm hoping to actually make progress on this soon. I can't do too much right now because I'm working on finishing up my Senior Project for my EET degree and that takes a lot out of me.
jmetal88
 
Posts: 793
Joined: Sun Jul 25, 2010 10:22 am

Re: PS/2 -> PCjr keyboard conversion

Postby Trixter » Thu Mar 26, 2015 2:13 pm

But I thought this PS/2 -> PCjr keyboard adapter WAS your senior project for EET degree!

Kidding, of course. EET degree obviously more important :-) so just post an update whenever you poke at it.
You're all insane and trying to steal my magic bag!
Trixter
 
Posts: 495
Joined: Mon Sep 01, 2008 12:00 am
Location: Illinois, USA

Re: PS/2 -> PCjr keyboard conversion

Postby jmetal88 » Fri Mar 27, 2015 5:11 pm

Thought of a nice way to ignore NumLock LED changes when the Pause key is pressed, in a simpler way than what I was doing in the ASM version of the code anyway.
jmetal88
 
Posts: 793
Joined: Sun Jul 25, 2010 10:22 am

Re: PS/2 -> PCjr keyboard conversion

Postby jmetal88 » Sat Mar 28, 2015 9:08 am

Did a little bit more work this morning. Barring any unexpected bugs, the code I have now in C should be doing the same things my old ASM code was doing, with the addition of a 220uS clock signal that will be used to time the data output to the PCjr. Now, for this purpose, this is where C makes things a little bit fuzzy compared to ASM. I'm running the timer off the instruction cycle clock, and I don't know how many instructions the compiler will use when invoking an ISR (which I use to reset the counter to a number that should result in it rolling over after 220uS). So for now, I'm just routing that 220uS clock to an external connection so I can attempt to verify and adjust the timing by observing the waveform on an oscilloscope. This means it's about time to get the hardware put back together and start to test things again, which will probably have to wait until my lab partner and I finish assembling and testing our senior project (we're actually almost done assembling it at this point, so we're going to try to finish the assembly today and start testing tomorrow).
jmetal88
 
Posts: 793
Joined: Sun Jul 25, 2010 10:22 am

Re: PS/2 -> PCjr keyboard conversion

Postby MikeModified » Sat Mar 28, 2015 9:48 pm

MikeModified
 
Posts: 118
Joined: Sat Mar 15, 2014 5:10 pm
Location: Portland, OR

Re: PS/2 -> PCjr keyboard conversion

Postby jmetal88 » Sat Apr 04, 2015 9:41 pm

Okay, I may have figured out the biphase serial encoding thing today. We will see if it works whenever I get around to re-assembling and testing the circuit. It's 100% interrupt driven and I'm still not totally comfortable with setting those up even though I've had to use them for several things on other projects by now.
jmetal88
 
Posts: 793
Joined: Sun Jul 25, 2010 10:22 am

Re: PS/2 -> PCjr keyboard conversion

Postby jmetal88 » Sun Apr 05, 2015 6:43 pm

I wired up my test circuit today, and my program wasn't working at all. After some careful examination of the signals going into and coming out of the PIC, I discovered that the program was getting stuck in the interrupt routing responsible for reading the PS/2 scan codes. It turns out the approach I took which worked very well in assembler (turning off interrupts and polling the clock pin to figure out when to read data) doesn't work at all in C, and I have a hunch it's something the compiler is doing with my while loops. Anyway, I re-wrote the PS/2 read routine to work entirely off the interrupt this time, and now I'm seeing data at the output (this is with my oscilloscope, I have not tried hooking it to my PCjr yet). I have also lost the ability to toggle LEDs, and I think it's for the same reason, so I need to re-write that routine next.

EDIT: Well, I said I'm seeing data on the output, and that's true, but after a lot of frustration trying to debug the LED thing, I've realized that the output data represents all zeroes. So I have a lot of debugging to do. I *think* part of the problem is in the input buffer, but I'm not really sure what in the code is causing the problem.
jmetal88
 
Posts: 793
Joined: Sun Jul 25, 2010 10:22 am

PreviousNext

Return to PCjr Hardware

Who is online

Users browsing this forum: No registered users and 1 guest