Test one step at a time. Begin with the generated startup code and one small application action. This makes it easier to see whether a problem comes from the board setup, USB connection or your new code.
Work through this checklist
- Compile: no errors; expected RAM and program-memory usage; correct device selected.
- Start: the board runs at the intended clock; PLL startup finishes; USB_Init() succeeds.
- Enumerate: the PC sees the intended class and USB_Configured becomes 1.
- Receive: a known host command produces the expected bytes, file request or input-slot value.
- Transmit: the host receives a known reply and checks its actual content.
- Repeat: exchange many commands; check ordering, length, and what happens when the receiver is temporarily busy.
- Reconnect: unplug/replug and repeat; discard incomplete application messages on reset or detachment.
- Pause/resume: check host suspend and resume; resume application transfers only when their prerequisites are satisfied.
- Add workload: enable displays, sensors, storage and other interrupts one at a time, repeating the transfer test.
On another PIC, first check its exact clock, memory and interrupt setup. A working HID transfer is a useful hardware test, but it does not exercise every CDC control request, MSC storage command or network transaction. Also test the actual class and servicing mode that the final product uses.
Pick the closest symptom
See also
Created with the Personal Edition of HelpNDoc: Easily create HTML Help documents