HI
In the article Serial - Interrupt - Syntax & Programs - Arduino Forum user MEM writes this: (#2)
"
Re: Serial - Interrupt
#1
Sep 22, 2008, 04:19 pm Last Edit: Sep 22, 2008, 04:21 pm by mem Reason: 1
I doubt you will want to do that. The serial data is captured using an interrupt to put each character into the serial input buffer. If you add any additional processing to that interrupt or trigger another interrupt then you may lose incoming characters because the arduino disables interrupts when it is in an interrupt handler.
Perhaps if you say a little about what you want your application to do, you can get some suggestions on how to handle serial data while the sketch is also processing some other tasks.
"
Sorry for asking, but I need to have this really nailed (7 inches nails ) .
Does this means, that every time when we Use the Serial.___ GET CHAR (not af function, merely a general name of ALL functions getting a Serial char from the serial port) we DO an Interrupt and the software handles the ISR-routine. ? (So we, as users, don't have to worry about the details).
And IF we write our own SERIAL.ISR we do the Interrupt twice ? (pretty stupid, btw) .
And last question, If I want to use the built-in Interrupt, how do I get the Data from the RX-register, reset the Interrupt flag(s) (if more than one) ?
I plan to build a system consisting of one 2560 Mega interfacing 2 AT328P Uc's. (NOT UNO's but pure AT328P UC's).
2650/ Serial(0) is used by the Computer / USB interface.
2650/Serial1 will be used for commands/answers to/from AT328P(1 / serial) and the second At328P (2650/ serial2) will be used as a system hardware Monitor. Using serial for programming and Interrupt.
IF a severe hardware error occur (AT328(1) + 2560 peripherals) the 328P(2) fires a serial interrupt to the 2560, forcing a close-down of the peripheral(s) on the relevant Uc. Eventually ALL peripherals depending on Error-code.
Using POLL here will not be an option . !
Kris