G120 internal EEPROM

Is the internal EEPROM on the G120 used to any Premium functions? or can I use it for my application?

But I am using RLP to access the EEPROM.

EWR use Flash witch have a minimum of 10.000 write cycles on the LPC1788 chip.

The internal EEPROM has 100.000

EEPROM on the G120 is 4096 bytes.

EEPROM is not intended to run firmware from. Flash is.

The data in eeprom section is empty so I guess that is not used by GHI :slight_smile:

So I will start using it, finally I know that I can store serial numbers without losing them…

We do not use the eeorom. It is all yours :slight_smile:

@ Honken -

I’ll would be very interested in a piece of code showing how you read/write in the G120 EEPROM, that will be a very good issue for me to store some none volatile informations…

Thanks

I added the EEPROM driver from LPCOpen platform library into my NativeBox project.
http://www.lpcware.com/content/nxpfile/lpcopen-platform

with this I can read, write and erase pages in EEPROM.

Don’t forget to call “Chip_EEPROM_Init” in “eeprom_17xx_40xx.c” file before reading/writing otherwise your app will hang on write because no wait states are set.


/**
 * @ brief	Initializes EEPROM
 * @ param	pEEPROM	: pointer to EEPROM peripheral block
 * @ param	cclk	: EEPROM base clock rate
 * @ return	Nothing
 */
void IP_EEPROM_Init(IP_EEPROM_001_T *pEEPROM, uint32_t cclk);

/**
 * @ brief	De-initializes EEPROM
 * @ param	pEEPROM	: pointer to EEPROM peripheral block
 * @ return	Nothing
 */
STATIC INLINE void IP_EEPROM_DeInit(IP_EEPROM_001_T *pEEPROM)
{
	/* Enable EEPROM power down mode */
	pEEPROM->PWRDWN = 0x1;
}

/**
 * @ brief	Write data to EEPROM at specific address
 * @ param	pEEPROM			: pointer to EEPROM peripheral block
 * @ param	page_offset		: offset of data in page register(0 - 63)
 * @ param	page_address	: page address (0-62)
 * @ param	data			: buffer that contain data that will be written to buffer
 * @ param	mode			: Read mode, should be:
 *                  - MODE_8_BIT    : read 8 bit mode
 *                  - MODE_16_BIT   : read 16 bit mode
 *                  - MODE_32_BIT   : read 32 bit mode
 * @ param	size			: number written data (bytes)
 * @ return	SUCCESS on successful write of data, or ERROR
 * @ note	This function actually write data into EEPROM memory and automatically
 * write into next page if current page is overflowed
 */
Status IP_EEPROM_Write(IP_EEPROM_001_T *pEEPROM,
					   uint16_t page_offset,
					   uint16_t page_address,
					   void *data,
					   IP_EEPROM_001_MODE_T mode,
					   uint32_t size);

/**
 * @ brief	Read data to EEPROM at specific address
 * @ param	pEEPROM			: pointer to EEPROM peripheral block
 * @ param	page_offset		: offset of data in page register(0 - 63)
 * @ param	page_address	: page address (0-62)
 * @ param	data			: buffer that contain data read from read data register
 * @ param	mode			: Read mode, should be:
 *                  - MODE_8_BIT    : read 8 bit mode
 *                  - MODE_16_BIT   : read 16 bit mode
 *                  - MODE_32_BIT   : read 32 bit mode
 * @ param	size			: number read data (bytes)
 * @ return	Nothing
 */
void IP_EEPROM_Read(IP_EEPROM_001_T *pEEPROM,
					uint16_t page_offset,
					uint16_t page_address,
					void *data,
					IP_EEPROM_001_MODE_T mode,
					uint32_t size);

/**
 * @ brief	Erase a page at the specific address
 * @ param	pEEPROM			: pointer to EEPROM peripheral block
 * @ param	page_address	: EEPROM page address (0-62)
 * @ return	Nothing
 */
void IP_EEPROM_Erase(IP_EEPROM_001_T *pEEPROM, uint16_t page_address);

/**
 * @ brief	Enable/Disable EEPROM power down mode
 * @ param	pEEPROM		: pointer to EEPROM peripheral block
 * @ param	NewState	: PowerDown mode state, should be:
 *                  - ENABLE: Enable power down mode
 *                  - DISABLE: Disable power down mode
 * @ return	Nothing
 */
void IP_EEPROM_PowerDown(IP_EEPROM_001_T *pEEPROM, FunctionalState NewState);


2 Likes

@ Honken -

Thanks ! I’ll have a look at this Platform…For me, long time from now is the C devlopment…