Other Parts Discussed in Thread: EK-TM4C1294XL
Hello!
We are developing a lab device based on TM4C1294KCPDT, and it works fine, except of USB. I want to connect device to PC with USB CDC driver, emulating serial port. The schematic is very simple - as this is just device, I connected USB_DP, USB_DM, USB_VBUS directly to mini-USB connector, protecting the signals with reverse diodes, and pulled up USB_ID to 3.3v. Pin 1 is VBUS, Pin 2 is USB_DM, Pin 3 is USB_DP and Pin 5 is GND.
Here is the initialization code:
//***************************************************************************** // // The languages supported by this device. // //***************************************************************************** const uint8_t g_pui8LangDescriptor[] = { 4, USB_DTYPE_STRING, USBShort(USB_LANG_EN_US) }; //***************************************************************************** // // The manufacturer string. // //***************************************************************************** const uint8_t g_pui8ManufacturerString[] = { (12 + 1) * 2, USB_DTYPE_STRING, 'P', 0, 'o', 0, 'r', 0, 't', 0, 'l', 0, 'a', 0, 'b', 0, ' ', 0, 'l', 0, 't', 0, 'd', 0, '.', 0, }; //***************************************************************************** // // The product string. // //***************************************************************************** const uint8_t g_pui8ProductString[] = { 2 + (12 * 2), USB_DTYPE_STRING, 'A', 0, 'u', 0, 't', 0, 'o', 0, 't', 0, 'r', 0, 'a', 0, 't', 0, 'e', 0, ' ', 0, '0', 0, '2', 0, }; //***************************************************************************** // // The serial number string. // //***************************************************************************** /*const*/ uint8_t g_pui8SerialNumberString[] = { 2 + (8 * 2), USB_DTYPE_STRING, '1', 0, '2', 0, '3', 0, '4', 0, '5', 0, '6', 0, '7', 0, '8', 0 }; //***************************************************************************** // // The control interface description string. // //***************************************************************************** const uint8_t g_pui8ControlInterfaceString[] = { 2 + (21 * 2), USB_DTYPE_STRING, 'A', 0, 'C', 0, 'M', 0, ' ', 0, 'C', 0, 'o', 0, 'n', 0, 't', 0, 'r', 0, 'o', 0, 'l', 0, ' ', 0, 'I', 0, 'n', 0, 't', 0, 'e', 0, 'r', 0, 'f', 0, 'a', 0, 'c', 0, 'e', 0 }; //***************************************************************************** // // The configuration description string. // //***************************************************************************** const uint8_t g_pui8ConfigString[] = { 2 + (26 * 2), USB_DTYPE_STRING, 'S', 0, 'e', 0, 'l', 0, 'f', 0, ' ', 0, 'P', 0, 'o', 0, 'w', 0, 'e', 0, 'r', 0, 'e', 0, 'd', 0, ' ', 0, 'C', 0, 'o', 0, 'n', 0, 'f', 0, 'i', 0, 'g', 0, 'u', 0, 'r', 0, 'a', 0, 't', 0, 'i', 0, 'o', 0, 'n', 0 }; //***************************************************************************** // // The descriptor string table. // //***************************************************************************** const uint8_t * const g_ppui8StringDescriptors[] = { g_pui8LangDescriptor, g_pui8ManufacturerString, g_pui8ProductString, g_pui8SerialNumberString, g_pui8ControlInterfaceString, g_pui8ConfigString }; #define NUM_STRING_DESCRIPTORS (sizeof(g_ppui8StringDescriptors) / \ sizeof(uint8_t *)) tUSBDCDCDevice g_sCDCDevice = { // // The Vendor ID you have been assigned by USB-IF. // 0x8F0F, // Temporary // // The product ID you have assigned for this device. // 0x100, // // The power consumption of your device in milliamps. // 20, // // The value to be passed to the host in the USB configuration descriptor’s // bmAttributes field. // USB_CONF_ATTR_SELF_PWR, // // A pointer to your control callback event handler. // AT_USBControlEventCallback, // // A value that you want passed to the control callback alongside every // event. // //(void *)&g_sYourInstanceData, 0, // // A pointer to your receive callback event handler. // AT_USBReceiveEventCallback, // // A value that you want passed to the receive callback alongside every // event. // //(void *)&g_sYourInstanceData, 0, // // A pointer to your transmit callback event handler. // AT_USBTransmitEventCallback, // // A value that you want passed to the transmit callback alongside every // event. // //(void *)&g_sYourInstanceData, 0, // // A pointer to your string table. // g_ppui8StringDescriptors, // // The number of entries in your string table. // NUM_STRING_DESCRIPTORS }; extern unsigned int Clk; void initUSBCDC() { uint32_t ui32PLLRate; SysCtlPeripheralEnable(SYSCTL_PERIPH_USB0); SysCtlVCOGet(SYSCTL_XTAL_16MHZ, &ui32PLLRate); USBStackModeSet(0, eUSBModeDevice, 0); USBDCDFeatureSet(0, USBLIB_FEATURE_CPUCLK, &Clk); USBDCDFeatureSet(0, USBLIB_FEATURE_USBPLL, &ui32PLLRate); pvDevice = USBDCDCInit(0, &g_sCDCDevice); }
Then I connect the device to the PC, nothing happend. What is the problem?
Thank you!