CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

USB Keyboard

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
RAMAROSAONA



Joined: 02 Jul 2010
Posts: 1

View user's profile Send private message

USB Keyboard
PostPosted: Fri Jul 02, 2010 11:09 am     Reply with quote

I want to use a standard USB keyboard (PIH) on a 18F4550 project with LCD.
Is it possible to use the 18F4550 as a USB Host? How can I get the keycodes of the keyboard?
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Fri Jul 02, 2010 2:47 pm     Reply with quote

No.
For a USB host, you need a PIC supporting USB 'OTG', or an external device like the Vinculum.

However....
Every USB keyboard I have seen so far, also works as a PS/2 keyboard. Basically, the USB/PS/2 adapters sold for these, _do not_ contain any adapter electronics. Instead they just alter the wiring directly from the keyboard to the PS/2 port, and the keyboard detects that it is connected to this, rather than to USB, and changes mode automatically.
The wiring is normally:
Code:

USB      PS/2
1           4
2           1
3           5
4           3

You also may need to have about 4K7R pull up resistors on pins 1, and 5 of the PS/2 connector.

PS/2 'host' code, is as common as anything for the PIC.

Best Wishes
newguy



Joined: 24 Jun 2004
Posts: 1907

View user's profile Send private message

PostPosted: Fri Jul 02, 2010 5:09 pm     Reply with quote

Ttelmah,

Completely unrelated and off topic, but do you know if a USB mouse will also auto-switch to PS/2 mode as well? We're kicking around an idea at work and this will greatly simplify things if true.
jbmiller



Joined: 07 Oct 2006
Posts: 73
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Jul 03, 2010 4:56 am     Reply with quote

Mice are the same (at least the ones I have) although I have to use them in PS-2 mode for interrupt mode.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group