Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 23:05 21 Jul 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 OTG Implementation

Author Message
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2949
Posted: 04:29pm 17 Jul 2015
Copy link to clipboard 
Print this post

Hi Bob, Grog, Peter(s), all,

I was going to write this in the thread on the new uMite but I felt it was better to start a new thread.

I have been watching the thread on implementing a USB keyboard with interest..

My personal opinion is that the chip that hobbytronics is offering is along the right path to follow..

PS2 compatible keyboards are going to be harder to find as time rolls on and there are a myriad of USB options (inc keypads) out there it seems a shame to not try to interface this..

The hobbytronics chip is probably priced a bit on the dear side unless you live locally, I priced a 25off purchase (figuring a group buy) and it came to $262aus PLUS credit card/paypal surcharges and exchange rates, Making it around $280 for 25 shipped, then they would need `sub shipping out at around $2 in AUS and $8 international (NZ may be slightly cheaper) this puts the chip at between $13 and $21 landed... Pretty pricey.. especially on a 25 QTY purchase.

The pinout of the chip looks basically identical to the PIC32's we use so MuP or any other uMite board could probably work with it (My MuP-VT or Geoff's ASCII terminal board) may already be able to accomodate this chip with minimal fuss, maybe an addition eeprom (what is that used for? Is it needed?).

But then, I thought if the OTG routines are out there already (microchip supplied) to support OTG on pic32 chips can the community we have here not knock up a hardware/software solution? I am proposing a community design with all we might need to add a `slave' PIC to do the job similar to what the hobbytronics unit offers..

I cannot do any software but I am happy to design a PCB if that is what the community wants..

I am NOT proposing that we try to `copy' or somehow steal the hobbytronics design, in fact I really am impressed with what they have come up with, it is the cost to us antipodeans that makes me balk.. and given that microchip, I believe, supply a lot of routines to support the OTG etc that we could design our own dedicated chip for this purpose.

Ideas? Feedback? Have I missed something here?

My idea, to kick this along, is to use a SSOP version of the '250 pic chip and design it in a long and skinny fashion so that it can be placed inline with a USB `device/keyboard' I expect a board 50mm x 25mm would be the largest for this task (maybe smaller).


Regards,

MickEdited by bigmik 2015-07-19
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2934
Posted: 09:22pm 17 Jul 2015
Copy link to clipboard 
Print this post

All,

When I went on one of the ~MicroChip training days, one of the 'small' projects was to write a USB interface. The training material showed an example of interfacing to a USB keyboard and displaying the characters on an LCD. All this written in C.

As a total non-C coder I was able to follow the instructions in the training material but it meant nothing to me. But I did get it working!!

Last year I was going to build a USB-to-PS2 adaptor based on the training material. I read all about the PS2 protocol and had a couple of tactile switches connected to a PIC which in turn had a PS2 male plug on the end connected to a MaxiMite. When the tactiles were pressed, out came my characters I had hard coded to them on the MaxiMite screen.

Now the concept was to learn enough C, get the training material to read a USB keyboard, push the characters to my assembly code that was spitting out the correct PS2 protocol, and job done. The only problem was I could not find the training material anywhere. I emailed MicroChip several times but without any responses. I spent time Googling but C was too confusing, and in the end I bought a couple of these Keyboard units from HobbyTronics.

To me the solution is simple IF you know C. MicroChip has all the code required to read data from a USB keyboard readily available. To create a PIC with the necessary code in it is a sensible approach but requires a C expert.

HobbyTronics have done half of the job in this module but it is too costly for a basis for anything TBS creates.

