Uzebox 128+

Topics regarding the Uzebox hardware/AVCore/BaseBoard (i.e: PCB, resistors, connectors, part list, schematics, hardware issues, etc.) should go here.
User avatar
uze6666
Site Admin
Posts: 4337
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Uzebox 128+

Post by uze6666 » Fri Feb 03, 2017 5:49 am

Eh, there is still U128, serial number 1, with your name on it waiting to be put together ;)
Well, that's quite a good argument! :P

Good news, I got some time this week to finish off that thing! Pulled out what I had done last year, fixed a couple hardware and software bugs and it all work pretty well...mouse and keyboard. :mrgreen: I used a mega168 since that's what I had lying around. I also used a 4066 analog switch to be able to multiplex the '168 SPI port and P2 controller on the same lines. I want to make a small PCB and ship it for manufacturing in the next few days if all goes well. Speaking of which...do you have size limitations to fit such a thing in the keyboard?

User avatar
D3thAdd3r
Posts: 2184
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Uzebox 128+

Post by D3thAdd3r » Fri Feb 03, 2017 9:09 am

uze6666 wrote:Good news, I got some time this week to finish off that thing!
:mrgreen: Spectacular!! Even though I had no doubt you would be able to finish this when you got the time, it is very exciting news to hear of success this quickly.

If the keyboard+mouse solution is in a finalized state hardware wise how you see fit, I am on board and will copy it or integrate connections to your PCB solution. I have a bunch of large header pins and card edge expansions that could connect all free pins of the '168 and '644 expansion pins to the outside word. I am not interested in I2C or other exotic stuff personally since it will never be emulated, but someone might be and it would be there. Is it practical to have a header style footprint on the PCB that breaks out all the '168 pins?
uze6666 wrote:Speaking of which...do you have size limitations to fit such a thing in the keyboard?
I am sure you will make it as small as practical so it will work. There will be some place to put it and run wires to, or else I will make one. The addition of the bottom plate allows fairly arbitrary placement of components and hiding of wire nests with a little cutting.

User avatar
uze6666
Site Admin
Posts: 4337
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Uzebox 128+

Post by uze6666 » Sat Feb 04, 2017 5:39 am

I've put 3 headers footprint: free pins for the '168, ISP, connections to Uzebox and connections to SNES P2. So you'll have all the connections you need and more. :)

I will implement a "features" command that can return to the host what devices the things has implemented, ex bits for keyboard, mouse, MIDI, etc. But now will only do the KB and mouse. Still a lot of work to be done on the firmware side to optimize the cycles usage for the host. Btw, all PS/2 mouse commands are carried over so intellimouse explorer extensions are supported.

Size of the board so far is about 2.3"x1.5" so far. Working on the PCB, will post some images soon.

User avatar
D3thAdd3r
Posts: 2184
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Uzebox 128+

Post by D3thAdd3r » Sun Feb 05, 2017 1:38 am

uze6666 wrote:Size of the board so far is about 2.3"x1.5" so far. Working on the PCB, will post some images soon.
uze6666 wrote:I've put 3 headers footprint: free pins for the '168, ISP, connections to Uzebox and connections to SNES P2. So you'll have all the connections you need and more.
Ok that is perfect for this and the more general case of someone building a keyboard for use with a standalone Uzebox.
uze6666 wrote:I will implement a "features" command that can return to the host what devices the things has implemented, ex bits for keyboard, mouse, MIDI, etc. But now will only do the KB and mouse. Still a lot of work to be done on the firmware side to optimize the cycles usage for the host. Btw, all PS/2 mouse commands are carried over so intellimouse explorer extensions are supported.
I recall there was some sequence of events on start up and changing sensitivity in specific ways, that let an intellimouse aware system know that it was not an ordinary mouse(or backwards compatible if it did not). Does the host '644 handle all this type of stuff, and the '168 passes through all PS/2 data uninhibited for the mouse, or the '168 does some of this?

User avatar
uze6666
Site Admin
Posts: 4337
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Uzebox 128+

Post by uze6666 » Mon Feb 06, 2017 6:08 am

I recall there was some sequence of events on start up and changing sensitivity in specific ways, that let an intellimouse aware system know that it was not an ordinary mouse(or backwards compatible if it did not). Does the host '644 handle all this type of stuff, and the '168 passes through all PS/2 data uninhibited for the mouse, or the '168 does some of this?
Not passtrought unibited per se for speed reasons (would require to send more bytes during vsync), but I've nonetheless implemented all PS/2 mouse commands on the 168, including set sensitivity. So yes, you can use it to switch to intellimouse mode. Done it, work like a charm. :)
ps2.jpg
ps2.jpg (140.82 KiB) Viewed 808 times
Attached is the final hardware design schematics. I've double checked all wiring from my breadboard prototype and all match. The 4066 can be any modern version, like the 74AHC4066N.

