Did you find this in the forum ?
http://www.picbasic.co.uk/forum/show...oard+emulation
Did you find this in the forum ?
http://www.picbasic.co.uk/forum/show...oard+emulation
Oh, you naughty aerostar! I guess alzheimer is knocking my door...
Too much info on this USB mess... Lost the links I kept in case I needed them back.
Thanks people for the info.
Henrik, if you find your test code, please do post it. Will save me some time I am sure.
Ioannis
I made keyboard to use as shortcuts for EAGLE. Should be exactly what you need. I used it on easypic dev board. Pic should be 18F4550.
Here is complete project My UsbKeyboard.zip
I created that using many examples from forum...
Thank you very much pedja089!
Looks great and very close to what I need to do. have to add a small graphics display and test it on Win 10. Hope Win 10 do not pose any communication problem.
Really appreciated.
Ioannis
I used it on win7, and if I remember correctly on XP. It should work on win10.
You have keys.PBP, with all defined keys, also in .doc document you have codes.
Also USBSERVICE should be called every 10mS or so. I wanted to implement it with DT INT, but newer did...
It should be something like this
This code is also from forum, but never tried it.Code:INCLUDE "DT_INTS-18.bas" INCLUDE "ReEnterPBP-18.bas" ASM INT_LIST macro ; IntSource, Label, Type, ResetFlag? INT_Handler USB_INT, _SERVICE_USB, ASM, yes endm INT_CREATE ; Creates the interrupt processor ENDASM USBINIT 'INITIALIZE USB USBSERVICE 'SERVICE USB UIE = $7F 'ENABLE USB INTERRUPTS UEIE = $9F 'ENABLE USB ERROR INTERRUPTS @ INT_ENABLE USB_INT SERVICE_USB: USBSERVICE @ INT_RETURN
Thanks for this tip also. I had in mind to make this Interrupt driven service but in a later stage.
Ioannis
Thanks to your help I am making a progress after a lot of experimenting. Sure I do not understand the whole process but anyway...
I managed to enumerate the PIC and display on an open text file a short string of characters from an 8 byte buffer.
How can this buffer made bigger? I changed these in the main program
but still sends only the half buffer.Code:USBBufferSizeTX con 16 USBBufferSizeRX con 16 USBBufferCount Var Byte USBBufferIn var byte[16] USBBufferOut Var Byte[16]
Then I changed in the hid_desc.bas file this line
from 0x08 to 0x10 but still no joy. I attach the descriptor file.Code:retlw 0x10 ; This should be the size of the endpoint buffer
Any idea?
Ioannis
P.S. I also changed
#define HID_INT_OUT_EP_SIZE 8
in the descriptor file to 16 but still sends 8 byte buffer...
Last edited by Ioannis; - 18th December 2021 at 21:06.
Bookmarks