Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Difference between three types of memory in pic16f877?

Status
Not open for further replies.

#MAAM#

Full Member level 2
Joined
Nov 21, 2009
Messages
131
Helped
29
Reputation
58
Reaction score
27
Trophy points
1,308
Location
Egypt
Activity points
1,920
Hi,

I'm confused:?: about some information in saving program and data in micro-controller pic16f877
1) Program in flash program memory.
2) Local variables in RAM.
3) Global variable in EEPROM.
this my understanding ....... it's true or false ?:grin:
 

Yes you are right.

1) Program in flash program memory. - popular say Firmware or HEX code for uC
2) Local variables in RAM. - When power turn off data is lost.
3) Global variable in EEPROM. - For some variable, data stays if power lost.

Note: There is version with 14KB of program memory.


Diagram of PIC16F877 :

Internal-Architecture-of-PIC16F877A-Chip.gif
 
Last edited:
  • Like
Reactions: #MAAM#

    #MAAM#

    Points: 2
    Helpful Answer Positive Rating
Hi,


3) Global variable in EEPROM.
this my understanding ....... it's true or false ?:grin:

Not true. A "Global variable" defines the scope or visibility of a variable in the code and would normally be in RAM. EEPROM would be for storing variables which need to be retained when power is removed. They need special handling to store and retrieve them.

Keith.
 
  • Like
Reactions: #MAAM#

    #MAAM#

    Points: 2
    Helpful Answer Positive Rating
both EEPROM and ROM (program memory) have limited write capabilities, there is also a definite time delay in writing and reading to these areas, for actual values please refer to the datasheet of the part, the life of these parts will also depend on the temperature.

Writing to RAM is significantly faster and so is suitable for rapidly changing data, EEPROM is best suited for storing data that may be updated occasionally such as calibration data, user configuration data etc.

Whereas program memory is best suited for storing data that will seldom change, such as program code etc.

If you want to expand the RAM of a micro-controller, consider using a FRAM (ferro-electric RAM), these are fast and have almost unlimited read and write capabilities as compared to an EEPROM.
 
  • Like
Reactions: #MAAM#

    #MAAM#

    Points: 2
    Helpful Answer Positive Rating
Thank you all for this supporting.
Summary for this discussion:
1) Firmware in Flash memory.
2) Variables in RAM.
3) User setting in EEPROM.
 

Sounds about right. Some processors don't have EEPROM space but have a "self write" ability for the FLASH. While this is normally used to support bootloaders, you can use it to store settings in FLASH and the program can still change them later.

Keith.

---------- Post added at 10:00 ---------- Previous post was at 09:47 ----------

By the way, I have just checked and the PIC16F877 doesn't have Flash "self write" ability. There would be a section in the data sheet called "self write" or something similar for the devices that do support Flash self write.

Keith.
 
  • Like
Reactions: #MAAM#

    #MAAM#

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top