I will send the PCB to the fab this week, so I should get it within the next 2 weeks for some final tests. Ordered two other cheap PS2 mouses from Aliexpress to tests them against the firmware.
Attachments
Uzebox PS2 adapter V2.1.pdf
(24.26 KiB) Downloaded 36 times

User avatar
D3thAdd3r
Posts: 2184
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Uzebox 128+

Post by D3thAdd3r » Wed Feb 08, 2017 3:58 pm

Looks good!

Do you have a rough idea of the cycle cost to read fast enough when a user it typing away at a decent pace?

User avatar
uze6666
Site Admin
Posts: 4337
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Uzebox 128+

Post by uze6666 » Thu Feb 09, 2017 3:45 am

The way the firmware works allows to execute one device command per vsync (ex, init mouse) and one or more reads per vsync. Considering average typist can type ~5 keys per second, reading one key per vsync is enough. Right now reading a single key takes about 160 cycles + 240 cycles overhead during vsync. A lot of time is wasted to give time to the '168 to react to the host. Right now I have to send a "read key command" explicitly in addition to the "release bus command". Reading a mouse packet takes ~830 cycles.

I have a lot of optimizations in mind so I should be able to reduce that to no more than 200 cycles for a simple key read and a bit more for a mouse packet. For one, I'd like to add a bus command to set a "fast mode" in which you would just have to look at the state of the data pin to know if some events are pending (like a key press or mouse move): 0=no, 1=yes. If yes, a single SPI transfer would fetch that event.

User avatar
D3thAdd3r
Posts: 2184
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Uzebox 128+

Post by D3thAdd3r » Thu Feb 09, 2017 4:21 am

That is way better than I thought. I imagined some number of scanlines per frame like the SNES mouse. With the SNES mouse there were probably reasonable uses for it in a lot of games as a bonus feature, but even a few scanlines cannot be spared by many games so it was not reasonable to add the feature. This seems like it could fit in anything. If it works out that way, everything I make will have keyboard as an option. That will require some small and flexible code design in generic input handling to make the integration easy. Mostly those things might just be converting keyboard data to look like standard joypad presses to the game logic.

Did you read about that "remote mode" for the mouse at all? Maybe it could have a use maybe not. Basically counters don't get reset until the host requests a data packet(or overflow if not polled enough). I suppose with the '168 there to poll all the time that is a moot point.

User avatar
uze6666
Site Admin
Posts: 4337
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Uzebox 128+

Post by uze6666 » Thu Feb 09, 2017 6:09 am

Did you read about that "remote mode" for the mouse at all? Maybe it could have a use maybe not. Basically counters don't get reset until the host requests a data packet(or overflow if not polled enough). I suppose with the '168 there to poll all the time that is a moot point.
Indeed, I'll look into it to reduce the interrupts on the 168 and improve response time for the host. Right now I use the stream mode and, although its good for testing, it pushes a hell of a lot of data for nothing. We just need 60 polls per seconds. So the polling will be done by the 168 *after* the last transfer from the host. That way it has plenty of time to gather all the data until the next vsync. Causes a 1/60th of second latency, but I'm sure we can live with this. ;)

User avatar
D3thAdd3r
Posts: 2184
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Uzebox 128+

Post by D3thAdd3r » Sat Feb 18, 2017 2:12 am

Update, I have not forgotten about this and am meaning to get moving again. With Alec having the keyboard+mouse situation more or less handled there is no more stall here. Like I said before, this is likely ~6 of these that will ever be made and they wont be for sale. I acquired more of the keyboard and controllers, so I have enough of the hard to find parts already. All of it is brand new, I still love these controllers:
morecontrollers.jpg
morecontrollers.jpg (63.92 KiB) Viewed 667 times
I think the existing ones I was working on, might end up "practice pieces". I got a lot of experimentation out of the way, but I think I can end up with better quality starting from scratch. I am trying my hand at PCB design finally, I no longer want to fit the standard PCB in these things, because this is really where all the work is. I believe it can be done much easier with a custom PCB. Basically it will be a modular concept using all surfac emount, so that I can put different parts in different places without so much custom cuting. Anyway when I have more physical things to show I will do so. I have pretty well decided on every last piece of hardware and acquired them since I last mentioned anything. Visually I think these are going to be better than the previous examples.

Things to come: I am working on software for this off an on. There is an Altair 8800 emulator for Arduino and I have been working on porting it. Lets say for now it is nothing worthy of release or useable, but it is emulating BASIC. When it reaches functionality of the Arduino version it is ported from, it will run CP/M...slowly.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests