I'm working on pic24fj128ga202 microcontroller. My pic is interfaced with eeprom via I2C. I can't write and read on eeprom(BR24G256), then I read the datasheet of eeprom and came to know that there is a write protection for eeprom. I googled it for pic24f, i can't get any solution. So i searched for other pic series i got some suggestions related to code. The code i got is

#pragma config WRTD = OFF    //Disable EEPROM write protection

I refer the my pic24f datasheet, i can't see WRTD. Other than this suggestion will work it in MPLAB seetings?

My IDE is MPLABv8.92 and using PICkit3 programmer.


  • 2
    \$\begingroup\$ Why would you use a PIC-internal solution for an external EEPROM? \$\endgroup\$ – Ignacio Vazquez-Abrams Oct 25 '15 at 9:24

The PIC24 does not contain EEPROM, so the 'setting' you found does nothing.

The write protection is on the BR24G256 chip itself. Likely WP pin 7 on the BR24G256 device is tied high, enabling the write protection.

Additionally, if you can't read from the EEPROM it suggests another issue. Write-protect only disables write actions, but you should be able to read the contents.

| improve this answer | |
  • \$\begingroup\$ Hi @Hans Thanks for the reply. Sorry i didnt mentioned. My EEPROM is tied with GND. \$\endgroup\$ – user6161 Oct 25 '15 at 10:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.