I was able to run this, with pickit2. Before i was using MPLAB ICD2. I think ICD2 is not directly compatible to program these devices. But, I was reading the programmed content, but somehow my chip was damaged, when I checked with pickit2. Thanks all of you for your guidance.
Yes the 12MHz is the right crystal i guess. The PLL is fixed to 4, so we get 48MHz for full speed. I just took these config from Honken USB stack found in SVN (from file configWords.h).
// configword 0x300005 #pragma config HFOFST = OFF #pragma config MCLRE = ON
// configword 0x300006 #pragma config STVREN = ON #pragma config LVP = OFF #pragma config XINST = OFF
// configword 0x300008 #pragma config CP0 = OFF #pragma config CP1 = OFF
// configword 0x300009 #pragma config CPB = OFF #pragma config CPD = OFF
// configword 0x30000a #pragma config WRT0 = OFF #pragma config WRT1 = OFF
// configword 0x30000b #pragma config WRTB = OFF #pragma config WRTC = OFF #pragma config WRTD = OFF
// configword 0x30000c #pragma config EBTR0 = OFF #pragma config EBTR1 = OFF
// configword 0x30000d #pragma config EBTRB = OFF #include <p18cxxx.h>
#endif
My schematics include minimal components like, 12 MHz external quartz crystal, 2x22pF across the crystal, 470nF across Vusb and Gnd; 100nF across VDD and Gnd. 10K resistor from MCLR (pin4) to Vdd (is it right for 14K50?).
Yes, I am writing and reading the memory and I can see the contents. Of course I can see different contents when I flash different firmware.
I am new to this USB stack. Anyways i was reading all your threads and I was successful in running CDC in pic18f4550. But, I tried to use PIC18f14k50, i do not have any connection from the MCU to PC. I tried both Honken USB stack and also from microchip source code for this, but no success. I am just following the schematics from LPC of microchip and using MPLAB ICD2 (i think programmer works, but debugger will not work in this device). Also I am using the latest MPLAB IDE v8.56. I am struggling in this for nearly 3 days without any success. Could you please guide how to make this device to work?