Hi. I am using the atmega328p SPI library to control an MCP4151 digital potentiometer.
I am also controlling a speaker with the toneAC library which uses pins 9 & 10.
The SPI SS pin on the atmega328p is pin 10.
A have assigned the CS pin for the MCP4151 to some other pin.
So I am NOT using the SS pin (pin10) for the SPI, only for the speaker.
Question:
I have read that the SS pin MUST be configured as an output when using (initializing?) the SPI.
If the SS pin is configured as an INPUT the SPI on the micro will assume that it is a slave.
Will there be an issue with using toneAC with SPI since it will be pulsing pin 10.
Also at what point in time does the SS pin have to be configured as OUTPUT?
SPI.begin(); ?
Startup?
how about after sleep? does it have to be reinitialized?
And is I let's say configure as OUTPUT at SPI.begin(), can I then go ahead and use PIN 10 as an input or output? how about toneAC?
Can someone please clarify this. Thanks