I am using a PIC32MX795F512L in device mode but cannot get it to connect.
So here is a step by step of what is happening to aid with any help people can give.
Before i attach USB cable:
3.3v at Vusb (RF6)
3.3v at Vbus (RF7)
0V at D+ (RG2)
0V at D- (RG3)
After i attach USB
3.7v at Vusb (RF6)
5v at Vbus (RF7)
0V at D+ (RG2)
0V at D- (RG3)
I am unsure why Vusb is getting a voltage increase when it is attached to nothing but a capacitor and 3.3v
The computer is not recognizing that a device is attached and D+ and D- show no activity on oscilloscope
My setup is as follows:
VCC (pin 1) -> vbus (RF7) with 4.7uF cap
GND (pin 4) -> GND
D+ (pin 3) -> RG2
D- (pin 2) -> RG3
3.3v via 100nF cap to Vusb (RF6)
Wire from Vcc to RB5 to trigger USB_BUS_SENSE
i am using interrupt mode and the main part of my code can be seen below
#if defined(USE_USB_BUS_SENSE_IO)
tris_usb_bus_sense = INPUT_PIN; // See HardwareProfile.h
#endif
#if defined(USE_SELF_POWER_SENSE_IO)
tris_self_power = INPUT_PIN; // See HardwareProfile.h
#endif
UserInit();
USBDeviceInit(); //usb_device.c. Initializes USB module SFRs and firmware
//variables to known states.
}//end InitializeSystem
Code:
void USBDeviceAttach(void)
{
//if we are in the detached state
if(USBDeviceState == DETACHED_STATE)
{
if(USB_BUS_SENSE == 1)
{
//Initialize registers to known states.
U1CON = 0;
// Mask all USB interrupts
U1IE = 0;
//Configure things like: pull ups, full/low-speed mode,
//set the ping pong mode, and set internal transceiver
SetConfigurationOptions();
USBEnableInterrupts(); //Modifies global interrupt settings
// Enable module & attach to bus
while(!U1CONbits.USBEN){U1CONbits.USBEN = 1;}
//moved to the attached state
USBDeviceState = ATTACHED_STATE;
}
}
}
Theses are the main snippets of code i believe to be important to get it to connect. Is there any reason why my PC does not recognise my device at all.
Ttelmah
Joined: 11 Mar 2010 Posts: 19538
Posted: Thu Jan 30, 2014 1:42 am
That is the MicroChip USB stack, not CCS. Go and ask in their forum.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum