How to use flash memory to store data?

How to use flash memory of PIC32 controller to store data?
How to read and write data in flash memory of PIC32 controller?
Request for sample code.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi Ganesh,

Are you familiar with PIC microcontrollers family?
Do you know how to write code for other smaller chips as PIC10F or PIC12F or PIC16F or PIc18F?
If you know that, then PIC32 is only a bigger brother with more complex internal architecture that you must learn.
Writing the code is similar.
For small family you can write in ASM or C, but for bigger chips with more complex codes and functions C is proffered language.
The programming environment is MPLABX from Microchip, which is free to download and use, but then you need a C compiler, either from Microchip or 3rd party and that is not free. Then you need a programmer or for test purpose you may use simulators.
There are are also visual programming software as Flowcode, but you must check in what version PIC32 is included.

A PIC microcontroller has flash memory to store the program and RAM memory for data.
Here are the specs:

And code examples for PIC32 you may find here:

If you are a programmer with experience then you need to tell  if you want to use the flash memory to store "data" and not program and how often do you write data on flash, because there is endurance, limited cycles.
For example 8 bit family has HEF memory:
And this application note shows how to use HEF as EPROM:

For 32 bit family you should look at the documents from this page bottom:

Here is the memory organization:
Here is the flash programming specs:
And perhaps this is what you need "Flash Memory with Support for Live Update" , with examples at the end of file:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Hi Ganesh,
Was of any help the answer above?
Did you try any code?
The provided answer are valid, despite the fact that the person which asked the question did not reply.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Internet of Things

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.