As a beginner with PIC HID communication, I started by trying the HID Read-Write Example of MikroC's (4.60) help.
So... It works... but only one time !
Some explainations :
I send a character ('8' for example) using HID Terminal, so I see the PIC immediately responds something like:
0x38, 0x00, 0x00, 0x00, 0x00 [...]
So I try with another character ('A' for example), and I got no answer from the PIC on the HID terminal.
Then, I can try to send anything, the HID Terminal crashes (button 'Send' remains pushed and nothing happens, I can't click anywhere...). Until y reset the PIC, if I try restarting the HID Terminal, my PIC which was seen as a "My PIC Device" as I called it, gets named "Device VID=1234 PID=0001"...
As I can handle a bit C# programming, I made a program to use the HID communication with the PIC, but same problem: first sending : OK, second sending : OK but no answer, and third sending : my application crashes.
I'm using a 18F2450, and the example I use is this one :
unsigned char readbuff absolute 0x500; // Buffers should be in USB RAM, please consult datasheet
unsigned char writebuff absolute 0x540;
USB_Interrupt_Proc(); // USB servicing is done inside the interrupt
ADCON1 |= 0x0F; // Configure all ports with analog function as digital
CMCON |= 7; // Disable comparators
HID_Enable(&readbuff,&writebuff); // Enable HID communication
Does someone experienced this problem ? Do you know how can I solve it ?
Thanks in advance,
(I'm French and I hope my English is not too bad)