Hi!
Tell me pls. Is Serial lib interrupt based ?
And what happen if i define my own ISR (USART_RX_vect) + Serial.begin(9600) in " void setup()" routine?
--
Thanks for answers!!
Hi!
Tell me pls. Is Serial lib interrupt based ?
And what happen if i define my own ISR (USART_RX_vect) + Serial.begin(9600) in " void setup()" routine?
--
Thanks for answers!!
Tell me pls. Is Serial lib interrupt based ?
Yes. Both incoming and outgoing.
And what happen if i define my own ISR (USART_RX_vect)
If you have to ask, I'd venture to say "Nothing good".
And where I can define (or just to see) size of incoming serial buffer ?
Have you looked in HardwareSerial.h?
Size of buffers is defined in HardwreSerial.cpp.
@PaulS
If you have to ask, I'd venture to say "Nothing good".
Yes, the serial lib is interrupt based. The sourcecode is located in
[arduino lib]\hardware\arduino\cores\arduino\HardwareSerial.cpp and HardwareSerial.h
If you supply your own ISR (USART_RX_vect) the you will have to handle the received chars. (The lib routine will store it in a ring buffer unless there is a parity error)
As far as i can it sould work setting the baudrate by calling Serial.begin even if you replace the ISR for receiving
edit: have a look here:
You can't define your own ISR(USART_RX_vect) unless you first prevent HardwarSerial from defining its version.
You could modify the HarwdwareSerial to call your code instead of its own. I was experimenting with that here - but with IDE 1.5.6
You need to modify Arduino.h if you want to stop HardwareSerial being included.
...R