Krik99
Krik99

Reputation: 3

PIC24F eeprom and XC16 MPLAB

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.

Upvotes: 0

Views: 1033

Answers (1)

K_Trenholm
K_Trenholm

Reputation: 504

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)

Upvotes: 2

Related Questions