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
"Can any body send me the (sic) c source code for MAX3420e for USB-CDC"
You are making the assumption that there is only 1 possible "source code" in the whole world to do this for any & every application. Unfortunately, this is not the case - otherwise Maxim could supply it with their chip!
You need to study the MAX3420e datasheet - that will tell you what you need to do in order to use the chip.
You should also visit the Maxim website and look there for examples, application notes, etc...
This is the standard process for interfacing anything to anything else - see: www.8052.com/.../160143
Thanks Neil for sending the link for interface. May be i confuse you, actually i wish to see a source code as an example, which will be usefull for me to get some information and can program my project.
************************************************************************** // void class_request(void) { switch (SUD[bRequest]) { case SEND_ENCAPSULATED_COMMAND: wregAS(rEP0BC, 0); break; // send_encapsulated_command(); break; case GET_ENCAPSULATED_RESPONSE: wregAS(rEP0BC, 0); break; // send_encapsulated_command(); break; // get_encapsulated_response(); break; case SET_COMM_FEATURE: break; case GET_COMM_FEATURE: break; case CLEAR_COMM_FEATURE:break; case SET_LINE_CONDING: { wregAS(rEP0BC, 0); // EnvÃa un paquete de longitud 0 para la etapa de 'STATUS' (?) if(SUD[wLengthL]>0) { while(!(rreg(rEPIRQ) & bmOUT0DAVIRQ) && SUD[7]<=5) SUD[7]++; readbytes(rEP0FIFO,SUD[wLengthL],(unsigned char *)&SUD[0]); // Lee la configuración serie por el EP0 (hay que cambiar algo para que lea?) } } break; case GET_LINE_CODING: { wregAS(rEP0BC, 0); // EnvÃa un paquete de longitud 0 para la etapa de 'STATUS' (?) writebytes(rEP0FIFO,SUD[wLengthL],(unsigned char *)&SerialConf[0]); wreg(rEP0BC, SUD[wLengthL]); } break; case SET_CONTROL_LINE_STATE: { if(configval) { USB_init=1; // Si llega a este punto, el dispositivo ha terminado de inicializarse if((SUD[wValueL]&0x01)==0x01)// PC listo para aceptar tramas del AZC PC_DTR=1; if(SUD[wValueL]==0x00) // Se ha cortado la comunicación con el PC PC_DTR=0; } wregAS(rEP3INBC, 0); } break; case SEND_BREAK: break; default: STALL_EP0; // none of the descriptor types match } } void vendor_request(void) { STALL_EP0; }
// Intialisation from the USB-Maxim3420E-Controller void initialize_MAX(void) { BYTE rd; int int_mask; // software flags configval=0; // at pwr on OR bus reset we're unconfigured Suspended=0; RWU_enabled=0; // Set by host Set_Feature(enable RWU) request // Mask out of the USB-Maxim-Interrupt in the Interruptcontroller of the SIRIUS-System // USB-Interrupt-Position in SIRIUS-System: Bit 7 int_mask= ((getport(0x23)) & 0xBF); putport (0x23, int_mask); // Always set the FDUPSPI bit in the PINCTL register FIRST if you are using the SPI port in // full duplex mode. This configures the port properly for subsequent SPI accesses. // Fullduplex means SPI with Data-In and Data-Out wires // INTLEVEL=0 --> Edge-Interrupts ; INTLEVEL=1 --> Level-Interrupts // POSINT=0 --> 1-0 transition for interrupts ; POSINT=1 --> 0-1 transition for interrupts //------------------------------------------------------------------------------ // PINCTL-Register: // | EP3INAK | EP2INAK | EP0INAK | FDUPSPI | INTLEVEL | POSINT | GPXB | GPXA | //------------------------------------------------------------------------------ //wreg(rPINCTL,(bmFDUPSPI+bmPOSINT+gpxSOF)); // (17h) MAX3420: SPI=full-duplex, INT=from 0 to 1 for interrupt, GPX=SOF wreg(rPINCTL,0x13); // MAX3420: SPI=full-duplex, INTLEVEL=0(edge-ints), POSINT=0 --> 1-0 interrupts, GPX=SOF // DEBUG //rd = rreg(rPINCTL); //showbyte(rd); // Maxim-USB-Chip reset to initial conditions Reset_MAX(); // This is a self-powered design, so the host could turn off Vbus while we are powered. // Therefore set the VBGATE bit to have the MAX3420E automatically disconnect the D+ // pullup resistor in the absense of Vbus. Note: the VBCOMP pin must be connected to Vbus // or pulled high for this code to work--a low on VBCOMP will prevent USB connection. wreg(rUSBCTL,(bmCONNECT+bmVBGATE)); // VBGATE=1 disconnects D+ pullup if host turns off VBUS // In SIRIUS-System the Interrupt line is inverted !! // For a POSINT=0 -> 1-0 transistion --> inverter in SIRIUS-System // --> Interrupt-Edge-Register must be programmed to 0-1 transition means high active int_mask= ((getport(0x22)) | 0x40); putport (0x22, int_mask); //ENABLE_IRQS //wreg(rEPIEN,0x34); //bmSUDAVIE+bmIN3BAVIE+bmOUT1DAVIE = 110100b =64hex wreg(rEPIEN,0x3C); //bmSUDAVIE+bmIN3BAVIE+bmIN2BAVIE+bmOUT1DAVIE = 0011 1100b =3Chex wreg(rUSBIEN,(bmURESIE+bmURESDNIE)); wreg(rCPUCTL,bmIE); // Enable the INT pin // Enbling the USB-Maxim-Interruptbit in the SIRIUS-Interrupcontroller int_mask= ((getport(0x23)) | 0x40); //int_mask = getport(0x23); //int_mask = int_mask | 0x40; putport (0x23, int_mask); } // Reset Routine welche den Max-Chip zurücksetzt. void Reset_MAX(void) { BYTE dum; wreg(rUSBCTL,0x20); // chip reset wreg(rUSBCTL,0x00); // remove the reset do // Chip reset stops the oscillator. Wait for it to stabilize. { dum=rreg(rUSBIRQ); dum &= bmOSCOKIRQ; } while (dum==0); }
// Possible Interrupts for our application: // a. Setup Data arrived (SUDAVIRQ). // b. The host requested keyboard data by sending a data request to EP3-IN. // c. The host suspended the bus by stopping traffic for three milliseconds. // d. The host initiated a bus reset. // e. The host completed bus reset signaling. // Poll the Interrupt line from the USB-Max-Chip // --> Later it should work automtically in a Interrupt-Service-Routine //BYTE MAX_Int_Pending(void) //{ //return (BYTE)((USB_CYPRESSFLAG&0x01)==1); // USB_Cypressflag=1 --> true //} // *********************************** // // Interrupt Service Requests // *********************************** // // This function checks 4 IRQ bits // 1. bmSUDAVIRQ A SETUP packet arrived. // The host controls a device by sending SETUP packets. // 2. bmIN3BAVIRQ The host asked for another data packet from the HID keyboard. // It uses endpoint 3-IN for this request. BAV means Buffer Available. // 3. bmURESIRQ The host started signaling a bus reset. // 4. bmUSBRESDNIRQ The host finished signaling a bus reset //void _service_irqs(void) void _service_irqs(void) { // Read out the two IRQ-Register and save the result in variables BYTE itest1,itest2; itest1 = rreg(rEPIRQ); // Check the EPIRQ bits itest2 = rreg(rUSBIRQ); // Check the USBIRQ bits // // Debug it // beep(45,46); // Debug-AHI-Ton // USB_writeln("itest1="); // showByte(itest1); // USB_writeln("itest2="); // showByte(itest2); // USB_writeln("\n\r\0"); if(itest1 & bmSUDAVIRQ) // Check for SETUP data { // beep(45,46); // Debug-AHI-Ton wreg(rEPIRQ,bmSUDAVIRQ); // clear the SUDAV IRQ _USBmax3420E_ENUM(); } if(itest1 & bmIN3BAVIRQ) // Was an EP3-IN packet just dispatched to the host? { // do_IN3(); // Yes--load another keystroke and arm the endpoint } // NOTE: don't clear the IN3BAVIRQ bit here--loading the EP3-IN byte // count register in the do_IN3() function does it. if((configval != 0) && (itest2&bmSUSPIRQ)) // HOST suspended bus for 3 msec { wreg(rUSBIRQ,(bmSUSPIRQ+bmBUSACTIRQ)); // clear the IRQ and bus activity IRQ // L2_ON // turn on the SUSPEND light // L3_OFF // turn off blinking light (in case it's on) Suspended=1; // signal the main loop } // The last two checks handle USB bus reset. These code sections clear the // IRQ bits and turn a bus reset light on and off. Note that MAX3420E code // should always include a test for a USB bus reset. This is because the // MAX3420E clears most of its interrupt enable register bits during a USB bus // reset. Therefore, the code should be alert to a bus reset. When the reset is // complete (signaled by the USBRESDN IRQ), it should re-enable the interrupts // that it is using for the application. if(rreg(rUSBIRQ)& bmURESIRQ) { // USB_writeln("Clear URESIRQ\n\0"); wreg(rUSBIRQ,bmURESIRQ); // clear the IRQ } if(rreg(rUSBIRQ) & bmURESDNIRQ) { // USB_writeln("Clear URESDNIRQ\n\0"); wreg(rUSBIRQ,bmURESDNIRQ); // clear the IRQ bit // Suspended=0; // in case we were suspended //ENABLE_IRQS // ...because a bus reset clears the IE bits wreg(rEPIEN,(bmSUDAVIE+bmIN3BAVIE)); wreg(rUSBIEN,(bmURESIE+bmURESDNIE)); } }
// ********************************************************* // // ****************** SPI - Routinen *********************** // // ********************************************************* // // ------------------------------------------------------------ // The code below customizes this app for the SIRIUS-uC-System // microprocessor and the Rowley compiler. Only this // section changes if you use a different uP and/or compiler. // ------------------------------------------------------------ // ************************************************************************** // // First byte of every SPI transfer is a command byte like following format: // ---------------------------------------- // | b7 | b6 | b5 | b4 | b3 | b2 | b1 | b0 | // ---------------------------------------- // |Reg4|Reg3|Reg2|Reg1|Reg0| 0 |DIR |ACK | // ---------------------------------------- // Bit7 to 3 = Register Address // Bit1 = Direction (DIR=0=Read ; DIR=1=Write) // Bit0 = ACKSTAT bit in R9 // ************************************************************************** // // Liest ueber den SPI-Bus ein Register des Max-USB-Chips aus BYTE rreg(BYTE reg) { BYTE dum; // putport(0x3E, 0x66); putport(SPI_SIRIUS_PORT_STEUER,0x03); // Set CS2=0 writeSPI(reg); // Set on USB-Max-Chip the reg number w. dir=0 (IN) dum = readSPI(); // Read the register value putport(SPI_SIRIUS_PORT_STEUER,0x07); // Set CS2=1 return(dum); } // Schreibt ueber den SPI-Bus ein Register des Max-USB-Chips void wreg(BYTE reg, BYTE dat) { putport(SPI_SIRIUS_PORT_STEUER,0x03); // 0000_0011 --> Mode0 , CS2=0 reg = reg+2; // Write-Bit = +2 writeSPI(reg); // Send the register-number with the DIR bit (b1) set to WRITE writeSPI(dat); // Send the data to the register putport(SPI_SIRIUS_PORT_STEUER,0x07); // Set CS2 high } // Liest ueber den SPI-Bus ein Register des Max-USB-Chips aus. // Das ACKSTAT-Bit wird im Commando-Byte gesetzt BYTE rregAS(BYTE reg) { BYTE dum; putport(SPI_SIRIUS_PORT_STEUER,0x03); // Set CS2=0 writeSPI(reg+1); // Reg number with dir=0 (IN) and ACKSTAT=1 dum = readSPI(); // Read the register value putport(SPI_SIRIUS_PORT_STEUER,0x07); // Set CS2=1 return(dum); } // Schreibt ueber den SPI-Bus ein Register des Max-USB-Chips void wregAS(BYTE reg, BYTE dat) { putport(SPI_SIRIUS_PORT_STEUER,0x03); // 0000_0011 --> Mode0 , CS2=0 reg = reg+3; // Write-Bit und Ack-Bit = +3 writeSPI(reg); // Reg number with DIR=1 (write) and ACKSTAT=1 writeSPI(dat); // Send the data to the register putport(SPI_SIRIUS_PORT_STEUER,0x07) ; // Set CS2 high } // Liest N-Bytes ueber den SPI-Bus eines Register des Max-USB-Chips aus. void readbytes(BYTE reg, BYTE N, BYTE *p) { BYTE j; putport(SPI_SIRIUS_PORT_STEUER,0x03); // 0000_0011 --> Mode0 , CS2=0 writeSPI(reg); // Write-Bit b1=0 to command a read operation // Read-Loop for(j=0; j<N; j++) { *p = readSPI(); // Store it in the data array p++; // Bump the pointer } putport(SPI_SIRIUS_PORT_STEUER,0x07); // Set CS2 high } // Schreibt N-Bytes ueber den SPI-Bus eines Register des Max-USB-Chips. void writebytes(BYTE reg, BYTE N, BYTE *p) { BYTE j,wd; putport(SPI_SIRIUS_PORT_STEUER,0x03); // 0000_0011 --> Mode0 , CS2=0 writeSPI( reg+2); // write bit b1=1 to command a write operation // Writes N Bytes for(j=0; j<N; j++) { wd = *p; // write the array value // showbyte(wd); writeSPI(wd); // write the byte from the array position p++; // Bump the pointer } putport(SPI_SIRIUS_PORT_STEUER,0x07); // Set CS2 high } // Zeigt ueber den intern FPGA-integrierten USB-Controller ein Byte im USB-COM an void showByte(char Byte) { int i; char x; char *e={"00\0"}; for(i=1;i>=0;i--) { x=(Byte&0xF); Byte=Byte>>4; if(x<10) e[i]=x+0x30; else e[i]=x+0x41-10; } USB_writeln(e); } //Word in HEX ausgeben void showword(U16 Word) { int i; U08 x; char *e={"0000\0"}; for(i=3;i>=0;i--) { x=(Word&0xF); Word=Word>>4; if(x<10) e[i]=x+0x30; else e[i]=x+0x41-10; } USB_writeln(e); } void check_for_resume(void) { // SPI_ini(0); // USB_CSE; putport(SPI_SIRIUS_PORT_STEUER,0x03); if(rreg(rUSBIRQ) & bmBUSACTIRQ) // THE HOST RESUMED BUS TRAFFIC Suspended=0; // no longer suspended // USB_CSD; putport(SPI_SIRIUS_PORT_STEUER,0x07); }
void USB_writeln2(char *name) { int g; // namelength = sizeof(name); // so we can check for the end of the message // showByte(namelength); // while(USB_Max_EP3_flag==0) {} // wait for an interrupt which set the flag //beep(0x55,0x55); for(g=0; g < 64; g++) { // USB_writeln("test"); if (name[g]==0) // Strings are 0 terminated //wreg( rEP1OUTFIFO,0); // Rest of the bytes are 0 wreg(rEP2INFIFO,0); else //wreg(rEP1OUTFIFO,name[g]); wreg(rEP2INFIFO,name[g]); // Load the string (64 times) // wreg( rEP1OUTFIFO,0x2); } wreg(rEP2INBC,64); // wreg( rEP1OUTBC,64);
First i would like to say sorry because of some miscommunication and some bad posting. Now whatever i have send is my code, some of them i have found from this forum and some from maxim. As well as i also need to change some to compatible with our compiler.
So Now i am faceing a problem for writing by the usb. For my project i need to use the hyperterminal com. for coummincation i am using Docklight Scripting software. the final position is now if i send any data by the docklight or windows hyperterminal, it shows me transfer data but does not show receiving data. If it is still confuse please inform me i will try to explain it more.
my problem is now i can read but cannot write
the final position is now if i send any data by the docklight or windows hyperterminal, it shows me transfer data but does not show receiving data.
The above statements are very confusing to me.
I don't know much about this, but normally, you should use an USB Analyzer to analyze what happens during the USB communication.
A. USB Host to USB device -> OK. USB device to USB Host -> Failed.
B. USB Host to USB device -> Failed. USB device to USB Host -> OK.
Your problem is A or B? How do you know/confirm that, it is OK/Failed?
Did you put a breakpoint at the beginning of the USB ISR to see what happens?
Does anybody get the idea what is the problem?? My communication between PC (host) to usb is ok but USB to PC (host) is not ok. For CDC shall i need to use the endpoint2 for Output? The last function "void USB_writeln2" use for writing. here i use Endpoint2, is it ok? i also check with other Endpoint but its remain same no improvement.
teasdfasdfasdf
"A. USB Host to USB device -> OK. USB device to USB Host -> Failed.
Your problem is A or B?" My problem is A. My "USB device to USB host is not ok". I have checked with USB analyzer and found USB Host to USB device is ok but the other direction is not ok!! I have also used some break point for debugging. can you tell me how can do the "bulk transfer". So far i understand there is a interrupt transfer and bulk transfer. i need to know about the bulk transfer. If it is still confuse i can write my testing procedure in details.
I don't know much about USB/USBCDC. And I am not familiar with your MCU and your USB solution (Library/Source Code).
But I think/guess that, for most USBCDC device, the Data Flow for sending data from Device to Host (Bulk-In) is:
1. Host polls Device regularly. 2. The USB ISR of the device handles such a polling. (USB frame interrupt handler) 3. The USB ISR of the device puts data into Bulk-In EP. (USB frame interrupt handler) 4. When Bulk-In EP finishes the data sending, another interrupt triggered. (Interrupt driven data sending) 5. The USB ISR of the device handles the next Bulk-In. (USB Bulk-In interrupt handler) It puts more data into Bulk-In EP. (Go to Step 4)
With the USB Analyzer, did you see some regular IN-Packets? How did you respond to such a IN-Packet?
-> With the USB Analyzer, did you see some regular IN-Packets? How did you respond to such a IN-Packet? <-
The above question is incorrect.
It should be:
With the USB Analyzer, did you see some regular IN-NAKs?
With the USB Analyzer, could you see your Endpoint Descriptor of the Bulk-In EP?
Now i can get the both way communication by changing in the Endpoint descriptor on "bmAttributes". But faceing a new problem: During writing in the usb getting extra constant value. for example: i want to write on usb "12345". then i get "X.2345". This "X." all the time comes and "1" is missing.
This problem i am faceing for anykind of string, Missing first charcter and giving "X." instead of First character.
Did you put a breakpoint at where the program starts to get the string?
yes. i put a breakpoint or can say a writeline, From where the program can get the string.
Device <-> USB Analyzer <-> Host ======A=========B==========C====
You need to find out where the string is modified by what. It is modified at A or B or C.
With the USB Analyzer, you should be able to see the string at B.
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.
View all questions in Keil forum