How do I enable the Rx interrupt on the Arduino?
What I'm doing right now is I have a SeeedStudio flow sensor attached to Int0 on an ATMEGA328, every time the sensor output goes "high" I increment a counter, this is my "Barnduino".
On my Arduino Mega I have a DS1307, (amongst other things!), I've enabled the 1hz square wave output on the DS1307 and have it connected to Int18, so every second I increment a counter, every 60 seconds I send an "F" to my "Barnduino", which sends back how many pulses the flow sensor has produced, then every 10 minutes I wake up an SHT15 temperature/humidity, take a reading, if it's below the current minimum or maximum recorded value the latest value replaces either the min or max value, once an hour I write the min/max temperature, humidity and how many pulses the "Barnduino" has recorded from it's flow sensor to a bank of 24LC254 EEPROMS.
Once a week we get the data, send it off to management and clear the storage.
What I want to do is when the "Barnduino" senses "abnormal" water flow, it will send an "A", for an alarm state, to my Mega.
Most of the time the Mega is just sitting there waiting for the next interrupt from the DS1307 or a keypress.
The longest the "Barnduino" can go without having it's flow count queried is 60 seconds, which is fine.
I thought it might be an elegant addition to have the Mega's UART RX interrupt in play, just for the hell of it.
Reading the ATMEGA data sheets I know it's possible.
And yes, I realise this is overkill, but it might come in handy to know for something else.