LPC546xx I2C eeprom driver example

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPC546xx I2C eeprom driver example

ソリューションへジャンプ
2,681件の閲覧回数
cybaluke
Contributor III

Hi,

is there any full software driver example for a I2C external EEPROM (i.e. 24xx512 or 24xxM01) for the LPC546xx family?

(I'm working with MCUXpresso and its SDK - baremetal examples)

Maybe I'm wrong but in the SDK I can find only internal  eeprom examples...

thanks

ラベル(2)
0 件の賞賛
返信
1 解決策
2,597件の閲覧回数
frank_m
Senior Contributor III

I think mentioned SDK EEPROM examples are related to an EEPROM emulation, using internal Flash.
Which is not based upon I2C in any way.

I would suggest to use other examples for the 24xx serial EEPROM, and combine them with an I2C example from the SDK.
More or less as poster giraffe508 suggested.
You will still need to implement the specific protocol, i.e. transfer sequences.

And I highly recommend the use of a scope or logic analyzer.

 

元の投稿で解決策を見る

5 返答(返信)
2,603件の閲覧回数
CarlosGarabito
NXP TechSupport
NXP TechSupport

We have this document that can help you to develop the code you are looking for with the following memories https://www.nxp.com/docs/en/application-note/AN13165.pdf

0 件の賞賛
返信
2,672件の閲覧回数
giraffe508
Contributor IV

Hi There, You are correct that the SDK examples are primarily focused on the internal EEPROM. However, you can easily adapt the I2C examples provided in the SDK to communicate with an external EEPROM like the 24xx512 or 24xxM01.

First, make sure you have the latest SDK for the LPC546xx family.

Once you have the SDK installed, you can find the I2C examples under the following path:

SDK_2.x_LPC546xx\\boards\\lpcxpresso546xx\\driver_examples\\i2c

These examples demonstrate how to use the I2C driver to communicate with I2C devices. You can use them as a starting point for your external EEPROM implementation. You will need to modify the example code to include the specific commands and address format required by your EEPROM device.

For instance, to write data to the 24xx512 EEPROM, you would need to send the following sequence:

 1. Start condition 2. Device address with write bit 3. Memory address (high byte) 4. Memory address (low byte) 5. Data to be written 6. Stop condition 

Similarly, to read data from the EEPROM, you would need to send the following sequence:

 1. Start condition 2. Device address with write bit 3. Memory address (high byte) 4. Memory address (low byte) 5. Repeated start condition 6. Device address with read bit 7. Read data 8. Stop condition 

Make sure to consult the datasheet of your specific EEPROM device for the correct commands and address format.

I hope this helps you get started with your I2C EEPROM implementation on the LPC546xx family. If you have any further questions, please feel free to ask.

Kind Regards, 

2,668件の閲覧回数
cybaluke
Contributor III

Thanks for your answer, ...but what I was asking for is just an example code of how to use the SDK api for the eeprom used and redirected to control an external I2C eeprom (if it is possible)... is there any good example code for lpc54xxx or any is there any good GitHub code available?

0 件の賞賛
返信
2,598件の閲覧回数
frank_m
Senior Contributor III

I think mentioned SDK EEPROM examples are related to an EEPROM emulation, using internal Flash.
Which is not based upon I2C in any way.

I would suggest to use other examples for the 24xx serial EEPROM, and combine them with an I2C example from the SDK.
More or less as poster giraffe508 suggested.
You will still need to implement the specific protocol, i.e. transfer sequences.

And I highly recommend the use of a scope or logic analyzer.

 

2,658件の閲覧回数
giraffe508
Contributor IV
0 件の賞賛
返信