Hi guys!
I'm wondering how can I interact a TB6612FGN motor driver with a SD ...
My problem is:
-> the SD card needs to be on pins D11, D12, D13 and the CS can be on any pin
-> I have a timer interrupt setup on TIMER1 so I would likely avoid his PWM pair (D9 and D10)
-> and i need to add a TB6612FGN with 2 motors on 4 PWM pins (so D3, D5, D6, D11)
-> how you can see the driver and the SD card uses one common pin.
I think that if I could use the motors and the SD card on the same pins or if I could use other pin for the SD card, I could make this work.
Keep in mind that I'm gonna print my own circuit board, I'm not gonna use an Arduino board, just the atMega328p-pu so you may propose other pin configs too.
Yes, it's like that Pololu driver, it needs two PWM for each motor ... And I can't abandon the interrupt.
But i found a Adafruit library for Arduino and i think that this should work. It adds the void SD.end(void); function.
I don't know if this will help me ..
I don't see how it will. Pin 11 is an SPI pin, and anytime you want to write to the SD card, you will have to have the motors either stopped or running full speed (so PWM is not needed).
PaulS:
You are probably right, but that is not the only device that can drive two motors. The choice of a different driver would eliminate the pin conflicts.
PaulS:
I don't see how it will. Pin 11 is an SPI pin, and anytime you want to write to the SD card, you will have to have the motors either stopped or running full speed (so PWM is not needed).
I really need to read and write to the SD in the setup. So you say that if i don't use the SD card i can use the pins after closing the file without affecting the data?