VOGONS


USB to Serial Mouse using the Pi Pico!

Topic actions

Reply 40 of 231, by CalamityLime

User metadata
Rank Member
Rank
Member

I had a quick look into the power consumption of keyboards (unique problems) and I found an article from 2017 talking about the consumption of a model M vs a modern (non RGB membrane ones).
http://swvincent.com/ibm-model-m-power/index.html

So looking at those numbers for the simple membrane's
LEDS off: 3-4 mA@5v (Much less than I would have guessed)
LEDs on: ~35 mA@5v -> ~50 mA@5v

Pico's max power is 100mA (which a simple usb to din keyboard shouldn't come close to)

So for a pico and a simple keyboard with 3 leds, you're looking at a worst case of 150mA which is a touch higher than a model M with leds on.
That should work fine with most PCs.

Some *may* take the load of RGB on top of that but from my understanding of things, you would want an alternative power in and a little switch to switch between different power sources.
Even then someone will come along shouting "You said this would work with an RGB keyboard, the very same keyboard I use to charge my phone and it broke the keyboard port of my 386 mobo!"

Anyway, it's a bit of a side tangent for the moment but glad to hear that there is interest none the less.
-Lime

Be Happy, it's only going to get worse.
- Projects
Limes Strange 3D models
USB-2-232

Reply 41 of 231, by Sphere478

User metadata
Rank l33t++
Rank
l33t++
CalamityLime wrote on 2022-01-02, 19:54:
I had a quick look into the power consumption of keyboards (unique problems) and I found an article from 2017 talking about the […]
Show full quote

I had a quick look into the power consumption of keyboards (unique problems) and I found an article from 2017 talking about the consumption of a model M vs a modern (non RGB membrane ones).
http://swvincent.com/ibm-model-m-power/index.html

So looking at those numbers for the simple membrane's
LEDS off: 3-4 mA@5v (Much less than I would have guessed)
LEDs on: ~35 mA@5v -> ~50 mA@5v

Pico's max power is 100mA (which a simple usb to din keyboard shouldn't come close to)

So for a pico and a simple keyboard with 3 leds, you're looking at a worst case of 150mA which is a touch higher than a model M with leds on.
That should work fine with most PCs.

Some *may* take the load of RGB on top of that but from my understanding of things, you would want an alternative power in and a little switch to switch between different power sources.
Even then someone will come along shouting "You said this would work with an RGB keyboard, the very same keyboard I use to charge my phone and it broke the keyboard port of my 386 mobo!"

Anyway, it's a bit of a side tangent for the moment but glad to hear that there is interest none the less.
-Lime

Lol one of my keyboards has a usb port on it but I think it’s pass through because there are two ports to plug into the computer

I forgot to get some amp readings for ya guys last night. I’ll try to remember tonight

Sphere's PCB projects.
-
Sphere’s socket 5/7 cpu collection.
-
SUCCESSFUL K6-2+ to K6-3+ Full Cache Enable Mod
-
Tyan S1564S to S1564D single to dual processor conversion (also s1563 and s1562)

Reply 42 of 231, by CalamityLime

User metadata
Rank Member
Rank
Member
Sphere478 wrote on 2022-01-02, 20:04:

Lol one of my keyboards has a usb port on it but I think it’s pass through because there are two ports to plug into the computer

I forgot to get some amp readings for ya guys last night. I’ll try to remember tonight

What the second USB port does is up to the manufacturer. Sometimes it's just power for additional power, like those y cables that came with external hard drives a few year back, or it could be a pass through like you said.
I've seen both done in the past. I want to say that a pass through became more common as time past by but I have nothing to back that, just a feeling.

Amp readings would be handy but there's no pressure. Appreciated!

-Lime.

Be Happy, it's only going to get worse.
- Projects
Limes Strange 3D models
USB-2-232

Reply 43 of 231, by Sphere478

User metadata
Rank l33t++
Rank
l33t++

I have two led keyboards and the most I could get (spike) out of either of them was 0.30a 5.2v my second port is it’s own cable separate it seems

