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
Keyboard USB
Moderator: Benj
-
- Posts: 311
- Joined: Sat Jan 12, 2008 2:08 am
- Has thanked: 104 times
- Been thanked: 47 times
- Contact:
-
- 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
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.
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
― C.S. Lewis
-
- Posts: 311
- Joined: Sat Jan 12, 2008 2:08 am
- Has thanked: 104 times
- Been thanked: 47 times
- Contact:
Re: KEYBOARD USB
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
I use conector USB B to A
-
- 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
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.
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
― C.S. Lewis
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 311
- Joined: Sat Jan 12, 2008 2:08 am
- Has thanked: 104 times
- Been thanked: 47 times
- Contact:
Re: Keyboard USB
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
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
- 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
Hello,
Here is a very old Flowcode example for a PS2 device.
Let me know how you get on.
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
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel