User manual
mikroPascal PRO for PIC32
MikroElektronika
567
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.mpas descriptor le, which is in the same folder, and can be created by 
the HID Terminal.
Copy Code To Clipboard 
program HID_Read_Write_Polling;
var cnt, kk : char;
var readbuff : array[64] of char;
var writebuff : array[64] of char;
begin
 CHECON := 0x32;
 AD1PCFG := 0xFFFF;
 HID_Enable(@readbuff,@writebuff);
 while TRUE do
 begin
 USB_Polling_Proc(); // Call this routine periodically
 kk := HID_Read();
 if (kk <> 0) then
 begin
 for cnt:=0 to 63 do
 writebuff[cnt]:=readbuff[cnt];
 HID_Write(@writebuff,64);
 end ;
 end;
end.
HW Connection
USB connection scheme










