6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 24, 2024 5:37 am

All times are UTC




Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Tue Apr 04, 2023 5:37 am 
Offline

Joined: Mon Jan 19, 2004 12:49 pm
Posts: 988
Location: Potsdam, DE
Is anyone able to recommend a stand-alone module which will take as input both of a USB keyboard and mouse (or perhaps a combined wireless module like the logitek kb/mouse combinations) and spit out a convenient data stream which can be easily understood/decoded? Either serial (ideally TTL level/polarity, not RS232) or SPI - I am seriously not a fan of I2C solutions.

Alternatively, a similar module to handle the famous purple/green PS2 kb/mouse - though I suspect that PS2 is getting a bit long in the tooth?

Or alternatively alternatively, any hints as to a convenient set of pins to use a 65c22 to talk to PS2 interfaces? I'm looking at the CB1/2 pins, but I've only cast an eye over it and not investigated yet in detail.

Thanks,

Neil


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 04, 2023 6:09 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
barnacle wrote:
any hints as to a convenient set of pins to use a 65c22 to talk to PS2 interfaces? I'm looking at the CB1/2 pins, but I've only cast an eye over it and not investigated yet in detail.

This page of Daryl's (forum name 8BIT) might be helpful:
https://sbc.rictor.org/pckb6522.html

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 04, 2023 6:21 am 
Offline

Joined: Mon Jan 19, 2004 12:49 pm
Posts: 988
Location: Potsdam, DE
Thanks, Garth. I'd come across Daryl's driver before but couldn't recall where :) and it looks as if it would require very little change to handle my setup.

I've found (answering my own question) a couple of modules https://www.sunrom.com/p/usb-mouse-deco ... ial-output and https://www.sunrom.com/p/usb-keyboard-b ... ial-output but they're an Indian supplier (I'm typing this from an airport hotel in Delhi which is probably why) so I don't know yet whether delivery to DE is going to be possible. I'll keep looking.

Neil


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 04, 2023 6:35 am 
Offline

Joined: Mon Jan 19, 2004 12:49 pm
Posts: 988
Location: Potsdam, DE
And there's an interesting chip available at LCSC: https://www.lcsc.com/search?q=ch9350 (data sheet in English http://www.wch-ic.com/downloads/CH9350DS_PDF.html) which /may/ be able to do the job - if it does, it's a winner.

neil


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 04, 2023 8:00 am 
Offline

Joined: Fri Jan 25, 2019 2:29 pm
Posts: 193
Location: Madrid, Spain
There are some interesting CHxxx ICs.

I'm in the (extremely early) design stage of a 65816 full fledge computer. One of the requirements is to have a very generic USB support. At least keyboard, mouse, and storage.

I have not tried yet, so please take this with a pinch of salt.

I have this IC in mind :

http://www.wch-ic.com/products/CH376.html

It has a direct interface for an SD Card. Also, USB port for keyboard, mouse, or another mass storage. It is supposed to have built in filesystem management options. It has SPI interface, and a more typical parallel one to connect it to a MCU/CPU.

Sounds like a good candidate to me!


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 04, 2023 8:40 am 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1488
Location: Scotland
I went down this route for another project last year - there are some DIP PIC chips pre-programmed to present a parallel interface given a USB keyboard, but the solution I went for at the end of the day was an old Pi 1B which has 2 USB ports.

The down-side... Well You either put up with Linux, or do what I did and bludgeon a baremetal system into it. And I don't use the word bludgeon lightly. Most of the baremetal code I found was of a dreadful quality - it's the millennial "write and move on" quality. However I did fine enough USB code out there to make keyboard and mouse work and just about enough code to make the SD card work.

The other down-side of something like a Pi is the 3.3v to 5v interface (assuming your 65xx is 5v). Not insurmountable, but adds to the issue.

USB is just ugly and ill conceived - but my reasons for this was because PS/2 keyboards are now really hard to get new - almost all are now genuine USB so the passive USB/PS2 adapters don't work with them.

Good luck - and let us know what you get in the end.

Cheers,

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 04, 2023 9:28 am 
Offline

Joined: Wed Jun 23, 2021 8:02 am
Posts: 166
Not that hard to get hold of. You can still get PS2 keyboards here:

https://www.amazon.co.uk/Perixx-Periboa ... B07VPTYDTJ
https://www.amazon.co.uk/Perixx-PERIBOA ... B01M4GIVOY

They are a bit more expensive than a low end usb keyboard though. Alternatively there's always ebay...


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 04, 2023 9:34 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
[oops, crossed in post]

Certainly feels like we all have the motivation to get a USB working, at least for keyboards... is the Pi Pico part of a solution? It would, again, need a level shifter.


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 04, 2023 9:46 am 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1488
Location: Scotland
kernelthread wrote:
Not that hard to get hold of. You can still get PS2 keyboards here:

https://www.amazon.co.uk/Perixx-Periboa ... B07VPTYDTJ
https://www.amazon.co.uk/Perixx-PERIBOA ... B01M4GIVOY

They are a bit more expensive than a low end usb keyboard though. Alternatively there's always ebay...


Indeed, but my clients view was that they'd not be around forever and wanted a more future-proof solution, or at least a proof of concept solution.

Cheers,

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 04, 2023 9:51 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
The Maxim MAX3421E is a USB IC that can act as a host or a peripheral, and is interfaced by SPI.
https://www.analog.com/en/products/max3 ... t-overview

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 04, 2023 9:57 am 
Offline
User avatar

Joined: Fri Aug 03, 2018 8:52 am
Posts: 746
Location: Germany
I am currently writing some code to interface the CH376 with my 65816 SBC via Software SPI over a 65C22.
you can easily get one of those chips as a module on sites like amazon. but those use a 3.3V regulator to power them meaning the IO is 3.3V as well. so you need to desolder the regulator and bridge the left and center pads to have it run at 5V with 5V IO.

anyways the chip has some quirks, like only being able to set the file pointer and not read it out, and file paths having to be split up into their individual directories, which you then need to manually open one after the other. plus the port doesn't regonize any devices plugged through a USB Hub, so if you want multiple USB Devices you would need multiple chips.

but other than that it's pretty simple to work with and gives easy access to FAT32 formatted USB Drives.
though i had no idea the chip can also be used for HID, maybe i overlooked that in the datasheet?

another option would be using an off-the-shelf microcontroller (i know the CHxxx chips are just USB capable micrcontrollers, but the firmware is fixed), and use some existing software, or even write something custom.
for example the PIC16F1455, it's less than 3 USD per chip and has a built-in USB 2.0 host controller without needing an external crystal. the 14 IO pins are more than enough to build an SPI Interface with some spare pins for signaling (like interrupts, or a reset/abort input).
the main downside of the chip is the tight memory. 1kB of RAM and 14kB of Program Flash. fitting an entire FAT32 file system, HID handler, and potential USB Hub support in that would be pretty difficult!
there is also the STM32F105R8x6, a more expensive than the PIC (~6-7 USD) but you get 64kB of RAM and Flash, it runs at 3.3V but has 5V tolerant IO so no level shifting required.

Mouser links:
PIC16F1455
PIC24FJ256GU405 (forgot to mention this one, just as cheap as the STM32 but with waaaay more Flash and RAM, seems worth looking into)
STM32F105R8T6

i think i might get myself that PIC24 (if i can find out how to program it) or one of those STM32's, put it on a custom board and see how difficult to write and space consuming an USB Interface would be.


Last edited by Proxy on Sat Apr 08, 2023 1:39 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 04, 2023 4:47 pm 
Offline

Joined: Mon Feb 15, 2021 2:11 am
Posts: 100
In addition to the MAX chip GARTHWILSON mentioned, and the CH376 daniMolina referred to, I've been looking at the FTDI VNC1 and VNC2 product lines. They have a chip that can act as USB host or device, and can be interfaced to a microprocessor or microcontroller via RS-232-like serial or SPI. They've also got both modules (e.g. VDRIVE2, VDRIVE3) and dev boards (e.g. VDIP2, V2DIP2-48, etc.) based on it that, though some apparently require a programmer to make full use of.


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 04, 2023 5:50 pm 
Offline
User avatar

Joined: Fri Aug 03, 2018 8:52 am
Posts: 746
Location: Germany
i actually have a breakout board with a VNC2-32 chip on it because it also interested me.
2 USB controllers in a single package at such a price seemed really interesting.
but so far i haven't gotten the VNC2-Debugger to work so i'll have to look into programming it via UART, plus from what i've seen online the documentation around these chips seems rather lacking compared to the PIC/STM32's


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 05, 2023 5:54 am 
Offline
User avatar

Joined: Tue Feb 28, 2023 11:39 pm
Posts: 257
Location: Texas
Sean wrote:
In addition to the MAX chip GARTHWILSON mentioned, and the CH376 daniMolina referred to, I've been looking at the FTDI VNC1 and VNC2 product lines. They have a chip that can act as USB host or device, and can be interfaced to a microprocessor or microcontroller via RS-232-like serial or SPI. They've also got both modules (e.g. VDRIVE2, VDRIVE3) and dev boards (e.g. VDIP2, V2DIP2-48, etc.) based on it that, though some apparently require a programmer to make full use of.


I found those chips after scrutinizing the 65816 development board that WDC has. My goal was to find a part that I at least had some idea could be interfaced to the 65xx chips. The data sheet for them seems straight forward enough.


Top
 Profile  
Reply with quote  
PostPosted: Thu Apr 06, 2023 3:28 pm 
Offline

Joined: Mon Jan 19, 2004 12:49 pm
Posts: 988
Location: Potsdam, DE
I agree; the CH374 looks like a possibility also, though I'd love to see a demonstration project - or at least a flowchart. As Gordon says: USB is not the most obvious nor the most simple possible implementation of a serial link. But that's what the majority of keyboards and mice use...

This is a possibility: https://www.hobbytronics.co.uk/usb-host-board-v24 and they also sell the bare chip to which you can add their software though possibly not if you use Linux as I do. Though I am not a fan of PIC in any shape or form; too much fighting with them in the past... I can't believe that people haven't bounced off this problem in the past and produced a generic solution.

I find the idea of bolting a rPi of some flavour onto the side of a 6502, um, unaesthetic. Even though it provides a number of things which are simply not easily attainable to the average hobbyist, like HDMI video, and obviously mouse and keyboard passthrough, I have to ask myself in that case, why bother with the 6502?

Neil


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 40 guests


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 post attachments in this forum

Search for:
Jump to: