PDA

View Full Version : USB keyboard emulator



Toley00
- 27th August 2006, 23:48
I'm very close to make it work. I used EasyHID with the Descriptor find in that topic http://www.picbasic.co.uk/forum/showthread.php?t=2872 (curiously this link can only be found by making a search...) I've made some modifications but even with the original file I have the same problem.

Everything is OK compilation is done without any bug, the enumeration is also perfect (the PC really think a keybord is in). I've put a button and when I press it the letter "a" should be send. When I push the button it works but too much... I have "aaaaaaaaaaaaaaaaaaaaaa....." send endeless. My button works don't be worry I already test it.

I give the pbp code in attachment but I don't think the problem is inside. I also verified the Descriptor file and it looks like the parameter found in the USB.org files. If you have any idea it will be appreciate cause I think I've tried all but the right thing to do. Thank you very much.

Dave
- 28th August 2006, 12:02
Toley00, Unless you can release the button realy fast, your code as written will re-enter the subroutine while the button is being pressed. At the speed of the osc I am surprised that you arn't getting more "aaaaaa's". You need to check for the button being released and bypass the call if it is, before you check for it being pressed.

Dave Purola,
N8NTA

Toley00
- 28th August 2006, 17:26
Thank you for your answer Dave but even when the button is release aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa never stop til I reset the PIC or unplug it. The problem is not the button it's sowhere else, is there a kind of break code in USB like in PS/2 keyboard ?

skimask
- 29th August 2006, 01:42
You are waiting for the pin to be low. Do you have a pullup on your pin so when it's released the pin has 5v on it?

Toley00
- 29th August 2006, 01:52
Finally I found a way. After I send a key code, I clear all the buffer bytes and do another send with all buffers to 0. I'm not sure this is the right way to do it but it work as expected. Naturally I did a little delay (as suggest by Dave) to make sure only 1 code is send. But since it's not the final use of my project the button will disapear. Thanks to everybody here.

skimask
- 30th August 2006, 01:28
Is it really that easy to do a USB interface, such as what was done here with the keyboard emulator? PBP 2.46, a PIC w/ USB, and a few simple 'included' files and the required wiring to the connector?

I've been using the FTDI chips all along and just switched over to the CP2103, but I've been wanting to get rid of the 'middle man' with a USB-PIC.
I've been wanting to make some custom PCBs and enclosures for simulated aircraft controls (radios, heading bugs, ya know, front panel stuff) like you'd use with FS2K or whatever (Falcon 4, the list goes on).

Thoughts?

mister_e
- 30th August 2006, 03:13
It's not as this hard, but you may have to learn the PC side too. The hardware is pretty simple.

pbauman
- 8th November 2009, 20:49
I keep getting errors when I try to compile the code generated by EasyHID:

Error[113] c:\pbp\pbppi18l.lib 723 : Symbol not previously defined (USBDeviceInit)
Error[113] c:\pbp\pbppi18l.lib 723 : Symbol not previously defined (USBDeviceInit)
Error[113] c:\pbp\pbppi18l.lib 723 : Symbol not previously defined (USBDeviceTasks)
Error[113] c:\pbp\pbppi18l.lib 723 : Symbol not previously defined (USBDeviceTasks)
Error[113] c:\pbp\pbppi18l.lib 723 : Symbol not previously defined (GetUSB)
Error[113] c:\pbp\pbppi18l.lib 723 : Symbol not previously defined (GetUSB)
Error[113] c:\pbp\pbppi18l.lib 723 : Symbol not previously defined (PutUSB)
Error[113] c:\pbp\pbppi18l.lib 723 : Symbol not previously defined (PutUSB)

I am running PBP 2.60 with MPLabs 8.15a and a PIC18F4550.

Can anyone help me to figure out what is going on and suggest anything to try to fix this?
Thanks

Chris Barron
- 23rd November 2009, 10:19
I'm just starting a project using USB mass storage device types, does anyone know if there are plans for an 'easyMSD', similar to easyHID, or an easy way to use easyHid for my purposes ?

I want to use internal flash to store files, and am going to use SDFS to handle the FAT file side of things.

rickeybell
- 30th January 2010, 05:22
pbauman, did you find out what was causing your problem, I have the same problem with the same configuration.

Thanks,
RB

sotomag
- 22nd February 2011, 02:07
Hi Everyone,

I´m new in this...
I saw the published file and I have a doubts.. what is the USBService instruction? what it do? how it relates USBproject file with the descriptor file?

Thanks..!

psenek
- 15th March 2011, 18:48
I keep getting errors when I try to compile the code generated by EasyHID:

Error[113] c:\pbp\pbppi18l.lib 723 : Symbol not previously defined (USBDeviceInit)
Error[113] c:\pbp\pbppi18l.lib 723 : Symbol not previously defined (USBDeviceInit)
Error[113] c:\pbp\pbppi18l.lib 723 : Symbol not previously defined (USBDeviceTasks)
Error[113] c:\pbp\pbppi18l.lib 723 : Symbol not previously defined (USBDeviceTasks)
Error[113] c:\pbp\pbppi18l.lib 723 : Symbol not previously defined (GetUSB)
Error[113] c:\pbp\pbppi18l.lib 723 : Symbol not previously defined (GetUSB)
Error[113] c:\pbp\pbppi18l.lib 723 : Symbol not previously defined (PutUSB)
Error[113] c:\pbp\pbppi18l.lib 723 : Symbol not previously defined (PutUSB)

I am running PBP 2.60 with MPLabs 8.15a and a PIC18F4550.

Can anyone help me to figure out what is going on and suggest anything to try to fix this?
Thanks

I think this could be the cause of your problems:

USB_DEV.ASM, USB_DEV.INC, USB_MEM.ASM, the class assembler and include files
and the project descriptor file, as well as any desired sample programs,
should be copied to the project source subdirectory before being used.

(USB.TXT in PBP260\USB18)

Make sure you copy USB_DEV.ASM, USB_DEV.INC, USB_MEM.ASM into project directory.
Worked for me.

All best

Demon
- 23rd January 2012, 00:57
Jim's posts moved in a new thread:
http://www.picbasic.co.uk/forum/showthread.php?t=16028

Robert