Dear Members,
Where can I find from software development kit the example for writing and reading from I2C EEPROM ?
Thanks
Dear Members,
Where can I find from software development kit the example for writing and reading from I2C EEPROM ?
Thanks
An I2C EEPROM neither knows nor cares what microcontroller you use; all it sees is the transactions on the I2C bus - Start Conditions, Addressing, Stop Conditions; ACK/NAK, etc.
The Nordic SDK examples show you how to use the I2C (aka "TWI") hardware in the nRF52 - ie how to address a Slave, Read, and Write.
So you use the basic functions, together with the datasheet of your EEPROM, to generate the I2C transactions that the EEPROM requires.
For examples, see:
There are 4 TWI examples
which one is the closest application with I2C EEPROM ?
This one
nRF5_SDK_17.0.2_d674dde\examples\peripheral\twi_master_with_twis_slave\pca10056\blank\arm5_no_packs ?
thanks
Have you read the descriptions? What do you think?
Anyhow, you should start with the TWI Scanner to verify your hardware connections, and Slave Address
Ok, thanks
I'm using :
nRF5_SDK_17.0.2_d674dde\examples\peripheral\twi_master_with_twis_slave
Please verify me ,
#define EEPROM_SIM_SIZE (2048u) //!< 24C16 EEPROM size
or 16384 ?
//#define EEPROM_SIM_ADDR 0x50 //!< Simulated EEPROM TWI slave address.
#define EEPROM_SIM_ADDR 0xA0 //!< AT24C16 EEPROM TWI slave address.
//#define EEPROM_SIM_SCL_S 31 //!< Slave SCL pin. <====Originnaly
//#define EEPROM_SIM_SDA_S 30 //!< Slave SDA pin.
#define EEPROM_SIM_SCL_S 27 //!< Slave SCL pin.
#define EEPROM_SIM_SDA_S 26 //!< Slave SDA pin.
Do I need to define WP (write protect) of 24C16, if I don't want to protect it ?
What does it mean by :
#define EEPROM_SIM_TWIS_INST 1 //!< TWIS interface used by EEPROM simulator.
?
is it possible to change it to TWI0, because port I use in my board is TWI0, I don't use TWIS
Currently my board is using :
// Arduino board mappings
#define ARDUINO_SCL_PIN 27 // SCL signal pin
//#define ARDUINO_SCL_PIN NRF_GPIO_PIN_MAP(0,27)
#define ARDUINO_SDA_PIN 26 // SDA signal pin
//#define ARDUINO_SDA_PIN NRF_GPIO_PIN_MAP(0,26)
#define ARDUINO_AREF_PIN 2 // Aref pin
How can I adapt it ?
I saw 2 defines at
eeprom_simulator_init();
and
err_code = twi_master_init();
thanks