Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

USB keyboard interfacing with PIC microcontroller

Status
Not open for further replies.

drbizzarow

Advanced Member level 1
Joined
May 24, 2006
Messages
414
Helped
25
Reputation
50
Reaction score
15
Trophy points
1,298
Activity points
3,662
hi guys !!!!
any body have experience in interfacing pic with usb key board ??? pls share your experiences like code, schematics, articles.
if i have already interfaced PS2 keyboard ....this time i have to do it with usb KB.

i am badly need it pls HELP!!!!.

thanks in advance.
 

Vinculum VNC1L

sorry but unless you are talking about a high end pic with USB host (not a simple pic18f4550 usb device or any PIC16F) you would need some kind of USB host.

if you already interfaced with PS2 shouldn't you consider a USB to PS2 Converter??? (but don't forget that it's diferent from a PS2 to USB dongle)
 

thx all of you for reply ...... their are convertor available in a market through which i can connect USB keyboard to PS2 keyboard port..... i want to design the same one
 

This adapter will work only if the keyboard/mouse support USB and PS2 mode. Most of newest keyboards/mouse not support anymore PS2 mode, so this adapter cannot be used

How do you mean that?


I have new keyboard 2 weeks old, and this keyboard works over PS2 adapter also!

Many manufacturer supply PS2 adapter in box with keyboard!

Also he didnt say that he have old or new or newest keyboard. How You know that this will not work on his keyboard?

Please explain?

Some keyboards dont support PS2 I agree with that, but we cant know what keyboard he have.
 
Last edited:

As I mentioned, if the keyboard support PS2 mode the adapter will work perfectly.
I have also USB keyboard that works perfectly in PS2 mode, but I bought one (a cheap one :) )few weeks ago and that not support PS2 mode
 

SOOOOO can any body tell me how to use USB keyboard with pic micro-controller ???
i try to use USB to PS2 convertor with microcontroller ......but it did not work :S.
 

**broken link removed**
did you use one of these...
i know that they work almost perfectly...
unless you try tu use scancode 3 in PS2 then it doesn't work with every keyboard....

if you use cheaper ones (small ones like @tpetar linked) you will need a good keyboard with both USB asn PS2 support...


remember if you want to use USB keyboard directly with a PIC you need an host USB pic like a PIC24FJ256GB106
 

me too, have a similar requirement
want to design a standalone usb host .. using pic mcu (a small 8 bit, 8 pin one)
there are several new 8 pin pic mcu's with inbuilt 32MHz oscillator ..
thats much faster than the other solutions for pic hid device solutions around
so i feel that this is possible for sure
.. would love to have sth to start with ,..
but even if i dont find anything .. i am proceeding along ..
will post updates of progress ....
anyone interested can join or share experie
 

me too, have a similar requirement
want to design a standalone usb host .. using pic mcu (a small 8 bit, 8 pin one)
there are several new 8 pin pic mcu's with inbuilt 32MHz oscillator ..
thats much faster than the other solutions for pic hid device solutions around
so i feel that this is possible for sure
.. would love to have sth to start with ,..
but even if i dont find anything .. i am proceeding along ..
will post updates of progress ....
anyone interested can join or share experie

Some attempts were made with MAX3421, I didn't follow that thread, so use search to find out how far they had proceeded ..
It's not an easy task, though, I can assure you ..

:wink:
IanP
 
  • Like
Reactions: DrWhoF

    DrWhoF

    Points: 2
    Helpful Answer Positive Rating
thx for the reply ..
nice projects .. great work ..
however i am working on something different ..
i was able to google and fins relevant threads for "firmware based usb hid device" (managing low speed usb i/o via GPIO pins of PIC)
what i am aiming to do is " firmware based usb host " (managing usb keyboard, USB pendrive .. or similar devices using PIC GPIO pins)
the usb pendrive project is good .. and also close to what i am aiming to do .. but i donot want to start with a pic that has inbuilt usb host (usb transceiver)
 

nice hint .. thx ..
i want to d it with a non - usb device .. need not be a PIC though
and preferably a small one .. 8 pin or sth :-D
i wouldnt mind to start with limited functionality .. keyboards only.. or usb stick only .. but want to do it in a small device
and i am not looking for a usb 2.0 interface .. usb 1.1 is the target.

---------- Post added at 16:46 ---------- Previous post was at 16:41 ----------

You plan to make something like USB HID Hub ?


Also see this project (but Atmel):
https://codeandlife.com/2012/03/03/diy-usb-password-generator/

yup .. closer ..
yes - i dont mind using atmel avr ..
there is a avr project VUSB .. with usb hid devices using atmega8 .. and attiny45 ..
this is where i take my inspiration from ..
only that i want communication the opposite direction .. want the attiny to act as host .. \
not a usb hub exactly .. just one usb hosst port with limited functionality
 

mmm if you don't need to be pic....
what purpose will it have??

i always suggest the Vinculum VNC1L as it's a complete usb host solution.. in one chip... and you can buy not the IC but one of the modules... so it's ready to use...

unless you are planning to design or lear about USB host... in that way i suggest the firmware only AVR- usb host a pain to understand but seems legit... :smile:
 
**broken link removed**
did you use one of these...
i know that they work almost perfectly...
unless you try tu use scancode 3 in PS2 then it doesn't work with every keyboard....

if you use cheaper ones (small ones like @tpetar linked) you will need a good keyboard with both USB asn PS2 support...


remember if you want to use USB keyboard directly with a PIC you need an host USB pic like a PIC24FJ256GB106

yes i want to use usb KB diretly with pic......... is there any host code for PIC for usb KB????
 

@Kurenai_ryu
thanks for the nice link
i want to design exactly what they have done .. though they did it much more perfect ..
i may not be able to document it so well .. since i work alone . .. and only in free time ..
but i still feel taht i would liek to use a pic ( since i want to use a small mcu .. and a cheap one - pic offers cheaper solutions )
had a look at the code .. cant use it either .. but i really appreciate those guys .. a nice piece of work .. and very good documentaion

Meanwhile, i have an update about my own work .. was able to get the usb 1.1 specifications .. for host design .. descriptors .. transfers etc ..
and was able to get a clear idea of the .. protocols .. timing specifications and other basics of usb host design
currently doing some sample coding to test the communication basics

@drbizzarow
i can suggest you a few pics .. which donot need any special coding .. and have built in usb support
your choice depends upon your budget, coding skills and availability in your area
PIC18F4550
PIC18F1xK50
PIC32MX210F016D
PIC24FJ32GB004
PIC32MX230F064C

The last one would be the easiest to use .. with sample code from microchip too
BTW there are also USB to PS2 adaptors which can handle ps2 only mouse (with some circuitry inside) which ofcourse comes at much higher cost

If none of the above are feasible just wait for code to be released for a smaller pic
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top