User manual

Table Of Contents
mikroC PRO for PIC32
MikroElektronika
605
Library Example
This example establishes connection with the HID terminal that is active on the PC. Upon connection establishment,
the HID Device Name will appear in the respective window. After that software will wait for data and it will return
received data back. Examples uses USBdsc.c descriptor le, which is in the same folder, and can be created by the
HID Terminal.
Copy Code To Clipboard
char cnt;
char kk;
char readbuff[64];
char writebuff[64];
unsigned long int i = 0;
void main(void){
CHECON = 0x32;
AD1PCFG = 0xFFFF;
HID_Enable(&readbuff,&writebuff);
while(1){
USB_Polling_Proc(); // Call this routine periodically
kk = HID_Read();
if(kk != 0){
for(cnt=0;cnt<64;cnt++)
writebuff[cnt]=readbuff[cnt];
HID_Write(&writebuff,64);
}
}
}
HW Connection
USB connection scheme