How i can read data transferred to an eeprom i2c when an microcontroller send this data to the eeprom

hi programmer of arduino
i need urgent help about this topic
i search very long time for this solution and no success
i have one MCU when his finish save same data to i2c eeprom for read it later
i find some project but not work fine withe me
an programmer write similar programme for blood pressure monitor
its the same project but is send me some number not we need and i don't know what this number do or explication
and the weird thing this materiel have UART but not compatible baud rate of any universal Baud rate known
the link of similar project we know is this :

you need to listen i2c lines while recording is in progress
or read EEPROM after.
you say you got "some number not we need", show.

tinks you for your response
that we need please

Did you try the sketch from "similar project"? It has a problem redefining 'SDA' and 'SCL' so I renamed then 'SDA_Pin' and 'SCL_Pin'.

/**
   I2C bus snooper. Written to eavesdrop on MCU to EEPROM
   communications in a HL168Y blood pressure monitor. SCL
   is connected to Arduino pin 2 and SDA to pin 3.
   This version will decode read and write operations to
   EEPROM outputting to serial port as
   "R aaa vv" or "W aaa vv" records (one per line) where
   aaa is 10 address bits as hex digits and vv is value as
   hex digits.
*/

const int SCL_Pin = 2;  // PORT D, bit 2
const int SDA_Pin = 3;  // PORT D, bit 3
// Don't forget to wire the device ground to Arduino ground.

char hexval[] = {"0123456789ABCDEF"};

#define LOG_SIZE 255
unsigned char datalog[LOG_SIZE];
unsigned char logptr;

void setup()
{
  pinMode(SCL_Pin, INPUT);
  pinMode(SDA_Pin, INPUT);
  Serial.begin(115200);
}

void loop()
{
  unsigned char s, b = 0, byteCounter, bitCounter, rwFlag = 0;
  unsigned char addr_hi = 0, addr_lo = 0;
  unsigned int t = 0;

  logptr = 0;

waitForStart:

  // Expect both SLC and SDA to be high
  while ( (PIND & 0b00001100) != 0b00001100) ;
  // both SLC and SDA high at this point

  // Looking for START condition. Ie SDA transitioning from
  // high to low while SLC is high.
  while ( (PIND & 0b00001100) != 0b00000100)
  {
    if ( (--t == 0) &&  (logptr > 0) )
    {
      writeData();
    }
  }

firstBit:

  byteCounter = 0;
  bitCounter = 0;

nextBit:

  // If SCL high, wait for SCL low
  while ( (PIND & 0b00000100) != 0) ;

  // Wait for SCL to transition high. Nothing of interest happens when SCL is low.
  while ( (PIND & 0b00000100) == 0) ;

  // Sample SDA at the SCL low->high transition point. Don't know yet if this is a
  // data bit or a STOP or START condition.
  s = PIND & 0b00001000;

  // Wait for SCL to transition low while monitoring SDA for a transition.
  // No transition means we have data or ACK bit (sample in 's'). A hight to
  // low SDA = START, a low to high SDA transition = STOP.
  if (s == 0)
  {
    // loop while SCL high and SDA low
    while ( (PIND & 0b00001100) == 0b00000100) ;
    if ( (PIND & 0b00001100) == 0b00001100)
    {
      // STOP condition detected
      if (logptr > LOG_SIZE - 20)
      {
        writeData();
      }
      goto waitForStart;
    }
  }
  else
  {
    // loop while SCL high and SDA high
    while ( (PIND & 0b00001100) == 0b00001100) ;
    if ( (PIND & 0b00001100) == 0b00000100)
    {
      // START condition.
      goto firstBit;
    }
  }

  // OK. This is a data bit.
  bitCounter++;

  if (bitCounter < 9)
  {
    b <<= 1;
    // if data bit is '1' set it in LSB position (will default to 0 after the shift op)
    if (s != 0)
    {
      b |= 0b00000001;
    }

    goto nextBit;
  }

  // 9th bit (ack/noack)

  bitCounter = 0;
  byteCounter++;

  switch (byteCounter)
  {
    case 1: // 1010AAAW where AAA upper 3 bits of address, W = 0 for writer, 1 for read
      if ( (b & 0b11110000) != 0b10100000)
      {
        goto waitForStart;
      }
      // Set A9,A8 bits of address
      addr_hi = (b >> 1) & 0b00000011;
      rwFlag = b & 0b00000001;
      break;

    case 2: // data if rwFlag==1 else lower 8 bits of address
      if (rwFlag == 1)
      {
        // data read from eeprom. Expect this to be the last byte before P
        //datalog[logptr++] = ' ';
        datalog[logptr++] = 'R';
        datalog[logptr++] = ' ';
        datalog[logptr++] = hexval[addr_hi];
        datalog[logptr++] = hexval[addr_lo >> 4];
        datalog[logptr++] = hexval[addr_lo & 0b00001111];
        datalog[logptr++] = ' ';
        datalog[logptr++] = hexval[b >> 4];
        datalog[logptr++] = hexval[b & 0b00001111];
        datalog[logptr++] = '\n';
      }
      else
      {
        addr_lo = b;
      }
      break;

    case 3: // only have 3rd byte if rwFlag==0. This will be the data.
      if (rwFlag == 0)
      {
        //datalog[logptr++] = ' ';
        datalog[logptr++] = 'W';
        datalog[logptr++] = ' ';
        datalog[logptr++] = hexval[addr_hi];
        datalog[logptr++] = hexval[addr_lo >> 4];
        datalog[logptr++] = hexval[addr_lo & 0b00001111];
        datalog[logptr++] = ' ';
        datalog[logptr++] = hexval[b >> 4];
        datalog[logptr++] = hexval[b & 0b00001111];
        datalog[logptr++] = '\n';

        if (logptr > LOG_SIZE - 10)
        {
          writeData();
        }

        break;
      }

  } // end switch

  goto nextBit;

}

