Use the Device Configuration Tool to prepare a matching set of USB and clock settings. If you are new to the library, choose a small HID data or CDC test first.
Polling means your main loop keeps calling the USB service. USB interrupt means the PIC calls a handler when USB needs attention. Use the starting code the tool generates for your choice.
Make the settings, step by step
- Press New.
- In Hardware, select the exact PIC target preset.
- Select External crystal frequency, or Clock Recovery where it is offered. Select the wanted MCU clock frequency (Fosc). See PIC and clock setup for help with these choices.
- In System, select the device class. Select the HID profile in HID if applicable.
- Press Apply profile packet defaults after selecting the class/profile. This supplies compatible packet sizes and transfer settings.
- Choose Foreground polling or USB interrupt servicing where the class supports it. Begin with the generated loop for that choice.
- In Identity, enter the product information, identifiers and power information for your device.
- Complete the relevant HID, CDC, MSC or Network settings. You do not need to configure unused classes.
- Review Registers. Keep the generated clock settings together and adjust other defaults only for your actual board.
- Read Summary and resolve all configuration errors. Save your project with Save as….
The PIC16F1454/1455/1459 and PIC16LF1454/1455/1459 entries support HID, CDC and MSC through their own implementation inside USB_Device.inc. Browser/RNDIS and ping-pong buffering are unavailable on these six targets. Read their memory and silicon requirements in PIC16 setup and memory planning.
See also
Created with the Personal Edition of HelpNDoc: Streamline Your CHM Help File Creation with HelpNDoc