реклама на сайте
подробности

 
 
> USB на МК tm4c1294kcpdt, Не работает USB на МК Tiva
kkobru
сообщение Aug 10 2017, 10:37
Сообщение #1


Участник
*

Группа: Участник
Сообщений: 38
Регистрация: 3-04-14
Пользователь №: 81 207



Добрый день!

Может кто сталкивался. Не живёт USB на моей плате с tm4c1294kcpdt. Инициализирую как в примере, в режиме USB CDC, ноги подключены непосредственно к разъёму мини-USB, но устройство не опознаётся.

Схему и плату могу показать, код инициализации ниже:

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);
}


Сообщение отредактировал IgorKossak - Aug 12 2017, 15:02
Причина редактирования: [codebox] для длинного кода, [code] - для короткого!
Go to the top of the page
 
+Quote Post



Reply to this topicStart new topic
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 22nd July 2025 - 15:54
Рейтинг@Mail.ru


Страница сгенерированна за 0.01359 секунд с 7
ELECTRONIX ©2004-2016