4
\$\begingroup\$

I have a raspberry pi that I really want to be able to control some motors and was thinking of this one at sparkfun: http://www.sparkfun.com/products/9670

The problem is that the Pi does not have digital ports? And the motor require it for control (low/high signal). Is the GPIO on the Pi just plain analog? If thats the case, is there a addon that could transform signal from the Pi to the motor digitally?

\$\endgroup\$
3
\$\begingroup\$

I haven't seen the datasheet(*) of the Raspberry' BCM2835 SoC, but I would be surprised if it didn't have digital I/O. I guess the I/Os are configurable for either analog or digital, and input or output.

edit
This document describes the Raspberry/BCM2835 peripherals; on page 90 ff it describes how to configure I/Os for either input, output or one of up to 6(!) alternate functions.

enter image description here


(*) Apparently, Broadcom doesn't really want us to see the BCM2835 datasheet, since we have to a fill in an information request form to get at it. Not for me.

\$\endgroup\$
3
\$\begingroup\$

Do you just want to switch the motors (on, off, reverse)? That's no problem, there are some digital I/O pins available on the 2x13 pin connector, as shown in Oli's answer. Note that the L298 wants 5V supply, not 3v3. Its logic pins require a minimum of 2.3V for a logic 1, so that matches with the 3v3 outputs of the Pi (this is not always the case for 5V chips).

You can't measure the motor current without additional hardware, because the Pi has no (exposed) A/D inputs.

If you want to PWM the motors (proportional control) you are more limited: the BCM2835 chip has two PWM channels, but only one can be made available on the 2x13 pin header: GPIO18 (PWM0).

If you program the Pi bare metal (without an OS) you could do software PWM.

\$\endgroup\$
1
\$\begingroup\$

Yes, it's GPIOs are digital. They can also be configured for alternate functions:

Rpi

The above (partial) table is from here, which has the rest of the table and goes into plenty of detail about the GPIOs.

\$\endgroup\$

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.