NeXT Computers Forum Index NeXT Computers
www.NeXTComputers.org
 
Log in to check your private messagesLog in to check your private messages

Log inLog in  RegisterRegister


Profile  Search  Memberlist  FAQ  Usergroups
DIY non-ADB NeXT keyboard to USB adapter
Goto page 1, 2  Next
 
Post new topic   Reply to topic    NeXT Computers Forum Index -> Black Hardware
View previous topic :: View next topic  
Author Message
nex



Joined: 22 Feb 2011
Posts: 12

PostPosted: Sat Dec 08, 2012 9:59 pm    Post subject: DIY non-ADB NeXT keyboard to USB adapter Reply with quote

Very cool!

Parts:

Arduino micro w/ headers ~$25
PS/2 connector ~$4
USB cable ~$4

Guide by Ladyada: http://learn.adafruit.com/usb-next-keyboard-with-arduino-micro

PDF version: http://learn.adafruit.com/downloads/pdf/usb-next-keyboard-with-arduino-micro.pdf
Back to top
View user's profile Send private message
gtnicol



Joined: 27 Dec 2005
Posts: 525
Location: Rhode Island, USA

PostPosted: Sun Dec 09, 2012 10:15 am    Post subject: Reply with quote

Very cool. I've been working on something similar (to/from PS/2) on a PIC. The mouse is multiplexed in as well... there's a keyboard query and a mouse query (1 bit set, 2 bits set), and the mouse data is sent the same way as the keyboard data.
Back to top
View user's profile Send private message
jroark



Joined: 17 Feb 2012
Posts: 75
Location: San Francisco, CA

PostPosted: Sun Dec 09, 2012 1:42 pm    Post subject: Reply with quote

Nice, this looks promising. Those soundboxes are increasingly hard to come by. I've also been looking into making a mono y-cable db19->db19/vga it would be great to skip the soundbox all together and have the option to use a ps/2 kvm.

I've seen some discussion about the pin-outs for the y-cable on this forum but nothing I've felt was definitive.

gtnicol, do you have the pinouts?
Back to top
View user's profile Send private message Visit poster's website
gtnicol



Joined: 27 Dec 2005
Posts: 525
Location: Rhode Island, USA

PostPosted: Sun Dec 09, 2012 6:53 pm    Post subject: Reply with quote

Yes, I had some cables made up that go from mono->via, but you still need the soundbox for the keyboard. My longer term plan was to have a PS/2+VGA adapter for the NeXT box so you could use a normal keyboard and display with them, but the audio, video, power, and mouse+kbd all go down the mono cable, which runs at about 5MHz (from memory). I picked up a propeller and an XMOS to finish off the project, but got really busy afterward.

I will dig up the PS/2 project again... it was pretty close to done using a single PIC.
Back to top
View user's profile Send private message
jroark



Joined: 17 Feb 2012
Posts: 75
Location: San Francisco, CA

PostPosted: Sun Dec 09, 2012 8:39 pm    Post subject: Reply with quote

I've got a propeller, they used them on the DEFCON badges this year. Two ps/2 ports and vga out as well.

FYI those hard to find DB19 male connectors are available here: http://iec.net/Browse05/MPartDB19.html they told me they have a couple hundred in stock.
Back to top
View user's profile Send private message Visit poster's website
jroark



Joined: 17 Feb 2012
Posts: 75
Location: San Francisco, CA

PostPosted: Mon Dec 31, 2012 8:26 pm    Post subject: Teensy 2.0 version Reply with quote

I was inspired by the Arduino tutorial and decided to get this running on my Teensy 2.0. For some reason the Arduino code would not run properly for me even though the two boards are mostly compatible and lots of projects will run on both without modification.

The Teensy is only $16.

Code is here:
https://code.google.com/p/teensy-nextkb/

Back to top
View user's profile Send private message Visit poster's website
pergamon



Joined: 30 Dec 2005
Posts: 214
Location: Indiana

PostPosted: Mon Jan 14, 2013 11:39 am    Post subject: Woot! Reply with quote

I'm typing this post using this project. Neato.
Back to top
View user's profile Send private message Visit poster's website
timu



Joined: 23 May 2010
Posts: 13
Location: Willowbrook, IL

PostPosted: Fri Jan 18, 2013 11:48 am    Post subject: Reply with quote

I've got it working too...

However, behavior is a little odd...
Shift key LEDs do not stay on if you continue holding either key down.

Also, the LED on the arduino micro (13) never goes off... from the code it seems if there are no keypresses it should be off?

It appears the OS (Win7) does not recognize a constant depression of the shift key either, rather a series of presses (?)

Maybe the keyboard is not returning 0x200600 when idle?

Tim
Back to top
View user's profile Send private message
pergamon



Joined: 30 Dec 2005
Posts: 214
Location: Indiana

PostPosted: Fri Jan 18, 2013 12:03 pm    Post subject: Modifiers Reply with quote

timu wrote:
Also, the LED on the arduino micro (13) never goes off... from the code it seems if there are no keypresses it should be off?


It should go off, though I've seen this happen a couple times on mine and I've had to hit the reset which fixed it.

timu wrote:
It appears the OS (Win7) does not recognize a constant depression of the shift key either, rather a series of presses (?)


Probably due to the "fix" for the sticky modifier keys. I'd just made a note in my version to try to make that a little smoother, which I'll probably do tonight or tomorrow.

BTW I mentioned this on another thread, but if anyone wants a version with preliminary (in other words, not working very well yet) mouse support:

https://github.com/mgrdcm/USB-NeXT-Keyboard/tree/mouse
Back to top
View user's profile Send private message Visit poster's website
timu



Joined: 23 May 2010
Posts: 13
Location: Willowbrook, IL

PostPosted: Fri Jan 18, 2013 12:46 pm    Post subject: Re: Modifiers Reply with quote

pergamon wrote:

It should go off, though I've seen this happen a couple times on mine and I've had to hit the reset which fixed it.


No luck, even with multiple resets... It is not full intensity, you can tell it is cycling high/low.

Does your shift LEDs stay on if you hold down the shift key?
Back to top
View user's profile Send private message
timu



Joined: 23 May 2010
Posts: 13
Location: Willowbrook, IL

PostPosted: Fri Jan 18, 2013 1:02 pm    Post subject: Reply with quote

I turned on the debug and discovered that my keyboard is returning 0x300600 when idle.

So, I redefined NEXT_KMBUS_IDLE to 0x300600

Now, the LED is off unless there is a keypress, and the shift LEDs stay on.
OS now sees a held down shift as a constant keypress.
Back to top
View user's profile Send private message
pergamon



Joined: 30 Dec 2005
Posts: 214
Location: Indiana

PostPosted: Fri Jan 18, 2013 1:07 pm    Post subject: Reply with quote

timu wrote:
I turned on the debug and discovered that my keyboard is returning 0x300600 when idle.

So, I redefined NEXT_KMBUS_IDLE to 0x300600

Now, the LED is off unless there is a keypress, and the shift LEDs stay on.
OS now sees a held down shift as a constant keypress.


Fascinating!

I wonder if your KB is especially new or especially old. Would you be willing to share your serial number (or an approximation of it)? I know there are at least 2 different layouts of US non-ADB NeXT keyboards. I need to pull out a sampling of the various models I have and test them...
Back to top
View user's profile Send private message Visit poster's website
timu



Joined: 23 May 2010
Posts: 13
Location: Willowbrook, IL

PostPosted: Fri Jan 18, 2013 1:26 pm    Post subject: Reply with quote

pergamon wrote:

Fascinating!

I wonder if your KB is especially new or especially old. Would you be willing to share your serial number (or an approximation of it)? I know there are at least 2 different layouts of US non-ADB NeXT keyboards. I need to pull out a sampling of the various models I have and test them...


I am currently using a SN slightly above ABP5102150
I have another keyboard at home, which I will try later.
Back to top
View user's profile Send private message
pergamon



Joined: 30 Dec 2005
Posts: 214
Location: Indiana

PostPosted: Fri Jan 18, 2013 1:34 pm    Post subject: Reply with quote

timu wrote:
I am currently using a SN slightly above ABP5102150


If memory serves, that's a very late model one.

I wouldn't be surprised if it turns out that the IDLE signal is different to tell the host which version or key layout the keyboard is.
Back to top
View user's profile Send private message Visit poster's website
jroark



Joined: 17 Feb 2012
Posts: 75
Location: San Francisco, CA

PostPosted: Fri Jan 18, 2013 3:12 pm    Post subject: Reply with quote

the AVR internal clock is not super accurate, perhaps the timing is slightly off?

The line is high when idle and the bits come in lsb order, so the difference between 0x200600 and 0x300600 is one bit on the idle high

Code:

000000000110000000011 (0x300600)
000000000110000000001 (0x200600)
--_________--_________--
xx01234567890123456789xx
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    NeXT Computers Forum Index -> Black Hardware All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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 vote in polls in this forum



Powered by phpBB © 2017 phpBB Group