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.

Writing to EEPROM in PIC18F452?

Status
Not open for further replies.

hybris

Newbie level 1
Newbie level 1
Joined
Apr 30, 2005
Messages
0
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,280
Activity points
1,327
Hi!


The PIC18F452 has something like 16K or 32k EEPROM memory and only 1536 bytes of RAM. I want to store a recording from a microphone in the memory of a PIC18F452. I know that I usually store variables in RAM and EEPROM is for "program code" but it could be used for other things right? So to the question:

Is it possible to write to the EEPROM from within the program and store data there permenently?

/Hybris
 

You can write anything in the EEPROM, but You must have in mind the write/erase numbers.
Microchip specifie 1.000.000 write/erase cycles for EEPROM memory. One cool method used by me are the take one or two bytes for counting the erase number and other´s for "data allocation" then, I hopping the write/erase data in the EEPROM.

OBS: ccs c compiler, have buit in functions for write and read in eeprom!

Gorkin.
 

    hybris

    Points: 2
    Helpful Answer Positive Rating
hybris

the 18F452 does have 256 bytes EEPROM and 16 k FLASH memory (where your program resides).

It is possible to write to EEPROM and FLASH memory but when writing to FLASH you must take care not to overwrite your program and the FLASH is also organized in blocks of 64 bytes. So if you want to write a single byte to FLASH you must write a complete block which makes it quite complicated :-(

So if 256 bytes EEPROM is enough for your application I would stick with this ...

best regards
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top