void writeData ()
{
  for (int i = 0; i < logptr; i++)
  {
    Serial.print(datalog[i]);
    datalog[i] = 0;
  }
  logptr = 0;
  Serial.println ("\n");
}

this is the result I don't know his meaning is not main data

That does not look like the data the sketch will display. It should look like:

W 010 05
W 011 1e
W 012 86
W 013 28
W 014 10
W 015 11
W 016 82
W 017 44

Are you sure the sketch uploaded to your Arduino UNO correctly?

i have only arduino nano but is the same mcu mega328p

the letre w not in main serial monitor

An Arduino Nano should work fine. Are you sure your Nano is connected on serial port COM1?

Each line should start with "W" or "R". I don't know where that text is coming from but it doesn't look like what the sketch output should be.

i configure the com of nano for port com 1
i have no idea for this problem

hi i find some thing weird
i find SRDY SDA SCL in main device and when i search for that i find this protocol is SPI interface
do have any idea for listen to this interface ??

The EEPROM chip in the "similar project" is the ST Microelectronics 24C08WP. What model EEPROM chip does your device use?

i dont remember it
i will go now to home for show it
i just remember in the card i see SRDY CLK SDA

It is often hard to get a picture clear enough to read the tiny print on a chip. It would be better to look at the chip with a magnifier and write down the text.

is GT24C16-2GLI from Giantec Semiconductor, Inc.
i find his datasheet

my network verry bad and the pecture is big and his size take very long time and no upload doing


i upload directly from phone using 4G network now

From the datasheet it looks like the interface is the same as the ST Microelectronics 24C08WP. The sketch above should work if wired correctly. There is no way that the sketch would be producing the output you showed in the screenshot. I can only assume that the sketch is not uploaded to the Nano on COM1.

when i upload the program to the arduino nano on com1 the arduino flashing tx rx leds and when the serial monitor receive data the led rx flashing
and the CH340 Ship is in com1 on the device manager
i changed it to com13 but is the same problem

i tank we have problem of time and main eeprom fast then then programme burned on the arduino nano or maybe if that the pure problem i have more fast MCU FOR GET GOOD Synchronous of communication between the material

i try to weird incorrectly nothing receive no data
i tank to do something else
when the data stored read it and send it to serial and erase the eeprom for read from the same block or byte
for small program writen

i try to read value using this sketch and i find all data equal 0 :hammer:

#include <Wire.h>
#define adress_eeprom 0x50
#define adressmax 2048
int adress = 0;
void setup() {
  Serial.begin(9600);
  Wire.begin();
  delay(300);
  Serial.println("lire");
  for (int i = 0 ; i < adressmax; i++ )
  {
  Serial.print("adress: ");
  Serial.print(i);
  Serial.print("\t");
  Serial.print("valeur: ");
  Serial.println(readbyte(adress_eeprom, i),DEC);
}
}

void loop() 
{
 
}
byte readbyte(int adressi2c,unsigned int adressmem)
     {
      byte lecture = 0;
      Wire.beginTransmission((int)(adressi2c|adressmem >> 8));
      Wire.endTransmission();
      Wire.requestFrom((int)(adressi2c | adressmem >> 8),1);
      delay(3);
      if (Wire.available()){
        lecture = Wire.read();
      }
      return lecture;
     }