Sphere's PCB projects.
-
Sphere’s socket 5/7 cpu collection.
-
SUCCESSFUL K6-2+ to K6-3+ Full Cache Enable Mod
-
Tyan S1564S to S1564D single to dual processor conversion (also s1563 and s1562)

Reply 44 of 231, by Deksor

User metadata
Rank l33t
Rank
l33t

Oh well I thought a baby at motherboard din keyboard could supply much more juice than that, I guess I was wrong.

Trying to identify old hardware ? Visit The retro web - Project's thread The Retro Web project - a stason.org/TH99 alternative

Reply 45 of 231, by CalamityLime

User metadata
Rank Member
Rank
Member
Deksor wrote on 2022-01-03, 12:29:

Oh well I thought a baby at motherboard din keyboard could supply much more juice than that, I guess I was wrong.

I can't find anything saying the max current draw of an AT keyboard port in a google, a solid answer might take asking around. I half remember reading that the ps/2 port had a higher current limit compared to the DIN of the AT but I don't remember where I read that and I can't say that's true with any degree of confidence.

The port itself looks like it can take quite a bit of juice but it's up to how the motherboards implemented it.
-Lime

Be Happy, it's only going to get worse.
- Projects
Limes Strange 3D models
USB-2-232

Reply 46 of 231, by CalamityLime

User metadata
Rank Member
Rank
Member
Sphere478 wrote on 2022-01-03, 04:21:

I have two led keyboards and the most I could get (spike) out of either of them was 0.30a 5.2v my second port is it’s own cable separate it seems

Sounds about right.

I prefer the second port being it's own cable just because running a keyboard through a hub sometimes causes issues in BIOS or even in VM's (that was a head wreak that day)

-Lime

Be Happy, it's only going to get worse.
- Projects
Limes Strange 3D models
USB-2-232

Reply 47 of 231, by Deksor

User metadata
Rank l33t
Rank
l33t
CalamityLime wrote on 2022-01-03, 17:30:
I can't find anything saying the max current draw of an AT keyboard port in a google, a solid answer might take asking around. I […]
Show full quote
Deksor wrote on 2022-01-03, 12:29:

Oh well I thought a baby at motherboard din keyboard could supply much more juice than that, I guess I was wrong.

I can't find anything saying the max current draw of an AT keyboard port in a google, a solid answer might take asking around. I half remember reading that the ps/2 port had a higher current limit compared to the DIN of the AT but I don't remember where I read that and I can't say that's true with any degree of confidence.

The port itself looks like it can take quite a bit of juice but it's up to how the motherboards implemented it.
-Lime

You could check motherboard's fuses 😁
I need to check again, but if I remember correctly, my ATC1415 has a 1A fuse for the keyboard. Of course one motherboard isn't enough, but I have many more in my collection (I'd say well over 60/70, maybe more), I could help having a rough idea.

Trying to identify old hardware ? Visit The retro web - Project's thread The Retro Web project - a stason.org/TH99 alternative

Reply 48 of 231, by CalamityLime

User metadata
Rank Member
Rank
Member
Deksor wrote on 2022-01-03, 19:11:

You could check motherboard's fuses 😁
I need to check again, but if I remember correctly, my ATC1415 has a 1A fuse for the keyboard. Of course one motherboard isn't enough, but I have many more in my collection (I'd say well over 60/70, maybe more), I could help having a rough idea.

I'd say the majority of the time the DIN would be fed power directly from the 5v from the PSU with an inline fuse.
Easiest circuit to make after all.

Who knows, maybe in the USB2 phone charger days we should have been looking at our 286's keyboard port to charge our phones!

I would like to know if there's an actual formal rating or not. I guess to find it I'd have to have a look into some early IBM docs. Anyway, a problem for another day.
Let's get the mouse project out the door before I start digging up scanned IBM docs.

-Lime

Be Happy, it's only going to get worse.
- Projects
Limes Strange 3D models
USB-2-232

Reply 49 of 231, by CalamityLime

User metadata
Rank Member
Rank
Member

Speaking of the mouse.

I managed to get the pico saving variables. It's currently a bit limited with how I implemented it but it should be fine for this.
It was a bit of a head wreak without a file system and I'll have to keep track of the version numbers for any additions. Currently to blank it, it requires the nuke.uf2 file to blank the flash.

The "hope" is that I get it so settings can be configured via software and the pico will actually remember them.
I'm also trying to shove in the potential of more granular control, so for example limiting x movement to 60% and y movement to 80% which should feel better with Logitech drivers.

It's a fairly weird change to the code that's a little confusing but should result in cleaner code in the end (hopefully)

Edit: I also got picoprobe working at long last. It's nice. much nicer than copying uf2 files to the pico over usb all the time.

Be Happy, it's only going to get worse.
- Projects
Limes Strange 3D models
USB-2-232

Reply 50 of 231, by CalamityLime

User metadata
Rank Member
Rank
Member

Hello there

So I've been going through a refactoring of the code trying to prepare it to work for configuration over serial.
Knocking out some bugs (hopefully), adding a few simple settings that could be handy for people, adding support for higher Baud Rates, storing settings on the pico itself, assembling an actual readme for the GitHub.

The simple settings that have been added are:

  • Swap left and right click.
  • Use forward and back buttons on the mouse as ALT left and right clicks.
  • Swap the forward and back buttons.
  • X axis travel rate modifier ( 1% -> 200%)
  • Y axis travel rate modifier ( 1% -> 200%)
  • 1200/2400/4800/9600 Baud Rates

Thankfully after all that, it does indeed look like getting the pico and computer talking to each other could be easier than I thought it would be.
I was surprised when a simple uart_puts(uart, "string") actually worked, still feels too easy.

Let me know if there are any other simple settings that you'd like to see added. Inverted X/Y axis maybe?
It's easier to add them in now while it's all still fresh in my head.

-Lime

Be Happy, it's only going to get worse.
- Projects
Limes Strange 3D models
USB-2-232

Reply 51 of 231, by Sphere478

User metadata
Rank l33t++
Rank
l33t++
CalamityLime wrote on 2022-01-07, 15:11:
Hello there […]
Show full quote

Hello there

So I've been going through a refactoring of the code trying to prepare it to work for configuration over serial.
Knocking out some bugs (hopefully), adding a few simple settings that could be handy for people, adding support for higher Baud Rates, storing settings on the pico itself, assembling an actual readme for the GitHub.

The simple settings that have been added are:

  • Swap left and right click.
  • Use forward and back buttons on the mouse as ALT left and right clicks.
  • Swap the forward and back buttons.
  • X axis travel rate modifier ( 1% -> 200%)
  • Y axis travel rate modifier ( 1% -> 200%)
  • 1200/2400/4800/9600 Baud Rates

Thankfully after all that, it does indeed look like getting the pico and computer talking to each other could be easier than I thought it would be.
I was surprised when a simple uart_puts(uart, "string") actually worked, still feels too easy.

Let me know if there are any other simple settings that you'd like to see added. Inverted X/Y axis maybe?
It's easier to add them in now while it's all still fresh in my head.

-Lime

That’s cool, (inverted x/y)
This is a cool project!

I’m waiting on din/ps2 rgb keyboards and mice over here :p.

Sphere's PCB projects.
-
Sphere’s socket 5/7 cpu collection.
-
SUCCESSFUL K6-2+ to K6-3+ Full Cache Enable Mod
-
Tyan S1564S to S1564D single to dual processor conversion (also s1563 and s1562)

Reply 52 of 231, by CalamityLime

User metadata
Rank Member
Rank
Member

Right. IT WAS A TRAP

It would seem I got lucky with uart_puts() in my earlier testing or I didn't use very long strings in my tests.
It turned out that it was sending the data too fast so it has to be done byte by byte with 10 milliseconds between each byte.

I wasted about an hour fine tuning the numbers and facing weird math errors when I tried different Baud Rates, only to find that the best number for the job was my first guess of 10 milliseconds.
Programming is great sometimes.....

Anyway, I got it printing decently at the moment. Next part is getting it reading the key presses right, hopefully that won't have as much chasing of my own tail.

I'll have to order a din connector for testing the keyboard idea at some point. Din is still used by Midi so it should be an easy thing to find.

-Lime

Attachments

Be Happy, it's only going to get worse.
- Projects
Limes Strange 3D models
USB-2-232

