I have a working custom SD card datalogger using a Microchip 24FJ256GB106 and I am struggling, so far with no success, to add a USB port so I can read the card on my PC.
I have unpacked Microchip's application using MPLAB & C30 and have it successfully compiled for my chip.
I am working in Device mode and have a crystal oscillator - picture of my layout is attached.
This is my configuration:
_CONFIG1( JTAGEN_OFF & GCP_OFF & GWRP_OFF & FWDTEN_OFF & ICS_PGx3)
_CONFIG2( PLL_96MHZ_ON & IESO_OFF & FCKSM_CSDCMD & OSCIOFNC_ON & POSCMOD_HS & FNOSC_PRIPLL & PLLDIV_DIV2 & IOL1WAY_ON)
The software loads OK and I can place LEDs along the path for diagnostics -I have enabled USB_POLLING and my 'main.c' loops continuously through
InitializeSystem();
USBDeviceTasks();
ProcessIO();
but USBDeviceTasks() fails to reach CONFIGURED_STATE which causes ProcessIO() to abort.
At present, the reason for not reaching CONFIGURED_STATE is because U1IRbits.TRNIF is not being set in usb_device.c
I've tried three different generations of Microchip's library software and it must be able to work 'out-of-the-box' so I figure I am doing something dumb with my definitions maybe.
Help much appreciated.
I have unpacked Microchip's application using MPLAB & C30 and have it successfully compiled for my chip.
I am working in Device mode and have a crystal oscillator - picture of my layout is attached.
This is my configuration:
_CONFIG1( JTAGEN_OFF & GCP_OFF & GWRP_OFF & FWDTEN_OFF & ICS_PGx3)
_CONFIG2( PLL_96MHZ_ON & IESO_OFF & FCKSM_CSDCMD & OSCIOFNC_ON & POSCMOD_HS & FNOSC_PRIPLL & PLLDIV_DIV2 & IOL1WAY_ON)
The software loads OK and I can place LEDs along the path for diagnostics -I have enabled USB_POLLING and my 'main.c' loops continuously through
InitializeSystem();
USBDeviceTasks();
ProcessIO();
but USBDeviceTasks() fails to reach CONFIGURED_STATE which causes ProcessIO() to abort.
At present, the reason for not reaching CONFIGURED_STATE is because U1IRbits.TRNIF is not being set in usb_device.c
I've tried three different generations of Microchip's library software and it must be able to work 'out-of-the-box' so I figure I am doing something dumb with my definitions maybe.
Help much appreciated.
Attachments
-
195.8 KB Views: 29