I'm pretty new still, but am working on a ambitious project using some analog input, controlling a few stepper motors, and displaying sensor data/position data back on the lcd.
Hardware is a Mega2560 with a sainsmart TFT shield, the v2.2 version they no longer have the data sheet on their website for -_-
Right now i'm utilizing 3 of the analog inputs, and i have about 6-7 PWM channels left, plus all of my tx/rx digital pins. The TFT literally uses everything else.
Main problem
How the hell can i control 4 steppers with only 6 pwm pins left. Generally a decent driver looks like it want's 2 pwm pins per driver, and 2 digital pins per driver. Totaling me up to a lot of pins i don't have.
Does anyone know of a stepper driver that works off I2C and can be strung together? My next thought was SPI, but the TFT is utilizing that as well. The last idea i had was maybe using a SPI device in softwareSerial? Also an SPI device that can be chained. Either way i don't have 16 extra pins.
I found this.... and maybe it could work with softserial instead of spi, but its also $33 a break-out. Kind pricey. 4 steppers puts me at 120$ just in breakout boards.
Whats my best option? Running another arduino in slave as a motor-only board?
There are a bunch of I2C stepper motor driver solutions. You'll need to look at the specs of the available modules and figure out which ones will meet your needs.
DrAzzy:
There are a bunch of I2C stepper motor driver solutions. You'll need to look at the specs of the available modules and figure out which ones will meet your needs.
I2C would allow me to run multiple drivers on one line correct?
hanslanda:
I2C would allow me to run multiple drivers on one line correct?
hanslanda:
I2C would allow me to run multiple drivers on one line correct?
Potentially - different I2C motor drivers will have different capabilities, consult the documentation/datasheet for the I2C motor drivers you're looking at. There is a lot written about this; I suggest you do some googling.
hanslanda:
How the hell can i control 4 steppers with only 6 pwm pins left.
Stepper motors don't need PWM pins. Any digital I/O pin will do.
You have not said what stepper motor drivers you are using. The specialised stepper drivers (such as the PololudRV8825) just need 2 pins for step and direction.
Robin2:
Stepper motors don't need PWM pins. Any digital I/O pin will do.
You have not said what stepper motor drivers you are using. The specialised stepper drivers (such as the PololudRV8825) just need 2 pins for step and direction.
hanslanda:
I think it had to do with speed control. This is the driver i was referencing i believe.
That driver can be used to drive one stepper motor or two DC motors. You would use the pwm connections for speed control with DC motors. For stepper motor, they should be connected to Vcc.
PaulRB:
That driver can be used to drive one stepper motor or two DC motors. You would use the pwm connections for speed control with DC motors. For stepper motor, they should be connected to Vcc.
Alright it looks like i have a fundamental misunderstanding here. Thanks guys ill do more reading. Allowing me to use all of my digital pins makes it much more doable. Thanks guys.