ich versuche den 24LC256 256K I2C CMOS Serial EEPROM am Arduino zu betreiben. Schaltplan: Wenn ich das Datenblatt richtig deute, ist dieser EEPRON recht identisch mit dem
IC , welcher auf dem FRAM Breakout Board verwendet wird. Daher habe ich auch die Software für dieses
Board mit der Bib. "Adafruit_FRAM_I2C.h" benutzt und etwas abgespeckt um zu prüfen, ob die Adesse erkannt wird:
Code: Alles auswählen
#include <Wire.h>
#include "Adafruit_FRAM_I2C.h"
/* Example code for the Adafruit I2C FRAM breakout */
/* Connect SCL to analog 5
Connect SDA to analog 4
Connect VDD to 5.0V DC
Connect GROUND to common ground */
Adafruit_FRAM_I2C fram = Adafruit_FRAM_I2C();
void setup(void) {
Serial.begin(9600);
if (fram.begin(0x50)) { // I2C Adresse Standart
Serial.println("I2C EPROM erkannt");
} else {
Serial.println("I2C EPROM nicht erkannt\r\n");
}
}
void loop()
{
}
Code: Alles auswählen
if (fram.begin(0x50)) { // I2C Adresse
Hier das Orginalprog. von Adafruit:
Code: Alles auswählen
#include <Wire.h>
#include "Adafruit_FRAM_I2C.h"
/* Example code for the Adafruit I2C FRAM breakout */
/* Connect SCL to analog 5
Connect SDA to analog 4
Connect VDD to 5.0V DC
Connect GROUND to common ground */
Adafruit_FRAM_I2C fram = Adafruit_FRAM_I2C();
uint16_t framAddr = 0;
void setup(void) {
Serial.begin(9600);
if (fram.begin(0x50)) { // I2C Adresse
Serial.println("Found I2C FRAM");
} else {
Serial.println("I2C FRAM not identified ... check your connections?\r\n");
Serial.println("Will continue in case this processor doesn't support repeated start\r\n");
}
// Read the first byte
uint8_t test = fram.read8(0x0);
Serial.print("Restarted "); Serial.print(test); Serial.println(" times");
// Test write ++
fram.write8(0x0, test+1);
// dump the entire 32K of memory!
uint8_t value;
for (uint16_t a = 0; a < 32768; a++) {
value = fram.read8(a);
if ((a % 32) == 0) {
Serial.print("\n 0x"); Serial.print(a, HEX); Serial.print(": ");
}
Serial.print("0x");
if (value < 0x1)
Serial.print('0');
Serial.print(value, HEX); Serial.print(" ");
}
}
void loop(void) {
}
Gruss
Ludwig