Hello all
I am Raju Kamal, a Student from University of offenburg, Germany. Now I am faceing a problem to implement the USB-CDC protocal by using MAX3420e interface with our Microprocessor. Can any body send me the c source code for MAX3420e for USB-CDC. It will be gratefull from me!!!
Best regards Raju Kamal
last time i did not put the descriptor. please find the descriptor below:
// EnumApp_enum_data.h // Enumeration tables & CDC data // const unsigned char DD[]= // DEVICE Descriptor {0x12, // bLength = 18d 0x01, // bDescriptorType = Device (1) 0x00,0x02, // bcdUSB(L/H) USB spec rev (BCD) 0x02,0x00,0x00, // bDeviceClass, bDeviceSubClass, bDeviceProtocol 0x40, // bMaxPacketSize0 EP0 is 64 bytes 0x6A,0x0B, // idVendor(L/H)--Maxim is 0B6A 0x46,0x53, // idProduct(L/H)--5346 0x00,0x10, // bcdDevice--1234 1,2,0, // iManufacturer, iProduct, iSerialNumber 0x01}; // bNumConfigurations const unsigned char CD[]= // CONFIGURATION Descriptor {0x09, // bLength 0x02, // bDescriptorType = Config 0x43,0x00, // wTotalLength(L/H) = 41 bytes 0x02, // bNumInterfaces 0x01, // bConfigValue 0x00, // iConfiguration // 0x80, // bmAttributes. b7=1 b6=self-powered b5=RWU supported 0xC0, // bmAttributes. b7=1 b6=self-powered b5=RWU supported // 0xFA, // MaxPower is 2 mA (1 means 2mA, 10 means 20 mA, 50 (100 mA), maximum 250 (500 mA) 0x00, // MaxPower is 2 mA (1 means 2mA, 10 means 20 mA, 50 (100 mA), maximum 250 (500 mA) // INTERFACE Descriptor 0x09, // length = 9 0x04, // type = IF 0x00, // IF #0, Number of the interface -> default first interface is 0 0x00, // bAlternate Setting 0x01, // bNum Endpoints 0x02, // bInterfaceClass = CDC // 0xFE, // bInterfaceClass = CDC 0x02,0x01, // bInterfaceSubClass, bInterfaceProtocol 0x00, // iInterface // Header Functional Descriptor (marks beginning of the concatenated set of Functional Descriptors) 0x05, // bFunctionLength, Descriptor size in bytes --[18] --[48] 0x24, // bDescriptorType, CS_INTERFACE 0x00, // bDescriptorSubtype, Header Functional Descriptor 0x10,0x01, // bcdCDC, CDC specification release number in BCD format ([0x10, 0x01]) // Call Management Functional Descriptor 0x05, // bFunctionLength, Descriptor size in bytes 0x24, // bDescriptorType, CS_INTERFACE 0x01, // bDescriptorSubtype, Call Management Functional Descriptor 0x03, // bmCapabilities, Device doesn't call management itself (0->3) 0x01, // bDataInterface, Interface used for call management // Abstract Control Management Functional Descriptor 0x04, // bDescriptorLength, Descriptor size in bytes 0x24, // bDescriptorType, CS_INTERFACE 0x02, // bDescriptorSubtype, Abstract Control Management Functional Descriptor 0x06, // bmCapabilities, Support for the GET/SET_LINE_CODING, BREAK & SET_CONTROL_LINE_STATE // Union Functional Descriptor 0x05, // bFunctionLength, Descriptor size in bytes 0x24, // bDescriptorType, CS_INTERFACE 0x06, // bDescriptorSubtype, Union Functional Descriptor 0x00, // bMasterInterface, The controlling interface for the union (bInterfaceNumber of a Communication or Data Class interface in this configuration) 0x01, // bSlaveInterface0, The controlled interace in the union (bInterfaceNumber of an interface in this configuration) // Endpoint Descriptor 3 --> Data from USB-Maxim-Chip to the Host-PC 0x07, // bLength 0x05, // bDescriptorType (Endpoint) 0x83, // bEndpointAddress (EP2-IN) 0x03, // bmAttributes (bulk = 2) 0x40,0x00, // wMaxPacketSize (64[0x40]) 0x00, // bInterval (0x00) // INTERFACE Descriptor 0x09, // length = 9 --[44] 0x04, // type = IF 0x01, // InterFace Number = 1 0x00, // bAlternate Setting 0x02, // bNum Endpoints = 2 (IN&OUT) 0x0A, // bInterfaceClass = A (Data) 0x00,0x00, // bInterfaceSubClass, bInterfaceProtocol (SubClass ACM=Abstract Control Mode, InterfaceProtocol=V.25ter, common AT commands) 0x00, // iInterface // Endpoint Descriptor 1 --> Data from the Host-PC to USB-Maxim-Chip 0x07, // bLength 0x05, // bDescriptorType (Endpoint) 0x01, // bEndpointAddress (EP1-OUT) (Adress ranges --> out: 0x01..0x0F in: 0x81..0x8F 0x02, // bNum Endpoints = 2 (IN&OUT) 0x40,0x00, // wMaxPacketSize (64) 00, // bInterval (poll every 10 msec) // Endpoint Descriptor EP2-IN 0x07, // bLength 0x05, // bDescriptorType (Endpoint) 0x82, // bEndpointAddress (EP3-IN) (Adress ranges --> out: 0x01..0x0F in: 0x81..0x8F 0x02, // bmAttributes (interrupt) 0x40,0x00, // wMaxPacketSize (64) 0x02, // bInterval (poll every 10 msec) //0xFF, // bInterval (poll every 10 msec) }; const unsigned char strDesc[][64]= { // STRING descriptor 0--Language string { 0x04, // bLength 0x03, // bDescriptorType = string 0x09,0x04 // wLANGID(L/H) = English-United Sates }, // STRING descriptor 1--Manufacturer ID { 12, // bLength 0x03, // bDescriptorType = string 'M',0,'a',0,'x',0,'i',0,'m',0 // text in Unicode }, // STRING descriptor 2 - Product ID { 24, // bLength 0x03, // bDescriptorType = string 'M',0,'A',0,'X',0,'3',0,'4',0,'2',0,'0',0,'E',0,' ',0, 'E',0,'n',0,'u',0,'m',0,' ',0,'C',0,'o',0,'d',0,'e',0 }, // STRING descriptor 3 - Serial Number ID { 20, // bLength 0x03, // bDescriptorType = string 'S',0, '/',0, 'N',0, ' ',0, '3',0, '4',0, '2',0, '0',0, 'E',0, }}; const unsigned char SerialConf[]= { 0x00,0xE8,0x03,0x00, // dwDTFRate. Baudrate (9600hex->38400 baud) 0, // bCharFormat. 1 Stop bit 0, // bParityType: none 8, // Number of data bits: 8 };
I don't know much about USB/USB Descriptor.
I don't understand the problem you mentioned earlier.
You use Hyper-terminal on the Host, manually type "12345", this "12345" should be sent to your Device, but what your Device gets is "X.2345". Is this the case?
hello John Finally my communication is properly working!! thank you so much for your kind help. Actually the problem was in descriptor and little problem in the code. Thank you!!
Hi Again i faced problem in usb-cdc. pls help me. Can anybody send me an example code for handling the Double buffer endpoint by using max3420e. So far i am not good for usb things. In my USB-CDC programing i am using endpoint2 FIFO. When i want to write a programming by using endpoint2 FIFO i can not use the double buffer 64 byte!please give me some idea how to handle the double buffer FIFO.
can help me to send as an exaple code for writing and reading the EndpointData.