0

I am working on a Project with (a) Arduino Uno Clone (6 PWM Pins i.e, 3,5,6,9,10,11) (b) 6 Servos (c) MicroSD Reader Module (d) Speaker

As We Know that MicroSD reader modules uses pins 10, 11, 12 of an Arduino board, but my pin 11 is already being used by a servo motor. 1. Then how can I connect the MicroSD reader in my project ? 2. Which pin can I use for the speaker in this case ?

Please help me plus Provide me some additional information if needed.

3

The best answer is: don't use pin 11 for your servo motor - move it to another pin.

The SD card needs SPI. SPI is pins 10/11/12/13. You can't change that. You can much more easily move the servo to a different pin, since there are multiple PWM pins that can support the servo in hardware. If they are all taken then software PWM is easy and there are libraries available to do it for you, so you can use any IO pin you like for that. Much simpler than re-writing the SD card software to use bit-banged SPI on other pins (which would also be incredibly slow).

  • Please Give me Link to that Soft PWM. And what about the speaker? Does it also needs PWM pins ? – Kumar rajit Aug 23 '15 at 11:05
  • Tone works on any pin. I don't have a link off hand, ask Google. – Majenko Aug 23 '15 at 11:41
  • The Servo library he is using is most likely already using software PWM. You can't use pins 5 and 6 as servo pwm pin without messing up the delay and millis functions. – Gerben Aug 23 '15 at 12:03
  • Pin 10 is not mandatory for SPI. Slave select can be performed with nearly any other pin without complicating matters. – Ariser Aug 24 '15 at 11:19
  • 1
    @Ariser Pin 10 is special. It's the SS pin, and has to be in the right mode for SPI to work right. If pin 10 is set to output then SPI is in master mode. If pin 10 is set to input then SPI is in slave mode. It's part of the SPI module and can't be changed. Yes, you can also use any other pin as your slave select, but you still have to take care that you don't break SPI by using pin 10 wrong. – Majenko Aug 24 '15 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.