user52996: I have anecdotal experience that using Serial.print inside a slave's SPI interrupt routine (ISR) causes issues with transmission. It also seems that interrupts may be called more than once before the main loop can react, so it is difficult to print info from all interrupts. Is this because Serial is inherently unsafe, or too slow? Can Serial be used safely inside the ISR routine?

user52996: In general, interrupts should run as fast as possible. This is especially true when using SPI, since in the slave's ISR, the slave needs to put a byte in the SPI Data Register (SPDR) before the next transfer occurs. Thus it is good practice to avoid Serial transmission entirely in an interrupt, since in simple interrupts it can be by far the slowest portion of the interrupt. 

user37622: Hardware Serial write(byte) function in Arduino AVR core will work in interrupt. It checks if interrupts are disabled and if yes and the buffer is full, it executes directly the interrupt function, which pushes bytes from buffer to output.
(All write and print functions of hardware Serial use the write(byte) function to send data.)
It depends on other factors if a long time spent in interrupt handler will disturb things.

user27653: Serial should be avoided in ISRs because interrupts are disabled inside ISRs, and Serial transmission uses interrupts to operate. Better to have the ISR set a flag that is read in the next iteration of loop() to print the desired info.

52996: <p>I have anecdotal experience that using Serial.print inside a slave's SPI interrupt routine (ISR) causes issues with transmission. It also seems that interrupts may be called more than once before the main loop can react, so it is difficult to print info from all interrupts. Is this because Serial is inherently unsafe, or too slow? Can Serial be used safely inside the ISR routine?</p>
 52996: <p>In general, <a href="http://users.ece.utexas.edu/~valvano/Volume1/E-Book/C12_Interrupts.htm" rel="nofollow noreferrer">interrupts should run as fast as possible</a>. This is especially true when using SPI, since in the slave's ISR, the slave needs to put a byte in the SPI Data Register (SPDR) <em>before</em> the next transfer occurs. Thus it is good practice to avoid Serial transmission entirely in an interrupt, since in simple interrupts it can be by far the slowest portion of the interrupt. </p>
 37622: <p>Hardware Serial write(byte) function in Arduino AVR core will work in interrupt. It checks if interrupts are disabled and if yes and the buffer is full, it executes directly the interrupt function, which pushes bytes from buffer to output.</p>

<p>(All write and print functions of hardware Serial use the write(byte) function to send data.)</p>

<p>It depends on other factors if a long time spent in interrupt handler will disturb things.</p>
 27653: <p>Serial should be avoided in ISRs because interrupts are disabled inside ISRs, and Serial transmission uses interrupts to operate. Better to have the ISR set a flag that is read in the next iteration of <code>loop()</code> to print the desired info.</p>
