Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

89C51 ED2 - EEPROM access while program read?

Status
Not open for further replies.

fire

New Member
Hi,

I am considering using an AT89C51ED2 in a project. What I would like to do is store the program and important variables in non-volatile memory. Ideally, I would load the program into a segment of EEPROM and, while it's running, save variables to another segment of EEPROM. I understand that I only have 2KB to work with. Efficiency is not an issue.

Is it possible to do this on the ED2? The alternative is to use the on-board EEPROM for one thing, and some off-board EEPROM for another (I do not plan to use the Flash).

Thanks in advance.
 
AT89C51ED2 has 64kB of code memory and 2kB of non-volatile data memory. So there is no question of running your program in one segement and storing variables in another segment of same memory. Your program will reside in 64kb FLASH memory while you'll be saving your variables in 2kb data EEPROM. Ofcourse it is possible to program FLASH code memory using assembley code / bootloader function calls, but it would be more sensible to put your data in separate data memory that is available.
 
If I use the Flash, I will have to make hardware modifications (because of the external EEPROM). So my question pertains strictly to the EEPROM and not the Flash. What do you think?
 
fire said:
If I use the Flash, I will have to make hardware modifications (because of the external EEPROM). So my question pertains strictly to the EEPROM and not the Flash. What do you think?

I'm not familiar with your processor, but is it possible to run a program from external EEPROM?. And assuming it was?, EEPROM is VERY slow.

It seems a rather strange thing to be considering, why can't you use the proper FLASH program memory? - what has the external EEPROM got to do with it?.
 
I think you haven't read the datasheet carefully or I am not getting your question.

The AT89C51ED2 has everything you want inside a single chip. You don't need to interface anything outside. i.e internally it has
64kB FLASH ROM - Exclusively for your program and is in-aplication programmable.
2kB EEPROM - This is exclusively for non-volatile data storage like your program variables.
2kB SRAM - This is where you declare all your "xdata" variables or in other words "far memory" which is used by your program at run time for temperory data storage.

You put your program in any sector of 64kB flash, use that 2kB EEPROM for non-volatile variable storage. So where is the confusion? :?:

Mind that the 2kB EEPROM is not meant for code execution.
 
Yes - I will be underutilizing the chip. It would be nice to use the internal Flash program memory but it would require a modification to the PCB on which the mcu will live - memory map issues. I am switching from another microcontroller that did not have internal Flash, so I was using external EEPROM for the program space (and nothing for non-volatile memory). It would be more cost-effective to continue using the same external EEPROM.

I guess there's no way to do what I want with the EEPROM (dual-wield it, so to speak). Would be nice if I could just justify using the internal Flash and deprecate the external EEPROM altogether.

Thanks for your advice.
 
fire said:
Yes - I will be underutilizing the chip. It would be nice to use the internal Flash program memory but it would require a modification to the PCB on which the mcu will live - memory map issues. I am switching from another microcontroller that did not have internal Flash, so I was using external EEPROM for the program space (and nothing for non-volatile memory). It would be more cost-effective to continue using the same external EEPROM.

I guess there's no way to do what I want with the EEPROM (dual-wield it, so to speak). Would be nice if I could just justify using the internal Flash and deprecate the external EEPROM altogether.

I think we may have all been talking at cross purposes here?.

By EEPROM I assumed, and I think everyone else did, that you were refering to a small 8 pin I2C EEPROM?. I'm now presuming what you are refering to is an EPROM - even if it is a modern EEPROM/FLASH version, something which you can run a program from using a micro with external data and address lines.
 
Ok, now I understood your problem.

You can use the same external EEPROM for program execution as well as dynamic data storage.
 
Is there a fuse bit I can set to specify that the external PEROM should be used as program memory instead of the internal Flash? The manual mentions the Boot Loader Jump Bit which forces the application execution. I'm not certain this is the bit I should set, nor how to go about setting it.
 
Answering my own question: Yes, the BLJB bit in the hardware security byte, with a programmer, in the study.
 
Hi I am using the AT89C51ED2 in my project and I am using it's internal EEPROM. When I write data in the internal eeprom and read the data back the program is working well. But when I remove the supply and try to read back the data, It don't give me the data written later. It is written on the data sheet that it is a non volatile memory which that means that the data stored in the eeprom is stored even if the supply is turned off. Am I wright?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top