The Integration tab is the best starting point for a new project. Copy it as a complete program before adding your own features. The code examples elsewhere in this manual are smaller pieces, not replacements for the generated board setup.

For a new program, open Integration and use Copy tab. Copy the complete listing, not just the lines visible in the picture.
If you are using a working example from Framework, keep its startup code together and check its PIC and clock settings. The steps below explain the alternative of starting from the tool's complete Integration listing. Do not paste two complete startup programs into one file. See the supplied folders.
Open Integration, press Copy tab, and paste the result into a new .bas file. Use this complete starting program. It keeps the PIC choice, clock, configuration fuses, USB settings and startup in the right order.
Copy Integration once. It already contains the needed Defines, ISR and page tables. Pasting those tabs into it again creates duplicate code.
Keep the include order. On PIC18 and PIC16, put the USB include before your own variable declarations and before other includes that allocate variables. This reserves the USB memory safely. On PIC16 the USB descriptor table must be at the start of RAM. Use the application-declaration position shown in the generated program.
Created with the Personal Edition of HelpNDoc: Full-featured multi-format Help generator