[PIC] Read and write from Flash memory of PIC32mx

Status
Not open for further replies.

rajalakshmiA

Newbie level 6
Joined
Jun 23, 2015
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
130
Hi
I want write a byte in internal Flash of pic32mx microcontroller.i have tried sample code.But i cant able to read the exact data .. Anyone help me on that...
 

Hi,

Please show your code.

Klaus
 

Hi,

Please show your code.

Klaus

This is My Code for NVM
int main(void) {

SYSTEMConfig(SYS_FREQ, SYS_CFG_WAIT_STATES | SYS_CFG_PCACHE);
// JTAG port must be disabled.
mJTAGPortEnable(DEBUG_JTAGPORT_OFF);

mPORTBSetPinsDigitalOut(BIT_8);

NVMErasePage((void *)NVM_PROGRAM_PAGE);
ReturnVal = NVMWriteWord((void*)(NVM_PROGRAM_PAGE), 0x1234);


if(ReturnVal == 0)
{
mPORTBSetBits(BIT_8);
}


read_data = *((int *)(NVM_PROGRAM_PAGE)) ;
Data1 = &read_data;



}

- - - Updated - - -

After erasing flash only i am writing into that
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…