Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 20:34 26 Nov 2024 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 : hid2cdc - USB keyboard and mouse for picomite VGA

     Page 4 of 6    
Author Message
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2135
Posted: 11:56am 09 Jan 2024
Copy link to clipboard 
Print this post

Although Mode 1 is monochrome it can be "colourized" with tiles.
The editor can use colour coding provided the font size matches the tile size.

OPTION LCDPANEL CONSOLE 1
OPTION COLOURCODE ON
Edited 2024-01-09 22:19 by phil99
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2350
Posted: 01:06pm 09 Jan 2024
Copy link to clipboard 
Print this post

i'm sure the height of those tiles could be changed... although for the purposes of testing monochrome is just fine. note - this is the first time i've actually used a picomite VGA, about a week back i soldered together the VGA interface cable. prior to now i had no idea of how bad the default font really was.


cheers,
rob   :-)
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4234
Posted: 01:07pm 09 Jan 2024
Copy link to clipboard 
Print this post

Hi Robert,

The picomiute vga 640x480 mode is monochrome in 8x12 font.
The characters are on a 8x12 tile, and each tile can be programmed for background and foreground color, as such simulating full color text.

The built in editor has been adapted to use the tiles to colorcode the text.

Other fonts can be selected or used (such as a 8x16 font).
The tiles can be adapted in size (such as 8x16 size).

But the automatic coloring of text in the editor is at the moment fixed to 8x12 size font and tiles. Actually, when you start the editor, it will default to MODE 1 and use this font.

Volhout
Edited 2024-01-09 23:07 by Volhout
PicomiteVGA PETSCII ROBOTS
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2350
Posted: 01:35am 13 Jan 2024
Copy link to clipboard 
Print this post

  Volhout said  [...] Other fonts can be selected or used (such as a 8x16 font).
The tiles can be adapted in size (such as 8x16 size). But the automatic coloring of text in the editor is at the moment fixed to 8x12 size font and tiles. Actually, when you start the editor, it will default to MODE 1 and use this font.


Volhout: from what you say, it sounds like it would be relatively easy to allow the editor to operate with other fonts that are 8-pixels wide. does anyone who has built the picomite VGA source before care to experiment with this?

NoOne has just released an update that fixes some small anomalies with the function keys and has the start of support for non-US keyboard layouts. as before, available here:
https://github.com/No0ne/hid2cdc/raw/main/hid2cdc.uf2


question... in terms of mainstream layouts, i am aware of:
QWERTY - English US, UK, NZ, AUS
AZERTY - used in France, Belgium
QWERTZ - German, Austria, Switzerland

does this cover the majority of mmbasic (cmm2 and picomite VGA) users?

and what other things would folks like to see made available on the HID2CDC? support for RTC, mouse, serial ports, access to additional GPIO pins?


cheers,
rob   :-)
Edited 2024-01-13 11:37 by robert.rozee
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2135
Posted: 02:50am 13 Jan 2024
Copy link to clipboard 
Print this post

For the few who use the PicoVGA for embedded tasks access to more pins (inc. the ADC ones) could be useful. Not needing the PS/2 kb. and moving the RTC over to it help in that regard.
There are some who hanker for a mouse though not important to me.
For serial, even if only regular I/O can be done that frees up pins for serial on the PicoVGA.

NoOne has been doing an excellent job.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6790
Posted: 08:13am 13 Jan 2024
Copy link to clipboard 
Print this post

If you are going to mess with editor fonts please remember the restrictions placed on you by VGA. The timing is fixed because the Pico can't clock the output any faster to get a higher resolution, therefore you get a fixed number of pixel rows.

For best efficiency you need a font that equally divides into 480 pixel rows in mode 1  You can't get round this.

Using 12 dot high characters
You can get 40 rows of characters in mode 1 and 20 rows in mode 2 because it uses pixel doubling.

Using 16 dot high characters
You can get 30 rows of characters in mode 1 and 15 rows in mode 2.

