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.
I have finished my program for USB-CDC with some problem. my problem is now i can read but cannot write. Is it like can communicate from Host to usb but cannot usb to host? Does anybody has any idea about this problem?
How do you expect anyone to make any comment on your program without seeing your program?
It is like saying, "My car doesn't work - what's wrong with it"
Remember: nobody knows anything about you, your project, or your code apart from what you provide in your posts!
ok, i am sending my code with couple of pages: #include <io.h> #include <string.h> #include "SD_driver.h" #include "FAT.h" #include "MAX3420E_BF1.h" // MAX3420E registers (rREGNAME), bits (bmBITNAME), and subroutine-definitions
//Hauptprogramm int main() { long int g; int i; int msec_timer=0; int PC_DTR=0; int USB_int=0;
// Enumeration, Initialisierung des internen FPGA-USB-Controllers ////////// for(g=0;g<4000000;g++); putport(0x13,4); for(g=0;g<3000000;g++); putport(0x13,0); for(g=0;g<3000000;g++); //Warte bis USB bereit! //////////////////////////////////////////////////////////////////////////// // Enumeration, Initialisierung des USB-Maxim3420E-Controllers ///////////// initialize_MAX(); // Enumeration-Interrupt abwarten for(g=0;g<3000000;g++); //Warte bis MaxUSB enumeriert ist
USB_writeln(_Copyright); //Ausgabe der Versionsnummer
if(loadData()!=0) USB_writeln("Karte nicht lesbar!\r\n\0"); while(1) //Endlosschleife der Befehlzeile { USB_writeln("\r\nSD\0"); USB_writeln(_path); //Aktueller Pfad USB_writeln(">\0");
MaxUSB_readln(_stinp); //Befehl einlesen USB_writeln("\r\n\0"); USB_writeln2(" juhu\r\n\0");
if((getport(0x16)&1)!=0) //SD-Karte gesteckt? Nein -> Meldung USB_writeln("Keine Karte vorhanden!\r\n\0"); else if(checkState()!=0) //SD-Karte initialisiert? { if(loadData()!=0) USB_writeln("Karte nicht lesbar!\r\n\0"); } else { for(i=0;_stinp[i]!='\0';i++)//Eingabe in Großbuchstaben wandeln if(_stinp[i]>0x60&&_stinp[i]<0x7B) _stinp[i]-=0x20;
if(runProc(_stinp)!=0) //Auswertung der Befehlszeile
USB_writeln("Befehl oder Dateiname nicht gefunden\r\n\0"); }
} return 0; }
// USB-Maxim3420E Routinen #include "EnumApp_enum_data.h" //CDC enumeration data #include "USB_SPI_COM.c" #include "USB_INIT.c" #include "USB_Enumeration.c" //#include "USB_Interrupt_handle.c" #include "USB_CDC_Appl.c" // SD-Karte bzw. Dateisystemroutinen #include "SD_driver.c" #include "FAT.c"
Now why did you post your code without specifying that it was code?
Look once more at the information you see when posting comments - there is one sentence specifically mentioning what you should do when posting code. If you don't follow that instruction, the code you paste will be practically unreadable.
View all questions in Keil forum