dSPIC33EP USB Not Attaching
Hello, Rookie here so bear with me please
I am trying to run a MLA demo (MSD Simple Demo) on my dspic33EP256MU806 to learn about USB communication. I am really just trying to learn how to write a file on a thumb drive. I have a 8MHz crystal attached between OSC1 and OSC2 with 33pF capacitors.
To adapt the demo to my dspic33, I commented out these two lines (in system.c) and changed my clock settings for my crystal.
// #pragma config ALTI2C2 = OFF
// ANSELA = 0X0000;
The microcontroller initializes fine, but in the debugger fails to ever leave the "WAITING_FOR_ATTACH:" state.
FILEIO_ MediaDetect always comes back false. I've tried figuring this out, but I can't guess as to why the USB is not being attached. My guess is the Vbus cap being too low? Do I need a higher cap, like 150uF? Or is the problem in the code that I'm not seeing?
The schematic is pretty simple,
VBUS -> 10uF cap -> 5V
D- to Pin 36 RG3
D+ to Pin 37 RG2
GND - GND