Integrating 28BYJ-48 Servo Stepper Motor With Jetson TX2

I have a servo motor that I would like to integrate with the TX2 board. It is already connected to the appropriate driver which now needs to be interfaced with the GPIO pins of the TX2.

Here’s an image of the driver that I am using

The driver has 4 control inputs to be connected, however, I am not sure which pins it has to be connected to on the J21.

I looked at a pinout diagram I found on NVIDIA Jetson TX2 J21 Header Pinout - JetsonHacks and I believe I would be connecting it to GPIO_GEN3, GPIO_GEN4, GPIO_GEN6 and GPIO12. Please correct me if I’m wrong about this.

I am also unsure about how I would write code to configure this as well as get it to rotate. Any assistance would be appreciated.

hello nicholas.bissessar,

you’ll need to have pin connections to provide regulators. in order to configure the motor speed, you should have PWM pin to configure period and duty cycle.
please also check this topic, Can i control LCD1_BKLT_PWM? for using PWM pins.

Hello Jerry, can you explain what you mean exactly by pin connection? Are you referring to a pinout or a circuit diagram? Also I am not sure whether stepper motors required the use of PWM since the pulses are digital 1 or 0.

hello nicholas.bissessar,

so, by using GPIO is enough for this.
please refer to GitHub - NVIDIA/jetson-gpio: A Python library that enables the use of Jetson's GPIOs to control GPIO pin.

Hello Jerry, I finally got around to using the library for the GPIO pins. Took a little while but I found that there is a c++ version of this library and I installed it. I am having some issues mapping the pins however. It seems to me that the pin numbers you assign in the code does not correspond with the pinout of the Jetson TX2 header. Any ideas on this?

I managed to configure the GPIO pins and I am getting my motor to rotate. The only problem I am encountering now is the speed at which the motor is rotating is extremely slow. Do you have any idea about using stepper motors or how to increase the speed at which it rotates? Is there anyway to call a delay in microseconds?

hello nicholas.bissessar,

you may probe the pin to check the output voltage, thanks