Keyboard USB

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
electron67
Posts: 311
Joined: Sat Jan 12, 2008 2:08 am
Has thanked: 104 times
Been thanked: 47 times
Contact:

Keyboard USB

Post by electron67 »

Hi, I want connect a keyboard USB to PIC18F2550 without use the PC; when press a letter or number show in the LCD the key pressed and led on in binary, but is a little confused. I send the program. I can use e-block eb-055 to connect the keyboard, but + V out USB connect to +5v :?:

Thank you
Attachments
Keyboard USB.fcf
Program
(14.5 KiB) Downloaded 292 times

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: KEYBOARD USB

Post by kersing »

For what you want you need for USB host or USB on-the-go functionality and PIC 18 series only offer slave functionality.

Are you sure the keyboard can be connected to the eb055? The USB keyboards I know use USB type A plugs. The eb055 provides an USB type B port.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

electron67
Posts: 311
Joined: Sat Jan 12, 2008 2:08 am
Has thanked: 104 times
Been thanked: 47 times
Contact:

Re: KEYBOARD USB

Post by electron67 »

I want a switch multiple; identify the key presed calling "x" convert of binary to decimal and switching a relay; without use PC.
I use conector USB B to A

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: KEYBOARD USB

Post by kersing »

Sorry to disappoint you, but what you want can not be done with a PIC18F2550.

Starting at the beginning, there are three types of USB devices:
1) USB Host, examples: computer, media player. These devices have a USB type A socket.
2) USB Slave, examples: keyboards, mouse, USB flash drive, USB disk drive. These devices have a USB type A plug, USB type B socket or mini/micro USB connector.
3) USB On-The-Go, examples: some mobile phones. For more information see this explanation

For USB to work you have to connect a USB Slave to a USB Host.

The Flowcode for PIC USB components (including the HID component you are using) are for slave devices. The keyboard is a slave device. So you are trying to have a slave device talk to a slave device, that will not work without a master like a computer in between.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Keyboard USB

Post by Benj »

Hello,

Kersing is correct a 18F2550 cannot host a USB device.

Would a PS/2 Keyboard be an option? These can work with pretty much any microcontroller.

electron67
Posts: 311
Joined: Sat Jan 12, 2008 2:08 am
Has thanked: 104 times
Been thanked: 47 times
Contact:

Re: Keyboard USB

Post by electron67 »

Ok; I can read in the PC the letter o number pressed in the keyboard, write in the "x" variable, compare with "y" data, and send a "1" logic to pin out of microcontroler ?
You have to ejemple or where I can learn to do this ? :?:
Also I can use a keyboard PS/2 whitout PC You have a ejemple; Ben say is possible..

Thank you

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Keyboard USB

Post by Benj »

Hello,

Here is a very old Flowcode example for a PS2 device.

Let me know how you get on.
Attachments
EB033_test.zip
(260.78 KiB) Downloaded 333 times

Post Reply