You could run 2 small motors (using appropriate drivers). The minimum for a practical CNC would be 6 digital outputs (3xspeed, 3xdirection) for the axis motor drivers and tool height control, 1 PWM for the motor speed and 3 digital inputs for the limit switches. That is beyond the Trinket… You could do manual control of the tool height and leave out the limit switches, but that it is not a very practical machine.
I may not have given the best description of what I am looking for. I say CNC just as an example. I am not concerned with “tool height” I just want to be able to move an object on one plane. All it needs is forward / backward / left / right. So it should really only be 2 directions. Imagine rolling a marble on a tabletop.
For the speed… it only needs to go one speed, maybe 2 at the most.
As for the limiter switches… couldn’t I just map out the maximum perimeter and program it to not go beyond that?
If you need to move to a precise position (rather than from one limit switch to the other) then you should use steppers. There are several different types of stepper drivers available, but for that MCU you need to minimize the number of pins, so you would use a step/direction driver, such as A4988.
As each driver will require two GPIO digital ouputs to drive it, the Trinket is usable. However with one GPIO port shared with the USB interface, debugging will be difficult. Is there any reason for going with the Trinket compared with a more capable device?
Mapping the perimeter and using code to limit the movement will work if you know where it starts from. That is, if you manually position it at a known starting point at each reset.
Thanks for your input. The main reason I was interested in the trinket was its footprint (it’s relatively flat, and small in size).
I am looking to put something on a thin board (something like a wooden game board). So the smaller and thinner the better.
I was intending on using steppers, but to be honest, exact accuracy is not really necessary. As long as it’s pretty close.
It will be running the same program every time, but I would prefer not to have to manually reset the starting position every time. Now that I think about it, the footprint isn’t as important. I could use a bigger, more powerful board, but I do want something as thin as possible. Those tend to be the small boards.
The nearest thing to the Trinket form factor, but with enough pins to support two motors, would be the Every.
There are also versions of the Nano and Pro Mini available without headers that are much the same size.
The stepper motor drives are available without headers. The only DC motor driver I can see that would be the same height is the Makerverse.
The only way I can think of to get even approximate positioning without some sort of information available to the controller about the current or initial position would be to use servos instead of motors.