Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-03

Accessing USB HID from Lazarus programs?

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bo Berglund

I need to create a program using Lazarus/FPC to access a data collection device built using a PIC24F series microprocessor with built-in USB support. The firmware makes the PIC processor register as a Human Interface Device (HID) class USB device.

I understand that for the HID class one does not have to provide a USB driver, there is already a generic one on Windows and possibly also on Linux.
And the HID interface is not limited to mice and such, for example the PicKit3 PIC programmer and ICE uses the HID driver and it can both program code into PIC:s and execute PIC code with breakpoints from within MPLAB (the PIC develeopment IDE).

My objective is to read the data from the data collection device using the USB interface and display the data on screen and also save to the PC disk.
My FPC program should be able to run on Windows and preferably also on Linux.

But I can't find any good examples on how to access the USB HID device....

Can someone here please provide some help, links to code examples or similar?

Or is this OT for this list since it is basically a hardware access question?

Bo Berglund Developer in Sweden

Reply by email

Peter Williams

Hi Bo,

I found these 2 links with google. They discuss the unit libusb which seems to work (I have NOT tried it myself). http://laurensdelangeelectronics.blogspot.com/2011/01/interfacing-with-usb-parallel-port.html It appears from the article that it only works as a linux superuser. I suggest that it would probably work in Windows. http:/msg08338.html

PEW

Show quoted text 44 lines
To: From: Date: Sun, 20 Mar 2011 10:04:28 -0500 Subject: [Lazarus] Accessing USB HID from Lazarus programs? I need to create a program using Lazarus/FPC to access a data collection device built using a PIC24F series microprocessor with built-in USB support. The firmware makes the PIC processor register as a Human Interface Device (HID) class USB device. I understand that for the HID class one does not have to provide a USB driver, there is already a generic one on Windows and possibly also on Linux. And the HID interface is not limited to mice and such, for example the PicKit3 PIC programmer and ICE uses the HID driver and it can both program code into PIC:s and execute PIC code with breakpoints from within MPLAB (the PIC develeopment IDE). My objective is to read the data from the data collection device using the USB interface and display the data on screen and also save to the PC disk. My FPC program should be able to run on Windows and preferably also on Linux. But I can't find any good examples on how to access the USB HID device.... Can someone here please provide some help, links to code examples or similar? Or is this OT for this list since it is basically a hardware access question? -- Bo Berglund Developer in Sweden -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110321/963d4cf0/attachment.html>

Reply by email