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.
"if this is right..."
Again, the Datasheet will tell you whether it is right or not.
Have you read the Datasheet?
ya it is a serial flash
"it is a serial flash"
Good.
Now, back to the Datasheet: what kind of serial interface does it have?
If it is a standard type (eg, I2C or SPI) you should be able to easily find sample code;
If it is non-standard, it will be fully defined by the manufacturer somewhere - maybe in the datasheet, maybe in a separate document.
Either way, check the manufacturer's site first for examples, guidance, etc...
its standard type with SPI interface, so where do we find the sample code, Google?
Of course, Google like to blow their own trumpet: "Google is now widely recognised as the world's largest search engine -- an easy-to-use free service that usually returns relevant results in a fraction of a second" www.google.co.uk/.../index.html
There are other internet search engines; eg, http://www.altavista.com/
To be able to effectively use such tools is absolutely essential - so start practising now!
www.google.co.uk/.../about.html www.altavista.com/.../tools
You will also find plenty of examples included in the 'Examples' folder in your Keil installation, and the downloads section of this site.
You should also check-out the SST site for Application Notes, examples, etc, etc,...
Sir, you are udderly confoosed
you keep babhbling about a 32 but address NONSENSE.
buth are 512kBIT devices which makes them 64kBYTE devices i.e.having a 16 bit address.
Erik
sir, am trying my first hand at these things, In the data sheet, the address is sent as 32 bit, so for device id it is written as 0x00000, so also in the timing diagram
probably you could patiently explain as you seem an expert to novices
Thanks,
the AT29C512 is 16 bit address
I'd suggest you leave the SST25VF512 alone. As opposed to many serial memories, it requires separate page/chip erase, not just write. Have a look at the offereings that just require a write from e.g. Ramtron.
Of course, since you have not stated what you want to store on the serial flash, I may be off here.
"am trying my first hand at these things"
What you really need to learn is how to find the necessary materials for yourself.
It goes something like this:
Go to the SST website, and type "SST25VF512" into the search box in the top-right corner.
That will take you to a page all about the SST25VF512; Down the left-hand side, you will see a box headed "Product Resources" In that box, you will see links for 'Application Notes' etc.
You should explore these links - you may well find that your questions are answered there!
thanks a lot,
got the receive data part right , not bad, for a start i suppose the sample surely helped in sending data though not able to find why the data is not being sent on the hyperterminal
P1 = byte; ACC = byte; SBUF = ACC;
any thing to be added to this?
though not able to find why the data is not being sent on the hyperterminal
where/what is the UART initialize code?
TMOD = 0x20; TH1 = -3; SCON = 0x50; TR1 =1; TI = 0;
the initialize code is in Main() program with 4800 or 9600 baud
sir, have tried at this just not getting data on hyperterminal though it is being transmitted from 8051, displeyed thru port-1 also,
this is the code which i used:
#include<reg51.h> #include<stdio.h> Rx(); Tx(); void main (void){ TMOD = 0x20; TH1 = -3; // 9600 baud, SMOD = 0; SCON = 0x50; // 8 bit, 1 stop, REN-1 TR1 = 1; TI = 0; Rx(); } Rx(){ while (1){ //(RI=1){ ACC = 0000; ACC = SBUF; P1 = ACC; Tx(); RI = 0; Rx(); } } Tx(){ // ACC = (ACC + 48); SBUF = ACC; while(TI){ TI = 0; } }
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
View all questions in Keil forum