Execution of two operations or two set codes or two functions simultaneously

I am working on a project which involves following two operation which has to executed simultaneously.

  1. Need to read analog data from analog input pin and store converted digital data in EEPROM in consecutive memory for every 1/400 miliseconds, continuously in a loop.
  2. Simultaneously, Perform an algebraic operation on 0-100 EEPROM memory locations (of coarse after writing first 100 EEPROM memory locations ). then on 100-200 EEPROM memory locations and so on continuously in another loop

Note : By the time last memory location of EEPROM is being written using operation 1, Operation 2 (algebraic operation) must be executed on LastMemoryMinus100-LastMemory simultaneously. Do not want to use the concept of interrupt. Because in interrupt any one of the operation will be executed at any instant.

Please let me know if any of the arduino supports above logic of executing both operation 1 and operation 2 simultaneously?

If non of the arduino supports above logic, is it possible to share an single EEPROM by two arduino?

Please help me with the above problem.

Thanks and Regards, Nuthan Prasad

Please let me know if any of the arduino supports above logic of executing both operation 1 and operation 2 simultaneously?

The Arduino can only do one thing at a time but it can do one thing after another so quickly that they appaer to be happening at the same time. The trick is not to block the operation of the loop() function so that it repeats as fast as possible. This means not using blocking functions such as delay().

The usual method employed is to use the value of millis() to determine whether it is time to do something which means that loop() can be free running.

This thread should help you understand the principle Several things at the same time

DO NOT CROSS-POST, CROSS-POSTING WASTES TIME.

Duplicate deleted.

  1. Need to read analog data from analog input pin and store converted digital data in EEPROM in consecutive memory for every 1/400 miliseconds, continuously in a loop.

You need to do an analogue read and two EEPROM writes in 2.5 microseconds? Forget it.

Also note that an intenal EEPROM Write takes 3.3mS.

You can add some external buffering and share an external EEPROM between 2 devices. Easy way would be an I2C SRAM, each device can control the bus. Faster way would be an SPI SRAM, buffer the signals from each master using 74HC125 or similar so the control lines are not tied up when not in use. Add some handshaking so each knows when the other is access the device.

Also note that an intenal EEPROM Write takes 3.3mS.

3.3 mS x 100 =3300 mS = 3.3 Seconds

Clearly you have no understanding of microprocessor or the timing of instruction cycles. Short answer: No, it's not possible, with an arduino or any other generic uP. There might be some very high speed embedded processors that could do it but likely you could not afford them.

Clearly you need some new batteries in your calculator!
3.3mS x 100 = 330mS
0.0033S x 100 = 0.33S

Clearly you need some new batteries in your calculator!

OOPS !

My bad. I was in a hurry and didn't proofread it. Anyway , 330 mS/2.5 uS = 132000, which is over 130,000 times longer than the OP is asking for. Did I get that right ?

I think you’re correct, depending on how “every 1/400 miliseconds” is interpreted.

Another option would be external FRAM - SRAM speeds for access, with EEPROM non-volatility.
8096 bytes are not expensive, can access at full SPI speed (8 MHz)
http://www.digikey.com/product-detail/en/MB85RS64VPNF-G-JNERE1/865-1260-1-ND/4022676
Buffer SCK, MOSI, CS as I mentioned earlier if sharing between 2 devices.
With clever programming, can support ~1uS per byte for a transfer, so just over 100uS to read/write 100 bytes.

Smells like another XY problem.

Aaaaaan yet again I came to a thread that doesn’t interest me, thinking this was a new thread thanks to the change of subject…

@Paul__B: Please stop changing thread titles mid-thread.

You can rest assured, I won't ask again.

Why EEPROM? This looks like a recipe to wear out the EEPROM in a few days. (No, I haven't calculated it; it could be weeks.)

This looks like a case for RAM! You know, regular computer memory, which is a little limited on the Arduino but it should be RAM enough for this task.

Question: are the two actions synchronous? One sample and one calculation on the same time schedule?

*You can't use "simultaneous" and "after" in the same sentence. I think "after" is better.

JimboZA: Aaaaaan yet again I came to a thread that doesn't interest me, thinking this was a new thread thanks to the change of subject.....

This ageist discrimination against "old" threads begins to concern me.

I could be wrong, but no-one seems to be willing to answer my question.