Servo documentation needed

In matrix core , the nodejs as well as the python test files have a servo example. I need access to the gpio pins to connect a servo but the matrix creator occupies all of them. Is there a document somewhere that clarifies ways to connect a servo to the matrix creator?

can I use a stepper motor instead of a servo?

To connect a servo to the MATRIX Creator board you have the expansion GPIO connector (see in the datasheet).

  • Pins from 1 to 17 can be used as regular gpio
  • Pins from 1 to 8 can be set as PWM pins. Either for PWM output (servo, motor control, dimming) or input (reading pwm signal e.g. RC remote RX).

Important to note that those pins are 3.3v and can’t provide too much current (<10mA). So you should use a logic level converter (e.g. SparkFun Logic Level Converter).
image

If you are not sure how to connect it please check out the Hookup Guide, its really good. If in doubts please ask us her eon the community before connecting to make sure you don’t do any damage to the board.

Let us know how it goes!

1 Like

thank you for your detailed reply. Can I connect a raspberry pi as well as a motor to the matrix?
It would seem I have to use the gpio for both devices. My project is to use the matrix to detect the direction of arrival of sound and then to use the pi to turn the motor towards that direction.

Did you read the hookup guide? You need to check the voltages (3.3 vs 5v) and the current (A) the ports can deliver.
I assume that a motor always needs more current then a GPIO port can deliver, so you need to use a relay, or mosfet alike. Google is your friend :slight_smile:

Thank you Yoel and OPk. My understanding about the hardware is limited. I attached the matrix to the pi and followed that tutorial. I got the everloop demo to work.

During that process, I never enabled the i2c or spi bus in raspi-config.

Now I want to add a motor to the mix. Yes I know I need a driver board and I will be using a dc motor with an attached encoder. But the matrix covers all the GPIO pins. Stupid question: how do I connect the wires from the motor driver board to the pi without interfering with the matrix creator/matrix voice?

Yes I read that hookup guide you linked but it simply describes the use of a logic converter to the GPIO. My question is more basic- how do you attach anything to the pi-matrix thing without interfering with pi-matrix communication?

I see the GPIO header under the matrix (next to where it connects to the pi). But are all the pins active? Doesn’t the matrix use some of those circuits to talk to the pi?

This thread

Talks about the matrix fpga running code to drive the GPIO pins on the free header on the matrix? I am confused. If I want to drive a motor based on data obtained from the matrix, How do I get the pi to tell the fpga to move the motor? Or should I ditch the pi and just run everything on the fpga?

Yesterday I played around with PWM on the Creator, so I used the GPIO ports on the back of the Creator. I simply connected an osciolloscope to pin 0 and GND and run the servo demo. After that I created python bindings and implemented the whole thing with python. The result was a simple demo to dim an LED.

So so far everything works without problems.

You will probably have to connect your motor controller to certain GPIO ports of the Creator and then configure these ports correctly in your code (as a template, for example, the servo demo). What exactly depends on the controller board you are using.

As yoelrc wrote above, you can use all external GPIOs, they are all free.

You don’t have to do anything yourself in the FPGA.