Code outside ISR

Prompted by, but not wanting to hijack it, I have an ISR that works in itself and indeed have kept the serial stuff out, but there is an awful lot of other code displaying, recording and sensing.

I have been wondering if it is a good idea to have a ProMini as a peripheral that has the ISR and nothing else. This measures the flow meter and sends a single integer at one second intervals to a Mega which does everything else and then waits for the next integer, i.e. Pro Mini also serves to time the loop.

Gee, I hope this is a good idea, as I already have a ProMini....

If your ISR is doing so much that you are concerned about getting other things done in time, you probably have a poor system design. But without a LOT more detail, there is little more anyone can say…

Regards,
Ray L.

there is an awful lot of other code displaying, recording and sensing

Is there a compelling reason why any of this is in the ISR?

Thanks. I didn't explain myself properly. I thought the "other code" was indeed outside the ISR but now I'm not so sure as I have not attended this project since 2015 and i have so many versions, most of which should certainly have been deleted. I will have to try and sort that out. It could be that the real issue here is late nights and slack-arsed file management.

The problem was that my Arduino heat meter would do all the tricks I wanted, but was nowhere near the accuracy of a store-bought one, even though a basic flow meter was really good.

I take that this morning's thought bubble about a peripheral ProMini was not a very good one......

I take that this morning's thought bubble about a peripheral ProMini was not a very good one

It is fine to use distributed processing, and the extra processing power might be required for the application. But the interprocessor communication may present a challenge.

I was just trying to understand your comment about a bunch of code being inside an ISR, possibly unnecessarily.

jremington:
It is fine to use distributed processing, and the extra processing power might be required for the application. But the interprocessor communication may present a challenge.

That is interesting. I was just thinking ProMini would send an integer over serial and Mega just keeps listening for it to arrive before it does anything else. All I have done in this arena is have Mega check for incoming serial as it goes round its large loop, which might not be quite the same thing.