Sep 22, 2015 #1 R 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 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...
Sep 22, 2015 #2 KlausST Advanced Member level 7 Joined Apr 17, 2014 Messages 25,161 Helped 4,868 Reputation 9,757 Reaction score 5,537 Trophy points 1,393 Activity points 168,359 Hi, Please show your code. Klaus
Sep 22, 2015 #3 E ec_nisarg Full Member level 2 Joined Jun 22, 2011 Messages 142 Helped 20 Reputation 38 Reaction score 19 Trophy points 1,298 Location Ahmedabad, India, India Activity points 2,095 you need to erase at least one page of NVM to rewrite it.. that's how flash memories work..
Sep 22, 2015 #4 R rajalakshmiA Newbie level 6 Joined Jun 23, 2015 Messages 14 Helped 0 Reputation 0 Reaction score 0 Trophy points 1 Activity points 130 KlausST said: Hi, Please show your code. Klaus Click to expand... 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
KlausST said: Hi, Please show your code. Klaus Click to expand... 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