Does hardware SPI utilizes PWM?

The Photon spec says that there are certain pins that you can’t use on PWM mode at the same time:

[3] PWM is available on D0, D1, D2, D3, A4, A5, WKP, RX, TX with a caveat: PWM timer peripheral is duplicated on two pins **(A5/D2) and (A4/D3)** for 7 total independent PWM outputs. For example: PWM may be used on A5 while D2 is used as a GPIO, or D2 as a PWM while A5 is used as an analog input. However A5 and D2 cannot be used as independently controlled PWM outputs at the same time.

Currently, I have an SPI TFT screen connected to A5 and a speaker using the tone function (that uses PWM) in D2. This would be an issue if hardware SPI uses the PWM capability of the A5 pin. @BDub, do you know if that is the case?

Thanks!

Hi @sazp96
It would only be a problem if you were to use the PWM on both the pins at the same time. Using SPI on one and PWM on the other is not an issue.

2 Likes

Awesome. Thanks @mohit!