This is just for the simplest mono system. When you add colour it becomes a little more complex as it isn't a character mapped display in either mode, it just looks like one. Everything is actually bitmapped into a frame buffer.

If you do make changes, particularly to the editor, then you will be in danger of creating an incompatible system. You shouldn't need to change the editor anyway - that's not what a program user sees.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2350
Posted: 10:18am 13 Jan 2024
Copy link to clipboard 
Print this post

  Mixtel90 said  [...]If you do make changes, particularly to the editor, then you will be in danger of creating an incompatible system. You shouldn't need to change the editor anyway - that's not what a program user sees.


as you say, the video output from the picomite VGA is a fixed 640 x 480 pixels. through line and pixel doubling this also gives a 320 x 240 mode. in 320 x 240 each pixel is represented by 4 bits (ie, 16-colour). in 640 x 480 each pixel is represented by 1 bit, but then this 1 bit selects into an array of 4-bit tiles that are 8 pixels wide by 12 or more pixels high.

within these parameters there is no good reason (as far as i can see) to constrain the editor to using an 8 x 12 pixel font. i'm not suggesting changing the font width, just the height. according to the 5.07.07 PicoMiteVGA User Manual, Page 97:
TILE HEIGHT n  "Sets the height of the tiles. ‘n’ can be between 12 and 480"

incidentally, there is not even good reason for the font height to divide exactly into 480. it would just entail leaving a few blank lines at the top or bottom of the screen if it did not divide exactly. but as it happens, 16 pixels high gives exactly 30 lines. 20 pixels high gives exactly 24 lines.

as for while a program is running, currently this (as well as the command prompt) is governed by the persistent setting:
OPTION LCDPANEL CONSOLE [font [, fc [,bc]]]  "The arguments are optional but if supplied must be numbers, 'font' is the default font [...]"

so as it stands, an arbitrary run program can not make any assumptions about the current number of columns or lines on screen - any system where the user has typed OPTION LCDPANEL CONSOLE n (where n<>1) at the command prompt is an "incompatible system". the upshot, that a program needs to always start with the line:
OPTION LCDPANEL CONSOLE n
to ensure universal compatibility. of course, when contained in a program this option setting is not persistent.


cheers,
rob   :-)
Edited 2024-01-13 20:19 by robert.rozee
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 213
Posted: 10:46am 13 Jan 2024
Copy link to clipboard 
Print this post

Hi all
To connect a USB keyboard to PicoMite, I use this USB-PS/2 converter adapter. I assembled it according to a simple scheme, without “extra” parts. It’s even possible to connect an additional mouse via the PS/2 interface, but I don’t know how?
I got the firmware for this adapter here:
https://github.com/No0ne/ps2x2pico
It would be nice to update this firmware with a software USB Hub...

 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2350
Posted: 01:24pm 13 Jan 2024
Copy link to clipboard 
Print this post

have just posted the below to the issue list on github:

i have a tentative idea for mouse support without needing to make any changes to the PicoMite VGA source code:

1.  have mouse wheel up/down movement permanently translate to the up/down arrow keys:
VK_UP: escape+"[A"
VK_DOWN: escape+"[B"

2.  have two key combinations to enable and disable mouse reporting: alt-M turns it on, alt-N turns it off. an alternative would be to hijack the use of scroll-lock, but this key may be missing from some compact keyboards. maybe provide for both options?

3.  if mouse reporting is currently turned off, temporarily turn it on while the left or right mouse button is held depressed.

4.  translate mouse movement to arrow key escape sequences when mouse reporting is on as follows:
VK_UP: escape+"[A"
VK_DOWN: escape+"[B"
VK_RIGHT: escape+"[C"
VK_LEFT: escape+"[D"

some scaling of mouse movement may be needed, and the rate of arrow movements limited to, say, 10 reports per second. this rate could perhaps be adjustable, as could X and Y scaling factors, selected using some alt- key combinations. or just use alt-1 to alt-9 to select between 9 different sets of presets.

as far as i can see, the above should give us:

- mouse wheel always works in editor to scroll up/down.
- within the editor one can 'drag' the edit cursor using the mouse while holding down one of the mouse buttons.
- within games, there is a means for the user to turn on mouse reporting without need for holding down the mouse button continuously, and thereafter use the mouse instead of the arrow keys.


this is all just an idea to mull over for the moment! does it sound usable?


cheers,
rob :-)


addendum: ctrl-E and ctrl-X may be better choices for mouse wheel movement, that way within a game mouse wheel up/down rotation and mouse movement could perform different functions.
Edited 2024-01-14 00:09 by robert.rozee
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2350
Posted: 02:59pm 16 Jan 2024
Copy link to clipboard 
Print this post

looks like No0ne has now released version 1.0 of HID2CDC, which includes an option for German keyboard layout (QWERTZ), as well as presetting the power-on numlock state.

the URLs to everything have now changed, see below...

complete release directory:
https://github.com/No0ne/hid2cdc/releases/tag/1.0

readme file:
https://github.com/No0ne/hid2cdc/blob/main/README.md

uf2 file:
https://github.com/No0ne/hid2cdc/releases/download/1.0/hid2cdc.uf2

the pin usage for this verion is:
GPIO0 serial debug output at 115200n8
GPIO2 initial numlock state, jumper to GND for numlock ON
GPIO3 ctrl-alt-del reset output, optionally connect to RUN on the picomite
GPIO6 jumper to GND for QWERTZ keyboard support


can folks please test, particularly with German/QWERTZ keyboards, and PLEASE REPORT BACK YOUR RESULTS. if we can keep up the momentum i am hopefully of seeing No0ne add mouse support of some sort for use with the editor and games, and am myself thinking about how best to add RTC and SD card support - i think i've found a way to 'kludge together' a back channel for fast (12Mbps) 'private' device communications between HID2CDC and picomite over the USB link.


cheers,
rob   :-)
Edited 2024-01-17 01:00 by robert.rozee
 
Pluto
Guru

Joined: 09/06/2017
Location: Finland
Posts: 358
Posted: 05:18pm 16 Jan 2024
Copy link to clipboard 
Print this post

This is a very interesting possibility for getting keyboards from our region to co-operate with PicoMiteVGA. It is mostly the non-alphabetic signs that make the use of PicoMiteVGA problematic with our keyboards. (Stickers on most of the keys is not very pleasant!)
Would it also be possible to get the Swedish keybord included?
Swe keyboard

NB: Swedish keyboard is also the default in Finland.

Pluto
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2350
Posted: 05:29pm 16 Jan 2024
Copy link to clipboard 
Print this post

  Pluto said  This is a very interesting possibility for getting keyboards from our region to co-operate with PicoMiteVGA. It is mostly the non-alphabetic signs that make the use of PicoMiteVGA problematic with our keyboards. (Stickers on most of the keys is not very pleasant!)
Would it also be possible to get the Swedish keybord included?
Swe keyboard

NB: Swedish keyboard is also the default in Finland.

Pluto


do you have a github account? they are relatively trivial to set up, then you can raise an issue requesting the author, No0ne, to add Swedish keyboard support here:
https://github.com/No0ne/hid2cdc/issues


cheers,
rob   :-)
 
Pluto
Guru

Joined: 09/06/2017
Location: Finland
Posts: 358
Posted: 05:39pm 16 Jan 2024
Copy link to clipboard 
Print this post

Thanks Rob!
I made a request.

Pluto
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2350
Posted: 02:50pm 19 Jan 2024
Copy link to clipboard 
Print this post

  Pluto said  Thanks Rob!
I made a request.Pluto


looks like No0ne has posted a test version with Swedish support:
https://github.com/No0ne/hid2cdc/files/13990437/hid2cdc-swe.zip

i don't know how you select it, i've asked the question:
https://github.com/No0ne/hid2cdc/issues/4#issuecomment-1900546827
hopefully he will answer shortly.


cheers,
rob   :-)


addendum: No0ne has just replied to my query - Swedish is the default in the test .uf2 file

Edited 2024-01-20 01:10 by robert.rozee
 
Pluto
Guru

Joined: 09/06/2017
Location: Finland
Posts: 358
Posted: 03:27pm 20 Jan 2024
Copy link to clipboard 
Print this post

That's great.
Unfortunately I am too busy with other things right now, so I cannot set up a test today. May be tomorrow.
Thanks to you Rob and to NoOne!

Pluto
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 830
Posted: 07:50pm 20 Jan 2024
Copy link to clipboard 
Print this post

Can anybody help me? Somehow nothing works for me.

I have a hub with a plug-in power supply, which also sends out a voltage via the input.
I have connected the board flashed with the .uf2 to the input of the hub, the keyboard and the PicoMiteVGA are connected to two of the outputs.

The PicoMiteVGA works, but the keyboard does not respond at all.
The board with the hid2cdc shows no signs of life at all - is that normal? (no lit or flashing LED...)

I have tried two different keyboards. What am I doing wrong? What else could I try???

Any help would be appreciated!

Frank
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2350
Posted: 09:26pm 20 Jan 2024
Copy link to clipboard 
Print this post

hi Frank,
   the LED on the HID2CDC pico should be lit, have you checked that the HID2CDC is getting power? it could well be that your hub is not feeding power back to the host (HID2CDC), but only to the downstream devices (picomite and keyboard). i use a hub that takes power from the host, hence i just feed 5-volts directly into VBUS (pin 40, ground returned to pin 38) of the HID2CDC pico.

see RED and BROWN wires in the below photo, they connect back to a 5-volt supply:




cheers,
rob   :-)
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 830
Posted: 09:56pm 20 Jan 2024
Copy link to clipboard 
Print this post

Hi Rob,

thank you for your answer!
If I plug in the PicoMiteVGA instead of the HID2CDC, it runs - so there is voltage.
However, the HID2CDC does not light up at all, no matter how I supply it with voltage!

Frank
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2914
Posted: 10:20pm 20 Jan 2024
Copy link to clipboard 
Print this post

Hi Frank, All,

I was about to post that my HID2CDC doesn’t light either but then I thought, I just updated to the latest firmware and I should test it.

Well the HID2CDC led does indeed light, so if you are getting power which it looks like you are it must be the firmware isn’t flashed into the HID2CDC Pico,

Try reflashing it, now there is no indication of when it is finished on the PC so I leave it for roughly 15seconds to make sure.

To prove the LED isn’t some sort of connectivity or communication indicator I plugged my HID2CDC module into a USB power plug pack so there would be no communication and indeed the LED lights up.

If you still can’t get it to work try downloading the firmware again in case it got corrupted or try another PICO chip

Regards,

Mick
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2914
Posted: 10:35pm 20 Jan 2024
Copy link to clipboard 
Print this post

Hi All,

I found my wireless kb I used to use when I was working, it’s been sitting in my old tool bag for over 5 years,  I decided to test it on the HID2CDC and of course the battery is dead flat, after charging for 30m I was able to get it to power up.

It’s one of these tiny cheap as crap (and crap as crap)





I can confirm that the wireless keyboard does indeed work on the HID2CDC, however I was getting multiple key presses for each key, like the autorepeat triggered immediately, I had to quickly tap the keys to get single characters. I will let it fully charge or find a new battery as this one is looking sad and try it again, I also should try on my PC to see if it’s the keyboard or something with the HID2CDC.

Watch this space,

Regards,

Mick

EDIT***

After a day of charging the battery fully, that fast repeat has gone, HID2CDC works fine with wireless (dongle based) keyboards



Mik



.
Edited 2024-01-21 18:05 by bigmik
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
     Page 4 of 6    
Print this page
© JAQ Software 2024