# How difficult would it be to add code to read an external EEPROM, and deactivate/activate depending on a value

1 post / 0 new
PaulMakesThings
Offline
Last seen: 3 months 3 weeks ago
Joined: 2021-10-13 08:51
Posts: 4
How difficult would it be to add code to read an external EEPROM, and deactivate/activate depending on a value

I'm working on something for a quick proof of concept. And since I need to customize the code for a BLDC driver I've gotten two VESC based drivers to work with.

I was wondering, how hard would it be to use one of the ports to read an EEPROM, and if a given value is read, don't run, otherwise run as usual. That's all I need it to do. But I don't have the dev toolchain set up. Nor is the same EEPROM library likely to work. Since time is limited I'd just like to feel out how practical this is.

Here is an example of how I read the needed code on Arduino

#include <I2CEEPROM.h>

#define EEPROM_BYTES 416 // Number of bytes in EEPROM chip

I2CEEPROM i2c_eeprom(CHIP_ADDRESS); // Create I2C EEPROM instance

unsigned int data_length = 4;
byte data_packet[4] = {0,0,0,0};
data_packet[0] = i2c_eeprom.read(start_address);