• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 117
  • Last Modified:

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.
0
GANESH GHATTE
Asked:
GANESH GHATTE
  • 4
2 Solutions
 
viki2000Commented:
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:
https://www.microchip.com/design-centers/32-bit
https://www.sparkfun.com/datasheets/Components/SMD/PIC32MX.pdf
Datasheets:
https://www.microchip.com/doclisting/TechDoc.aspx?type=datasheet

And code examples for PIC32 you may find here:
https://www.microchip.com/doclisting/TechDoc.aspx?type=CodeExamples

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:
http://www.microchip.com/design-centers/8-bit/peripherals/core-independent/high-endurance-flash-hef
And this application note shows how to use HEF as EPROM:
http://ww1.microchip.com/downloads/en/AppNotes/00001673A.pdf

For 32 bit family you should look at the documents from this page bottom:
http://www.microchip.com/design-centers/32-bit

Here is the memory organization:
http://ww1.microchip.com/downloads/en/DeviceDoc/60001115H.pdf
Here is the flash programming specs:
http://ww1.microchip.com/downloads/en/DeviceDoc/60001145S.pdf
And perhaps this is what you need "Flash Memory with Support for Live Update" , with examples at the end of file:
http://ww1.microchip.com/downloads/en/DeviceDoc/60001193B.pdf
1
 
viki2000Commented:
0
 
viki2000Commented:
Hi Ganesh,
Was of any help the answer above?
Did you try any code?
0
 
viki2000Commented:
The provided answer are valid, despite the fact that the person which asked the question did not reply.
0

Featured Post

A Cyber Security RX to Protect Your Organization

Join us on December 13th for a webinar to learn how medical providers can defend against malware with a cyber security "Rx" that supports a healthy technology adoption plan for every healthcare organization.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now