2
\$\begingroup\$

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.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ You may want to try getting the samples working unmodified first. \$\endgroup\$ Commented Aug 3, 2014 at 15:36
  • \$\begingroup\$ I am able to compile the examples for other PICs but there is none for PIC18F24K50. But yeah that is a very good idea. I do have an old PIC18F4550 lying around somewhere. \$\endgroup\$
    – Mikael
    Commented Aug 3, 2014 at 19:26

1 Answer 1

2
\$\begingroup\$

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/

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.