Hi,
I work on a TMS320F28062U with USB_dev_bulk example. My controller is clocked at 24MHz (XCLKIN), with a SYSCLKOUT of 90MHZ. I have just modified cmd file to run in ROM due to the limited RAM space on this device.
My USB module is clocked at 60MHz:
SysCtrlRegs.PLL2CTL.bit.PLL2CLKSRCSEL = 3;
SysCtrlRegs.PLL2MULT.bit.PLL2MULT = 5;
DevEmuRegs.DEVICECNF.bit.SYSCLK2DIV2DIS = 0;
I have a good communication, using usb_bulk_example.exe, nothing bad seen until now.
When I check this communication with USB 2.0CV downloaded on usb.org. All is ok except enumerations. It systematically fails between something like 50 and 800 enumerations... After that, my computer is no more able to identify the device.
Here are some details observed. These are based on
- CCS5 emulator (xds100V2)
- an oscilloscope connected between D+ and ground
- an oscilloscope connected between an output pin and ground for USB interrupt detection (toggle)
1/ Without usb_bulk_example.exe & USB 2.0 CV activated, I have a USB interrupt (SOF) each 1ms. Synchronized to this, I see a trame (from the host I suppose) on the USB bus.
-> USBFIFO0 value does not change
-> USBFIFO1 to 3 are always refreshed to an higher value (why are these pointers incremented?)
-> USBIntStatusEndpoint(unsigned long ulBase) from usb.c always return "0" meaning that no TX or RX interrupt have been received.
2/ With usb_bulk_example.exe activated, all seems to be ok. USBIntStatusEndpoint(unsigned long ulBase) returns a non "0" value on each string written in the program.
Between data sent via usb_bulk_example.exe, USBIntStatusEndpoint(unsigned long ulBase) from usb.c continues returning "0" on each SOF interrupt and USBFIFO1 to 3 are still always refreshed to an higher value.
3/ With my oscilloscope, when I launch an enumeration test, I can see an interrupt each ms with a returned trame from my controller to the host. This is really stable. When enumeration fails, traffic on the bus becomes really heavy and no more interrupts from USB are activated. It seems that the USB bus has been disconnected from the device.
Other comments:
1/ Vbus detection is initially configured in your example on GPIO39 (Xint3) but following datasheet, this input cannot be linked to XINT3 (only GPIO0 to 31)...
2/ I found something interesting: http://e2e.ti.com/support/microcontrollers/c2000/f/171/t/113671.aspx?pi177899=1
It is written that there is a fixed divided by 2 after PLL2. So PLL2 must be configured to clock at 120MHz.
Is this "fixed divided by 2" linked to DevEmuRegs.DEVICECNF.bit.SYSCLK2DIV2DIS?
If yes, I can see in usb_dev_bulk that this bit is not configured (1 by default, so no division. page 160 of datasheet) but PLL2 is configured at 120MHz. Something goes wrong...
If no, It means that I can divide PLL2 output by 4 if I want. Something is not clear in the datasheet, between fig.p86, fig.p404 and fig.p75. I have some difficulties to clearly identify SYSCLK2...