Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:04 11 May 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : USB keyboard VS terminal input speed

Author Message
ebbandflow
Newbie

Joined: 31/08/2023
Location: United States
Posts: 35
Posted: 11:50pm 04 May 2025
Copy link to clipboard 
Print this post

Hello all, I have been working on a little text editor on the picomite for the last few months that targets hd44780 based character LCDs. Until recently I have been using the keyboard via terminal to both write the program and enter text in it while running, but this weekend I switched over to the picomite USB firmware v6.00.01 and connected a USB keyboard directly to the picomite for testing. Straight away I noticed that the speed that I am able to enter characters into the program is much slower than via the terminal, approximately half as fast. Unfortunately the input speed is too much of a bottleneck now, as it dramatically impacts performance, especially after knowing how much faster it can be via the terminal input.

I figure there is a good chance I am doing something wrong here, so I thought I may ask before looking for alternatives. I have no idea but was considering that possibly the extra processing on the picomite's end may be the cause? Do all directly connected keyboards experience this issue or maybe should I try a ps2 variety? I appreciate all input and ideas towards a solution.

Regards,
James

Edit:

Thought I'd add a few pics  




Edited 2025-05-05 11:52 by ebbandflow
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 971
Posted: 03:28am 05 May 2025
Copy link to clipboard 
Print this post

try to adjust repeatstart and repeatrate
OPTION KEYBOARD REPEAT 200,25

From the manual.

OPTION KEYBOARD REPEAT
firstchar,nextchar
----------------------------------
Define the repeat characteristics of the USB keyboard when a key is
held down.
'firstchar' is the time in milliseconds before a new character repeats.
Default is 600mSec, the valid range is 100 to 2000 mSec
'nextchars' is the time in milliseconds before subsequent character
repeats. Default is 150mSec, the valid range is 25 to 2000 mSec




Works on latest version but probably there is you version.
Edited 2025-05-05 14:40 by disco4now
Latest F4 Latest H7 FotS
 
ebbandflow
Newbie

Joined: 31/08/2023
Location: United States
Posts: 35
Posted: 10:42am 05 May 2025
Copy link to clipboard 
Print this post

  Quote  try to adjust repeatstart and repeatrate
OPTION KEYBOARD REPEAT 200,25


This helped a lot, thank you! It's still not *quite* as responsive as a keyboard via terminal but it's workable now and I'm back in action!

One oddity I noticed was the Alt key modifier does not seem to work, but I should have more than enough Ctrl-char combinations for hotkeys.

Thank you for the pointer!
 
mozzie
Senior Member

Joined: 15/06/2020
Location: Australia
Posts: 109
Posted: 10:53am 05 May 2025
Copy link to clipboard 
Print this post

G'day James,
Have only just started using the USB firmware + keyboard however I can confirm that it is much slower than the PS2, tested on HDMIUSB and VGA(PS2) so perhaps not a direct equivalent, but it is noticeable even at my two finger typing rate.
With PS2 it is difficult to tell if you can type faster than the PICO can respond.
With USB it is easy to miss characters if you can really type.

Also tried a couple of different keyboards in case one was cr*p

Tested on HDMIUSB060002cr21 / 2350VGA060002cr21

As disco4now suggests, the typematic rate might also make a difference.

Regards,
Lyle.
 
ebbandflow
Newbie

Joined: 31/08/2023
Location: United States
Posts: 35
Posted: 11:05am 05 May 2025
Copy link to clipboard 
Print this post

Hello Lyle,

Thank you for the confirmation regarding the typing speed and dropped characters via USB. Lowering the repeat timeout helps when backspacing and repeat chars but if I type very quickly it is easy to get ahead of the pico. Good to know that ps2 keyboards do not suffer the same issues, I'll have to give one of those a try as well.

Best,
James
 
Amnesie
Guru

Joined: 30/06/2020
Location: Germany
Posts: 529
Posted: 11:25am 05 May 2025
Copy link to clipboard 
Print this post

Hello,
I've noticed this too. This is one of the reasons I stick to the PS/2 version. USB is some kind of "lagging".

Greetings
Daniel
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7505
Posted: 12:13pm 05 May 2025
Copy link to clipboard 
Print this post

USB is generally slower to decode, I think, but it's a lot more flexible. PS2 is using serial TTL which has a lot less software overhead.

Don't forget to include level shifting if your PS2 keyboard won't work from 3V3 (not all will). Failure to do so can occasionally  result in a dead Pico.
.
Edited 2025-05-05 22:15 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
mozzie
Senior Member

Joined: 15/06/2020
Location: Australia
Posts: 109
Posted: 12:39pm 05 May 2025
Copy link to clipboard 
Print this post

G'day James,

That is a great looking unit you have built and is there anything Lego can't do?

This is a bit off topic but those pics gave me a sense of Deja vu...

The unit shown below was built for a mate when he had his voice box removed due to cancer, whilst waiting for his talking valve to be fitted and learning to use it.
Turns out he types slower than I do, so not sure how useful it was but it was a great learning curve.









The Palm keyboard outputs IRDA and a PIC16F88 decodes it and outputs the ASCII codes to the LCD's and controls power etc. Took about 3 days to figure out the keycodes etc.
Battery life is great, its been on a shelf for years and although 1 battery had leaked the others still showed signs of life.

Regards,
Lyle.
 
ebbandflow
Newbie

Joined: 31/08/2023
Location: United States
Posts: 35
Posted: 01:27pm 05 May 2025
Copy link to clipboard 
Print this post

Thanks Lyle! I found that keyboard with lego along the top and knew it would be useful. It's not in the final form yet, but great for testing in the interim.

Thanks for sharing about your project for your friend, that's really awesome of you to do for them and quite ingenious of you to use two displays like that! I'm impressed. Did you implement word wrap and scrolling? I'm using those and horizontal scrolling too, with the screen contents being a window into the buffer.

It's been a GREAT learning experience!
 
ebbandflow
Newbie

Joined: 31/08/2023
Location: United States
Posts: 35
Posted: 01:32pm 05 May 2025
Copy link to clipboard 
Print this post

@ Daniel
Thanks for confirming

@ Mixtel
Thanks, that's what I was figuring too... extra work on the picomites end to work the USB. Thankfully I have some level shifters ready to go if needed
 
mozzie
Senior Member

Joined: 15/06/2020
Location: Australia
Posts: 109
Posted: 02:29pm 06 May 2025
Copy link to clipboard 
Print this post

G'day James,
Sounds like your unit is far more advanced, I got as far as moving an uncompleted word to the next line and scolling the text up, punctuation and upper / lower case but that was about it.

This was all written in assembly language on a PIC16F88, I only wish the original MicroMite was around back then (2006).

Regards,
Lyle.
 
ebbandflow
Newbie

Joined: 31/08/2023
Location: United States
Posts: 35
Posted: 02:58am 09 May 2025
Copy link to clipboard 
Print this post

In assembly too?!    I'd disagree that mine is more advanced, the code is held together with spit and duct tape lol! But it's (mostly) working, so that gives me motivation to keep improving the project, plus it's been a fun way to learn.

RE: my input speed issues, I ended up making a USB -> PS2 converter from an extra RP2040 Zero flashed with the ps2x2pico firmware. I skipped the level converter shown in the github and instead added a 4.7k pullup resistor from GP 13 to GP11 (PS2 Data) and GP 13 to GP12 (PS2 Clock), and then connecting those to the picomite and linking VBUS between the two picos as well as GND. Now I can use a USB keyboard with the input speed of a PS2.  

https://github.com/No0ne/ps2x2pico
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025