I2C data logging concepts

I am looking for help with general concepts for logging data over I2C. The data is from separate events, coming from an external module to an Arduino Uno: there could be a few within say 10 ms, and then none for a few minutes. Each event produces a few bytes of data. My aim is both to log the data immediately to flash or SD, and to transmit the data over Xbee. The event data absolutely must not be lost.

With UART this seems to be straightforward, as the serial pins are in permanent interrupt mode to receive serial data. With I2C it seems I would need to poll, and because of the irregular data I would need to poll very often.

The external module has a feature called "tx-ready", which I assume is a flag to tell me whether there is any data to collect, so at least I can poll the flag rather than poll for - potentially absent - data.

So I am working on a few questions:

  1. Is I2C fine for this purpose? Is it easy to write the code to poll for irregular events like this? Perhaps I am over-complicating.
  2. Would there be any point in offloading the logging to a separate MCU? My thought was that a separate MCU could be dedicated to polling, and when it finds data then store it to flash and send it to the Arduino over UART.
  3. Would I store to flash and send to Xbee in parallel, or could I store to flash, and then send from flash to Xbee? I am not sure what the implications are of trying to read/write to flash. Most applications I have found are just writing to SD for later collection.

I have googled what I can. Examples for UART are fairly easy to find; examples for I2C less so. I can find examples for I2C code, but mostly they assume a periodic sampling, rather than irregular events.
Thanks,

Is that external module the I2C master and the Arduino the slave (I guess not).
Does that external module have a hardware interrupt pin (it should have one).

Normally a I2C device as slave has a interrupt signal (a hardware pin), which is connected to the Arduino. The arduino detects the interrupt and read the data from the I2C device.

If that external module doesn't have a interrupt, you have to poll (a lot) the I2C slave. You could use a seperate Arduino for that, but that would only be usefull in extreme situations.
It depends on the buffer of the external module (even 2 bytes could be helpful) and the number of databyte and how often.
Can you tell us more about the module ?

Sending it over the XBee is probably via buffers in the library, so you don't have to store it in memory.

Thanks very much for the helpful response. The module would be a slave to the Arduino. I found that the module has a so-called tx-ready function, which does as you say provide an interrupt. So I can use that to trigger a pull of the data. There is a 4 Kb buffer on the serial interfaces, each event is 28 bytes, so actually I would not need to poll more than once every few seconds anyway.

Do you have any comments on the flash or SD storage? Receive message ---> Flash ----> Output to wireless; or receive the message and split it off to flash and wireless at the same time? The purpose of flash is purely as a backup in case of network failure.

Thanks for your comments. They are very helpful in trying to think it out clearly before plunging in.

It would be possible to save a copy to EEPROM or microSD.
Storing data to EEPROM is fast, that should not influence the other tasks.
The SD card might use more time.

Im trying to connect to i2c bus which sends data form controler to Led panel through m5451. I can see the data using usbee. What im willing to achive is to read the data and use some part of it in Arduino. Is it possible to filtr specyfic adress and upoming data? Kind of parsing? Let me mentoion im unable to program the existing main controller.