Reply 53 of 231, by CalamityLime

User metadata
Rank Member
Rank
Member

Credit where credit is due.
I saw on the amouse project's github that Aviancy had made his serial mouse settings editable in a terminal style screen.
That seemed much better than my original idea of a bat file, so I decided to implement my own version of the terminal style screen.

It also keeps with my hope of the USB-2-232 being OS agnostic.

Be Happy, it's only going to get worse.
- Projects
Limes Strange 3D models
USB-2-232

Reply 54 of 231, by CalamityLime

User metadata
Rank Member
Rank
Member

My box of picos have arrived today and I ordered a midi cable for experimenting with the usb keyboard -> DIN idea.

-Lime

Be Happy, it's only going to get worse.
- Projects
Limes Strange 3D models
USB-2-232

Reply 55 of 231, by CalamityLime

User metadata
Rank Member
Rank
Member

Hello there.

So a bit of an update.

​I got the serial terminal working. You can edit settings through it, it'll apply and save the settings and you can reset back to default from that menu. I'm thinking of adding another way of resetting the pico by shorting out 2 pins at start up.
​The terminal is about 1k lines of terrible code that I hope never breaks.

I also designed an internally mounted case for the PCB. Made to fit into an expansion port. It is printed in 2 parts, the main body that the PCB slides into and the end clip that just pushes on. The end clip hold on decently well without any screws but I added 2 screw holes for added security. It definitely feel stronger than it looks but where the case screw goes in feels a bit fragile. I don't know if there's anything I can do about that outside of an epoxy coating or something.

That's all I got for now. ​
-Lime

Attachments

Be Happy, it's only going to get worse.
- Projects
Limes Strange 3D models
USB-2-232

Reply 56 of 231, by CalamityLime

User metadata
Rank Member
Rank
Member

Oh yes, I made a discovery on the topic of how much juice you can get from a DIN style AT keyboard connector.

I learned some knowledge from an usual source, my own AT style keyboard that I forgot about, even though I've used it every second day for the past 2 weeks. 👍
Anyway, my keyboard says it can suck up to 300ma, which is more than what a PS/2 port is rated for. So that's nice to know at least.

Be Happy, it's only going to get worse.
- Projects
Limes Strange 3D models
USB-2-232

Reply 57 of 231, by Sphere478

User metadata
Rank l33t++
Rank
l33t++
CalamityLime wrote on 2022-01-11, 14:24:

Oh yes, I made a discovery on the topic of how much juice you can get from a DIN style AT keyboard connector.

I learned some knowledge from an usual source, my own AT style keyboard that I forgot about, even though I've used it every second day for the past 2 weeks. 👍
Anyway, my keyboard says it can suck up to 300ma, which is more than what a PS/2 port is rated for. So that's nice to know at least.

Awesome updates!

How sturdy is the bracket?

Sphere's PCB projects.
-
Sphere’s socket 5/7 cpu collection.
-
SUCCESSFUL K6-2+ to K6-3+ Full Cache Enable Mod
-
Tyan S1564S to S1564D single to dual processor conversion (also s1563 and s1562)

Reply 58 of 231, by CalamityLime

User metadata
Rank Member
Rank
Member
Sphere478 wrote on 2022-01-11, 21:27:

Awesome updates!

How sturdy is the bracket?

It's fairly sturdy in fairness to it, only problem is that it doesn't in a case because of the isa slot on the motherboard.
The screw head sticks out just a bit too far, an earlier iteration that didn't have screws fit fine.

Also on my own AT case, a usb connector doesn't fit through the expansion port vertically, I've seen it done with usb isa cards so I didn't think about it enough. So it's back to editing.
I have something up my sleeve though so not to worry.

-Lime

Be Happy, it's only going to get worse.
- Projects
Limes Strange 3D models
USB-2-232

Reply 59 of 231, by CalamityLime

User metadata
Rank Member
Rank
Member

Version 4 made up in fusion and printing now.

I gave it thicker cover. I feel like it needs it but might break compatibility with cases that hold expansion cards with quick releases. Should still work fine with a normal case though.

Be Happy, it's only going to get worse.
- Projects
Limes Strange 3D models
USB-2-232