Any C expert up for the challenge?? (I just don't have the time) . . . .

WWEdited by WhiteWizzard 2015-07-19
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9603
Posted: 09:53pm 17 Jul 2015
Copy link to clipboard 
Print this post

I'm very interested in this concept, and am actively researching it.

If I discover anything interesting, I will post it here.
Smoke makes things work. When the smoke gets out, it stops!
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10281
Posted: 10:13pm 17 Jul 2015
Copy link to clipboard 
Print this post

The chip to do this with is the PIC16F1454, specifically targeted for USB

14-pin, doesn't need a crystal, £0.85 for one-off pricingEdited by matherp 2015-07-19
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 10:18pm 17 Jul 2015
Copy link to clipboard 
Print this post

The PIC16F1454 does not support HOST functionality. You will need a pic24 or pic32 for that.

Microblocks. Build with logic.
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2949
Posted: 10:19pm 17 Jul 2015
Copy link to clipboard 
Print this post

Hi Peter,

Even better,.... a small and cheap chip..

MikEdited by bigmik 2015-07-19
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10281
Posted: 10:30pm 17 Jul 2015
Copy link to clipboard 
Print this post

  Quote  The PIC16F1454 does not support HOST functionality.


TZ is quite correct.

This chip would work as a replacement for FTDI but not as a keyboard controller
 
Chris Roper
Senior Member

Joined: 19/05/2015
Location: South Africa
Posts: 280
Posted: 10:34pm 17 Jul 2015
Copy link to clipboard 
Print this post

  matherp said   The chip to do this with is the PIC16F1454, specifically targeted for USB

14-pin, doesn't need a crystal, £0.85 for one-off pricing


I have a few of those on order to try as a USB-TTL Serial bridge and add PS/2 Keyboard support (A striped down terminal controller), But shipping to Cape Town is even worse than to Oz, it has been a month so far since ordering and apparently they are now in JHB on the way to Cape Town.

Included in the batch are some PIC32MX270's that I can try and implement a USB host, but I am also a novice when it comes to C Programming so it may take me a while :0

I am impressed with that PIC24 USB device and will try to get some samples in my next order.

If Geoff ever managed to find the time with all his other MM projects I would love to see a MicroMite on the 270MX with USB Host built in, but count me in with trying to contribute as much as I can to a community Project.

http://caroper.blogspot.com/
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3287
Posted: 10:41pm 17 Jul 2015
Copy link to clipboard 
Print this post

The USB host side would be easy enough. Microchip supply the libraries and while they are not drop in modules it would only take a day or two. More difficult would be emulating the archaic PS2 protocol.

It could be done but it would need someone with good embedded skills and the time. That last requirement rules me out.

Geoff
Geoff Graham - http://geoffg.net
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 10:49pm 17 Jul 2015
Copy link to clipboard 
Print this post

I think a USB-Keyboard to serial would be best.
It would then also work as the input device for the console.


Microblocks. Build with logic.
 
Chris Roper
Senior Member

Joined: 19/05/2015
Location: South Africa
Posts: 280
Posted: 10:51pm 17 Jul 2015
Copy link to clipboard 
Print this post

  Geoffg said   The USB host side would be easy enough. Microchip supply the libraries and while they are not drop in modules it would only take a day or two. More difficult would be emulating the archaic PS2 protocol.

It could be done but it would need someone with good embedded skills and the time. That last requirement rules me out.

Geoff


But would it need to spit out PS/2 Protocol?
Could it not just be a straight ASCII Serial output similar to your Terminal Controller Implementation?

EDIT

It could actualy be an All New Version of the Terminal Controller Project if you had USB input and LCD output on the PIC32 with a TTL/Serial interface to the MM.

Edited by Chris Roper 2015-07-19
http://caroper.blogspot.com/
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2949
Posted: 12:03am 18 Jul 2015
Copy link to clipboard 
Print this post

Hi Geoff, All,

I never visualised this project as a PS2 keyboard interface but as a general USB OTG input to serial/i2c/spi/general IO pin interface..

Serial if not easy to implement spi or i2c would be fantastic and easy to handle.

Regards,

Mick



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

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3287
Posted: 02:32am 18 Jul 2015
Copy link to clipboard 
Print this post

Quite right, serial would be much easier (tunnel PS2 vision on my part). I just wish that I could be around to give it a go.

Geoff
Geoff Graham - http://geoffg.net
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1129
Posted: 12:21pm 20 Jul 2015
Copy link to clipboard 
Print this post

I just ordered a couple of CH376S U Disk Modules to play with. Theoretically they should be able to do keyboards also. Googling "CH376S keyboard module" finds a few other hits...
Visit Vegipete's *Mite Library for cool programs.
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 06:45pm 12 Aug 2015
Copy link to clipboard 
Print this post

G'Day all
The Arduino DUE can act as a USB host so I ordered one for $24 which arrived yesterday. It took some setting up because the supplied cable was faulty but once up and running with the software available I can now press the A key and get all sorts of useful info up on a terminal.
So all we need is a few if statements to do the conversion and some available software to do the serial conversion and we have a USB to MM thing.
Is this worth going on with?
Peter
 
Chris Roper
Senior Member

Joined: 19/05/2015
Location: South Africa
Posts: 280
Posted: 07:13pm 12 Aug 2015
Copy link to clipboard 
Print this post

  PeterB said   G'Day all
The Arduino DUE can act as a USB host so I ordered one for $24 which arrived yesterday. It took some setting up because the supplied cable was faulty but once up and running with the software available I can now press the A key and get all sorts of useful info up on a terminal.
So all we need is a few if statements to do the conversion and some available software to do the serial conversion and we have a USB to MM thing.
Is this worth going on with?
Peter


Personally I would prefer to see it implemented on a PIC18F or a PIC32MX250, purely on the basis that most of us playing / working with the Mite's already have the development tools / programmers for Microchip Devices and could flash our own chips and integrate them into PCB designed.

Adding an Arduino DUE to a Micromite Project is more likely to end up with potential users coming to the conclusion that the whole app could fit in the Arduino DUE so why add a Micromite, unless it becomes a dedicated Display driver.


http://caroper.blogspot.com/
 
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