Find the supplied examples

… visits
Parent Previous Next

You do not have to start with an empty program. The USB download includes PIC examples, Windows test apps and browser pages. Choose the example closest to what you want to make, get it working, then change one part at a time.

Which folder do I need?

Look for these folder names in the supplied USB download. Keep each example's files together when copying it to your working folder.

Folder

What it gives you

Use it for

PIC Templates

Basic USB interrupt setup examples for tested PIC devices

Seeing how the interrupt declaration, startup and handler fit together

Framework

Tested working examples for the USB use cases

Starting with a working PIC program instead of building everything yourself

CDC Data → PC Host App

Visual Basic/WPF source for the Windows CDC test app

Opening a COM port and exchanging commands with CDC firmware

HID Data → PC Host App

Visual Basic/WPF source for the Windows HID test app

Exchanging fixed-size HID data messages with HID firmware

RNDIS → Built In Pages

HTML pages for the examples that keep the web page in the firmware

Starting from the browser page that matches the supplied test firmware

RNDIS → External Page

HTML pages for the external-page examples

Keeping an editable browser page on the PC

Here, PC Host App means a Windows program talking to your PIC device. It is not firmware that makes the PIC act as a USB Host.

Start with Framework

  1. Choose the USB use case you want: HID data, CDC serial, an input device, files or a browser page.
  2. Copy its working example into your own project folder. Keep the supplied example unchanged so you can return to it.
  3. Read its setup notes. Match the PIC, clock, configuration settings and board connections to the hardware you are using. A tested example for one board is not a drop-in setup for every PIC.
  4. Compile and program the small example first. Use its matching PC app or browser page where supplied.
  5. Confirm the expected result, then add your own action or measurement.

If you want a new program instead, use the configuration tool's Integration output for your exact device. Do not paste a second complete startup listing over a working Framework example.

Use PIC Templates to understand interrupts

An interrupt lets USB call its handler when it needs attention. This takes more setup than polling: the program needs the right interrupt declaration, startup settings and handler for the PIC.


Open the PIC Templates example for a matching tested device and follow how those pieces join up. It is a setup example, not a replacement for the full Framework program. Keep the generated context-saving and interrupt code together; copy application ideas only after checking the device settings.


Polling is simpler to follow because the main loop calls the USB service. Once you understand the interrupt example, it is easier to see which parts a polling program does not need. Select the intended servicing method in the tool and follow Keep USB running, rather than deleting pieces from an interrupt example at random.


See Set up USB interrupts for the device-family details.

Use the Windows source folders

The two PC Host App folders contain source code for basic Windows test applications. They are useful as they are, and as a starting point for your own buttons, readings and controls.


Open Build the Windows test apps for the basic Visual Studio 2026 steps. Then use the CDC app guide or the HID app guide to match the app to your firmware.

Use the RNDIS HTML folders

Start with the HTML page that belongs to the chosen test firmware. The page and firmware must use the same value names and command meanings.

Folder name and tool setting are different things. The tool's Built-in page mode uses the page supplied inside the library and needs no custom HTML import. Use the matching example's settings when trying files from the Built In Pages folder.

The page-location guide explains what to copy and when the PIC needs programming again.

See also

Created with the Personal Edition of HelpNDoc: Easily create HTML Help documents