I am trying to interface Flash AT29C512 with AT89C51 How do read and write serially between the 8 bit 8051 and 24 bit Flash,
Kindly help if some one has worked on this.
"I am trying to interface Flash AT29C512 with AT89C51. How do read and write serially..."
The AT29C512 has a Parallel interface - not a serial one!
Read the Data sheet: " for the 8051:
Chapter 1 - 80C51 Family Architecture: www.nxp.com/.../80C51_FAM_ARCH_1.pdf
Chapter 2 - 80C51 Family Programmer's Guide and Instruction Set: www.nxp.com/.../80C51_FAM_PROG_GUIDE_1.pdf
Chapter 3 - 80C51 Family Hardware Description: www.nxp.com/.../80C51_FAM_HARDWARE_1.pdf
ya its a 32 bit device it has SI and SO for its serial I/O pins if this is right , flash SST25VF512 has only a serial interface
thanks & regards, hema.
On serial flash , a program with a large memory requirement
You can't execute code from serisal flash.
How do you propose to make this work?
Erik
just not getting data on hyperterminal
which transciever (e.g. MAX232) do you use and what is the supply voltage for it?
You should not be writing direct to ACC in 'C'!!
Your Rx() function calls itself in an infinite loop!
Throw this code away, and start with the "Hello World" sample. Then build on that...
Ya using MAX232 Actually, the terminal works fine with assembly program In the above program, Rx() also works. There is some problem with this 'Tx()' function could somebody Please help me out what is that fine change to be done
Sorry, Rx() was not being called recursively, that line was supposed to be commented Sorry for that To call recursively, I believe it should be declared as "reentrant"
Why should we write to ACC directly in 'C'? then how do we write to ACC?
Why should we notwrite to ACC directly in 'C'? because you do not need to then how do we write to ACC? you do not need to and, if you do, you are virtually guaranteed to make the code fail.
ACC = (ACC + 48); SBUF = ACC; should be U8 Ralph; .... Ralph += 48; SBUF = Ralph
"Why should we not write to ACC directly in 'C'?"
You should not do it in any high-level language!
Because, when you use a high-level language (eg, 'C'), you delegate control of the low-level CPU registers to the compiler.
See: http://www.keil.com/forum/docs/thread8360.asp
"To call recursively, I believe it should be declared as 'reentrant'"
Even that won't help you if you call it recursively in an infinite loop!
I still recomend that you start with the "Hello World" sample.
The whole process of creating, building, and running the "Hello World" sample is explained in the Getting Started Guide. You should read and follow this - it will give you a proper introductions to the tools, how they work, and how to use them - rather than just jumping-in blindly at the deep-end!
http://www.keil.com/support/man/docs/uv3/uv3_creating_apps.htm
Then how come Rx() function works, and could you tell me why do we add 48?
I mean, to be called recursively it ought to be declared as reentrant, else no difference na
try checking status of ti and ri before getting into loop
Just following your advice, Hello World Hope am not testing your patience Sir, kindly explain this, In the program, Rx() where we write to ACC works, but Tx() where we read from ACC does not work,
ACC is defined in REG51.h, then should not we write to ACC?
Thank you Sir, the links were very helpful, specially for send byte You explained quite patiently, Thanks again for taking time out,
Thanks for all the help That little devil was in the while loop Tx(){ SBUF = ACC; while(TI){} TI = 0 }
Surely learnt a lot hunting it down, Thanks again
View all questions in Keil forum