EE write/read LPC1347

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

EE write/read LPC1347

1,433 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ECamino on Wed Jun 12 11:13:22 MST 2013
Hi,

Trying to do a simple byte write to EEPROM. Is there an app note that details how to do this? Here is my function code. I'm trying to write a byte in the first EEPROM mem address (0x0?). The return status code after the write call is (5): "DST_ADDR_NOT_MAPPED"


typedef uint8_t (*EEP)(unsigned int [],unsigned int[]); // modified 'stock' iap_entry prototype with new prototype to allow for return value (casting from void gives warnings)

EEP eep_entry;

uint32_t * pdata; //global

void ee_write(a_struct * pstruct){
unsigned long command[5];
unsigned long result[4];
uint8_t returnstatuscode; // get status of IAP command
*pdata = pstruct->data;
eep_entry = (EEP) IAP_LOCATION;
command[0] = 61; // EEPROM Write IAP call
command[1] = 0; // EEPROM address. What is this address? not specified in UM or Product data sheet!
command[2] = (unsigned long)&pdata; // cast from uint32_t
command[3] = 1; // write one byte
command[4] = 72000; // processor speed in kHz
returnstatuscode = eep_entry(command, result); // returns a '5', so what is the correct EEPROM address?
//;
}

Thanks,


EC
0 Kudos
Reply
3 Replies

1,390 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ECamino on Thu Jun 13 08:05:40 MST 2013
Yes, thank you.  Per AN works great!
0 Kudos
Reply

1,390 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cfb on Thu Jun 13 01:53:27 MST 2013
The IAP function does not return a status code - it should be declared as void. The status code is returned in result[0].

0 is the correct start address.
0 Kudos
Reply

1,390 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tha on Wed Jun 12 15:51:36 MST 2013
Use this app note as a guide.
http://www.lpcware.com/content/nxpfile/an11073-using-lpc11axx-eeprom-iap-v10

Although the app note say it's for the LPC11Axx, the API call is the same for the LPC13xx.
0 Kudos
Reply