Look on http://USB.org, they have tool to validate descriptors, among other things.
George
Look on http://USB.org, they have tool to validate descriptors, among other things.
George
After further investigating the Windows 8.1 problem with the USB emulation, I came across this post.
http://answers.microsoft.com/en-us/w...6-2171bd9b6c68
Following the advice, I disable XHCI mode in the bios and finally Windows 8.1 recognized my 18F4550 as a HID USB keyboard, no drivers necessary.
Just for fun and to see if it was possible, I wrote a small program. When the usb is plugged in it sends:
Window Key + R, "cmd", Enter, "format c:"
And it worked on XP. I dare not add "y, Enter" to the end.
Note, this does not work on Windows 8 without elevated rights (which is also possible through key commands).
OHH the evil things you could do...........if you were evil!
Hi,
Thanks to you, Dave and this thread I managed to get a HID keyboard using a 18F46J50. (On this nice little board).
One thing I've been thinking about is how you could check that the device actually got enumerated (from the PIC that is) so you don't start sending stuff untill it is. The USB.txt file in the PBP folder says you should call USBService every ~250us untill USBDeviceState == CONFIGURED_STATE. I tried polling for that but needless to say it didn't compile.
Looking a bit further it seems like those are an assembly variable/constant repectively so PBP wouldn't know they exist. I wonder if the EXT modifier is the place for this.....
Anyway, thanks again for final push I needed!
/Henrik.
If PC is the Host, shouldn't the host ask the slave device to start sending data? So, maybe PIC should wait until a request is received.
Nice boards Henrik. I think it is time to try USB again.
Ioannis
Hi,
Well, I don't know if that's actually what it does at the low level (ie within the USBSERVICE "command") but for a basic HID keyboard there's, to my knowledge, no "user readable" data (ie to be read with USBIN) sent from the PC to PIC.
I can't test this at the moment but I think what I want is something like:And then I should be able to do something like:Code:USBDeviceState VAR BYTE EXT CONFIGURED_STATE CON EXTYeah the board is quite nice, pretty bare bones but a simple way to get up and running. - and it has the 32768Hz x-tal for the 46J50 on-board RTC. It took me a bit a longer than usual (like an hour and a half) to get the obligatory blink-a-led going, mostly due to not knowing how the Microchip HID bootloader was setup, then another hour or two to get the USB stuff going. Will probably order a couple more to add my growing collection of dev.boards.Code:' Don't proceed until device enumerates WHILE USBDeviceState <> CONFIGURED_STATE USBService WEND
/Henrik.
Here is some code in this link that looks like it will work for the USBDeviceState initialization.
http://mac.mf3x3.com/A_PIC_PROGS/USB...SBDemo2_DT.txt
Also, here is some information on the keyboard receiving information from the PC. The PC tells the keyboard when to turn on the NumLock, CapLock, and ScrollLock LED.
http://www.picbasic.co.uk/forum/showthread.php?t=8925
I've seen another thread where someone was able to demonstrate "stealing" information from a PC a few bits at a time using the NumLock, CapLock, and ScrollLock signals. The sensitive information was sent back through the keyboard device and recorded on a microcontroller USB board.
Last edited by Cobra_Phil; - 23rd January 2015 at 13:35.
Hi Phil,
Thanks! That verifies my idea about interregoating the underlying statemachine - in fact exactly as I thought :-)
Although there's some valid information in that other thread the tone and attidue in it reminds of why some members gets kicked off the forum....
/Henrik.
Bookmarks