Re:Interface an USB to dsPIC33EP512MU814 microcontroller
I'm sorry if my answer is obtuse, but I wanted to make sure that you meant the PIC will act as the "device" and not as the host. It may have been a typo on your part. Remember that the PC will always act as host as that is the USB protocol. The PIC must wait for the PC to communicate on the bus. If you are just getting started I would recommend downloading the Microchip Libraries and studying the code examples for your specific device family and how it relates to the information found in the datasheet for your specific device. Keep posting questions. Be as specific as you can be and people will be happy to help where they can. Again, I understand it is difficult at times via a blog post to discern exactly what people are looking for so I apologize if this was too basic an answer for just getting started. Keep asking specific questions. Also, if you really want to understand the process, use the example code only for reference. Write your own code and take each step (enumeration, communication, etc.) one at a time. This will make troubleshooting much easier and greatly increase your level of understanding. The prebuilt code examples are great for testing your hardware configuration, but that's where I would leave them.
If at first you don't succeed, you obviously didn't use enough brute force.