Does Arduino SPI use up a timer

arduinoavrspistepper motortimer

I plan on using a barebones Atmega168 running an Arduino sketch to drive two stepper motors and a heater. To interface with the steppers and heater I want to use 4 PWM pins. I will also have an SPI connection to a host controller so that the host can request a certain amount of steps at a given speed or demand that the heater be heated to a given temperature. To drive the stepping action I will need an interrupt every 100 micro seconds or so.

Now to do this I will probably need and open timer channel (or am I wrong), I know my 4 PWM pins will be using 4 of the 6 available timer channels, but will the SPI be using any and possibly cause some issues?

Best Answer

The SPI module has its own baud rate generator so it does not consume any of the timers. And the baud rate generator is only used in SPI master mode. In slave mode, it is synchronized to the clock of the external master. The only issue you may have with SPI is dealing with the data byte in a timely fasion as it is not possible for a slave to delay SPI like it is with I2C.