Previous in Forum: Microcontroller - 16F887A Datasheet   Next in Forum: WiFi User's Unique Network Key
Close
Close
Close
11 comments
Rate Comments: Nested
Active Contributor

Join Date: Apr 2012
Posts: 13

How to Access Internal ROM in Atmel 89C51?

04/13/2012 11:04 PM

How to acces internal ROM in atmel 89C51 to store datas???

Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Guru

Join Date: Oct 2008
Posts: 42355
Good Answers: 1693
#1

Re: How to acces internal ROM in atmel 89C51?

04/13/2012 11:32 PM
Register to Reply
Guru
Engineering Fields - Electrical Engineering - Been there, done that. Engineering Fields - Control Engineering - New Member

Join Date: Dec 2008
Location: Long Island NY
Posts: 15600
Good Answers: 981
#2

Re: How to access internal ROM in atmel 89C51?

04/13/2012 11:36 PM

LOL ROFL

If you looked up or understood the meaning of the acronym, ROM, then you would realize how silly of an idea it is that you can store data in a ROM address location.

__________________
"Don't disturb my circles." translation of Archimedes last words
Register to Reply
Active Contributor

Join Date: Apr 2012
Posts: 13
#4
In reply to #2

Re: How to access internal ROM in atmel 89C51?

04/14/2012 9:15 PM

Hehe... then how we are storing data using DB?? How we are reading the same data using DPTR??? It is possible to use the code memory to store data. Ok???

Register to Reply
Guru
Engineering Fields - Electrical Engineering - Been there, done that. Engineering Fields - Control Engineering - New Member

Join Date: Dec 2008
Location: Long Island NY
Posts: 15600
Good Answers: 981
#6
In reply to #4

Re: How to access internal ROM in atmel 89C51?

04/14/2012 10:06 PM

On a serious note, stop using acronyms capriciously when you obviously do not understand their meanings. You can Read a Read Only Memory (ROM) address because reading is the only thing allowed. The letter "R" stands for different things in memory allocation depending on if it is ROM or Random Access Memory (RAM). Now why certain memory locations in the Atmel (company names should be capitalized) 89C51 microcontroller are only ROM locations, gets into the chip architecture and the assembly level operating system of this chip that is obviously above your pay grade, at this time.

It dawns on me now that there is a third type of memory location that you maybe erroneously calling ROM locations, the flash memory locations. These are the locations that contain the user program for this chip. These locations have a very limited number of write cycles and typically require a pin to be switched to a higher voltage to prevent accidental changing of the program code. The timing of applying this voltage with information to be "burned" into the chip means that most of the time a programming circuit board from the manufacturer (Atmel) is needed to change this code. Atmel does make some microcontrollers that do not require a special board but in this case special software is needed to send some proprietary serial handshakes to similarly prevent accidental altering of the program code.

If this is what you are actually asking, I'm not going to do your homework in figuring out how to change the program on the chip.

__________________
"Don't disturb my circles." translation of Archimedes last words
Register to Reply
Active Contributor

Join Date: Apr 2012
Posts: 13
#7
In reply to #6

Re: How to access internal ROM in atmel 89C51?

04/14/2012 10:22 PM

Thanks Bro. I got my mistake. It is not ROM memory. I was telling about the internal flash or code memory. Thanks for the correction. But, in programming it is the possible to write and read the Random Access Memory(RAM) and similarly we can use the flash memory for the same. Still the question is that how we can use the code memory to read and write data?? We can burn the Micro-controller, more than a thousand times. Do you know Micro-controller programming??

Register to Reply
Guru
Engineering Fields - Electrical Engineering - Been there, done that. Engineering Fields - Control Engineering - New Member

Join Date: Dec 2008
Location: Long Island NY
Posts: 15600
Good Answers: 981
#8
In reply to #7

Re: How to access internal ROM in atmel 89C51?

04/14/2012 11:27 PM

NO! You cannot use flash memory locations for operational data writing and manipulation. You can write useful data in programming mode that is read by your program but this data cannot be altered in any way by the executing program itself. This prevents the program from altering itself during operation. The useful data can be the identity (XYZ 123 inkjet printer serial number XXXXXX) of the machine that contains this microcontroller chip.

__________________
"Don't disturb my circles." translation of Archimedes last words
Register to Reply
Active Contributor

Join Date: Apr 2012
Posts: 13
#10
In reply to #8

Re: How to access internal ROM in atmel 89C51?

04/15/2012 1:33 AM

If i choose the memory locations left after the program, is it possible? My problem is that, when i chose the Random Access Memory(RAM), Stack Pointer is overwriting the data. Is there any alternate solution for this?

Register to Reply
Guru
Engineering Fields - Electrical Engineering - Been there, done that. Engineering Fields - Control Engineering - New Member

Join Date: Dec 2008
Location: Long Island NY
Posts: 15600
Good Answers: 981
#11
In reply to #10

Re: How to access internal ROM in atmel 89C51?

04/15/2012 12:06 PM

Flash memory locations can only be written to during the flash operation of loading a program.

It has been many, many years since I've had to do microcontroller assembly language programing. Keep this in mind when you analyze the rest of my reply. (At one time I thought I was pretty good at it though.)

Your microcontroller should have multiple stack pointers in your code that you can directly manipulate with your program and one that should be forbidden to touch. A properly designed pair of stacks will not collide with other stacks. Stack pointers them selves do not overwrite memory locations, your program does it. Each stack pointer that one can safely manipulate identifies the place of a Last In, First Out (LIFO) batch of stack memory that you utilize in your program. There are many techniques in memory management protocol in handling a stack of memory but AFAIK they all contain the approach that the tail of one data location identifies the head of the next data in the stack. An end of stack special word will be placed into the tail of the first data placed into any stack. To utilize stack memory you must have at least two stacks. One to pull data Off and one to put Data On. These roles will reverse when you either reach the data you want to use or the end of stack is found. Depending on the nature of the data found in a pair of stacks, the stack order may or may not be critical.

A key factor in preventing the collision of stacks is to identify the fixed dimension data in your program and the dynamically dimensioned data of your program. The fixed dimension data can be tightly packed in a field of adjacent memory registers. The dynamic memory (interrupts and temporary stacks are frequent sources of dynamic memory) must be allowed to grow and shrink in size. Many sloppy programmers do not learn about clearing (shrinking) allocated memory techniques until they have to write for the limited memory space of a microcontroller.

The one stack pointer you technically can directly manipulate in a program but should dread ever touching is the stack pointer that identifies the next program step. Let the interrupt protocol of your chip and your program organization handle this.

Many higher level programming languages handle all of this memory management protocol at the cost of code bloat (more memory) and execution speed. C and C++ handle some of this protocol but still allow for direct manipulation of all data registers.

Good Luck and Happy Coding.

__________________
"Don't disturb my circles." translation of Archimedes last words
Register to Reply Score 1 for Good Answer
Guru
Engineering Fields - Electrical Engineering - Been there, done that. Engineering Fields - Control Engineering - New Member

Join Date: Dec 2008
Location: Long Island NY
Posts: 15600
Good Answers: 981
#9
In reply to #7

Re: How to access internal ROM in atmel 89C51?

04/14/2012 11:30 PM

Oh, and several thousand write cycles is not very many times when one has a megahertz clock. Think about it.

__________________
"Don't disturb my circles." translation of Archimedes last words
Register to Reply
Guru
Technical Fields - Technical Writing - New Member Engineering Fields - Piping Design Engineering - New Member

Join Date: May 2009
Location: Richland, WA, USA
Posts: 21017
Good Answers: 795
#3

Re: How to acces internal ROM in atmel 89C51?

04/14/2012 2:06 AM

Duplicate thread.

__________________
In vino veritas; in cervisia carmen; in aqua E. coli.
Register to Reply
Active Contributor

Join Date: Apr 2012
Posts: 13
#5
In reply to #3

Re: How to acces internal ROM in atmel 89C51?

04/14/2012 9:18 PM

Sorry???

Register to Reply
Register to Reply 11 comments

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Copy to Clipboard

Users who posted comments:

lyn (1); nikhildascl (4); redfred (5); Tornado (1)

Previous in Forum: Microcontroller - 16F887A Datasheet   Next in Forum: WiFi User's Unique Network Key

Advertisement