We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi Friends,
I have been working on CY7C68013A EZ-FX2LP USB based micro controller, I have written code for IN/OUT operation i.e, Read and Write operation of USB.
I am initially reading data from HOST a bulk 64 Bytes of data and storing it in a location starting from 0xE000 which is the starting address of scrachpad memory of 512 Bytes, after which if i want to read data from this location I am initially getting a JUNK first time ,latter next read I get actual value, I mean to say that after write is done to this memory location in RAM, every first time i read I get previous value and the actual value is only reflected in the next read operation,
I tried a lot , but i am not able to find out what is the exact problem, I have pasted code below.
// INITIALIZATION CODE void TD_Init(void) // Called once at startup { BYTE i=0; // we are just using the default values, yes this is not necessary... EP1OUTCFG = 0xA0; SYNCDELAY; EP1INCFG = 0xA0; SYNCDELAY; // see TRM section 15.14 EP1INCS = 0x00; SYNCDELAY; EP2CFG = 0x82; SYNCDELAY; EP2BCL = 0xC0; // arm EP2OUT by writing byte count w/skip. SYNCDELAY; EP2BCL = 0xC0; // arm EP2OUT by writing byte count w/skip. SYNCDELAY; EP1INBC = 0x40; // EP2BCH = 0x02; // arm EP2OUT by writing byte count w/skip. // SYNCDELAY; // EP2BCH = 0x02; // arm EP2OUT by writing byte count w/skip. // SYNCDELAY; // enable dual autopointer feature SYNCDELAY; AUTOPTRSETUP |= 0x01; } TD_Poll() { /* -> USB OUT PACKET TRANSFER MODULE -> BULK - 64BYTES -> EP2 - ENDPOINT 2 -OUT DATA TRANSFER */ if(!(EP2468STAT & 0x01)) { ACC =XBYTE[0x8800]; Addr = 0xE000; // scrachpad area starting Addr AddrFIFO = 0xF000; //EP2FIFO starting Addr for( i = 0x0000; i < 64; i++ ) { XBYTE[Addr++]= XBYTE[AddrFIFO++]; } SYNCDELAY; EP2BCL = 0xC0; ACC=XBYTE[0x8800]; } /* -> USB IN PACKET TRANSFER MODULE -> BULK - 64BYTES -> EP1 - ENDPOINT 1 -IN DATA TRANSFER */ if(!(EP1INCS & bmEPBUSY)) //check for EP1IN bit, wait for BUSY Bit =0 { count=EP1INBC; // Load count with EP1 received buffer size /* for(Addr=0xE000;Addr<0xE040;Addr++) // load data to scrachpad RAM ,starting from 0xE000 to 0xE040 (64Bytes) { XBYTE[Addr]=in; // Incremental data for every read operation from HOST } in++; */ // Increment value for one Read operation Addr=0xE000 ; // Intial ScrachPad Address for(i=0;i<count;i++) // 64 Bytes Loop Count { // EP1INBUF[j]=BufferOUT[i]; // Transfer Data from scrachpad RAM Area to EP1 EP1INBUF[j]=XBYTE[Addr++]; j++; } SYNCDELAY; // Sychronization Delay j=0; EP1INBC = 0x40; // Re-Arm EP1 Byte Count SYNCDELAY; // Sychronization Delay ACC=XBYTE[0x9800]; // LED 3 ON SYNCDELAY; ACC=XBYTE[0xA800]; // LED 4 ON SYNCDELAY; } ACC=XBYTE[0x8000]; SYNCDELAY; ACC=XBYTE[0x9000]; // LED 3 ON SYNCDELAY; ACC=XBYTE[0xA000]; // LED 4 ON SYNCDELAY; } }
Please reply me if there is any mistake, waiting for a positive reply,
Abhilash
"but where is the code?????"
If you want someone to write code for you, see: http://www.keil.com/condb Cypress can probably also suggest some names of consultants having experience with their products...
"** Warnnnng L37 sleepSS: ?C_C51STARTUP Segmunt is be in address spac Y:O-y:OEFFFh"
You have clearly typed that manually - I specifically said do not type it manually!
So it never was Error L57 at all - or is that just another mis-type?
Error L37 is described in the Manual: http://www.keil.com/support/man/docs/bl51/bl51_l37.htm
you do not know my answer???
you ask me to typed message and you do not like?????
the error was in the startup.a51 as i said at first but with error L37 at address o7fe0h
why you not help with my code before????
Maybe because you don't deserve help - you don't specify what error you have, and you request help instead of asking for help.
You get upset, when people ask you to specify the full (and correct) error message, since it isn't possible for anyone to give a correct answer to an incorrect question.
Do you really believe that there may only be one single error in startup.a51, and if you just specify the file name then it is possible to help you? That is about the same as saying: I have a Mercedes. What is wrong with it?
I have a Mercedes. What is wrong with it?
the tire is flat
"the tire is flat"
There you go again - Which tyre?
Which tire dimension?
Respected Mr Rahib,
I don't know from which planet u r from?? I read all u r discussions in Keil Threads, It was more funny rather than any useful information, Looking at the discussion u had with Keil Forum, I have very good , decent n smart suggestions for u., The suggestions are mentioned as below, Kindly take every point seriously..,
1. Re -join School from 1st Standard onwards. 2. At least now concentrate on English 3. Then Do some Engineering in computer science / electronics. 4. Try to learn Basics. 5. understand concepts well.
If possible kindly reply back me after u complete all as i have said above, if I am alive i will reply u back..,
Take care,
Have a Nice day,
"2. At least now concentrate on English"
Please take your own advice, and refrain from stuff like 'u' instead of "you", 'n' instead of "and", 'r' instead of "are", etc, etc...
It really makes your post much harder to read!
mister abhilidash,
i think you joke at where me???
sorry why you say my english is no very good but i study from book for long time and have degree for to year now
you have big bug in code and i fix you for work by add line if fix you can
you send me and i now me fix you for also plz
K