0

Can say me anyone why I get error when use this code in XC16 MPLAB? PIC24FJ64GA004

unsigned int __attribute__ ((space(eedata))) eeData[] = {100, 1, 22, 33, 44, 156, 3, 10, 1};

error: space(eedata) not supported on this target

Sorry for beginner question.

1 Answer 1

2

The issue is that the PIC24FJ64GA004 doesn't have on-chip EEPROM for you to use. The compiler recognizes this so throws that error. Contrast this against, say, a PIC24F32KA302, which has 512 Bytes of on-chip EEPROM.

Your best bet if you need Non-Volatile memory to write to via your application is to:

A) Use a different target chip with dedicated on-chip EEPROM

B) Emulate an EEPROM using the unused flash program memory (There are Libraries out there for this)

C) Use an off-chip EEPROM that you can interface with via serial communication (such as This)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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