I'm trying to call an interrupt routine (let's call it handler() ) every second on my arduino DUE. I thought the simplest way to do this was to use this library but it seems that i don't know how to use it...
1 Answer 1
You are trying to print 6 characters ("test\r\n"), i.e. 60 bits including the start and stop bits, 1000 times per second. This requires a baud rate of at least 60 kbit/s, yet the serial port has been configured for only 9.6 kbit/s. Something has to give...
As Mikael Patel wrote in a comment, it is generally inadvisable to
Serial.print()
from within an ISR. It is supposed to work, though, as
long as you don't fill the Serial
output buffer. The problem is that
your code does fill the buffer, as it is writing to it faster than the
UART can empty it. Once the buffer is full, the program will
malfunction.
start(1000000)
.