Electronic – PIC18F24K50 vendor-defined USB device using libusb, what is needed

picusb

I'm trying to learn how to communicate with a PIC18F24K50 through USB. I read somewhere that a vendor-defined device plus libusb/Winusb is to be referred over HID and CDC for cross-platform custom USB applications.

My first goal is to log ADC data from the PIC to a text file. However, I cannot find any good examples on how to get the 18F24K50 working as a USB device. In particular, how do I setup the USB device descriptor file? How do I setup the MCU for USB? I've tried adapting Microchips Application Library examples and several other examples but without success. Any pointer in the right direction would be highly appreciated.

I'm using xc8 compiler and pk2cmd programming software from the command line (linux terminal) but I can also use MPLAB X IDE and xc8 if that is easier.

Best Answer

You may Refer to following link, it's for PIC24 but procedure may be same for PIC18 to use Microchip application libraries:

http://www.engscope.com/pic24-tutorial/14-3-setting-up-the-usb-framework/

Related Topic