PWM on PYNQ_Z2 to a motor

I Need help, please How to give PWM to a motor through a digital pin on PYNQ-Z2 using PMOD or how can I do it?

@Ismael_Alejandro_Rod check this and this Those links should help

@Ismael_Alejandro_Rod you need something similar to this piece of code

from pynq.overlays.base import BaseOverlay
base = BaseOverlay('base.bit')
from pynq.lib import Pmod_PWM

# Select PMOD (PMODA or PMODB) and output pin (0 -7)
pwm = Pmod_PWM(base.PMODA,2)
# Set period in ms and duty cycle
# Stop PWM

PMOD pinout is shown here Bear in mind the maximum current that these pins can provide.


thank you so much marioruiz, one question more, please. which is the maximum current that these pins of PMOD can provide?

It depends, but maximum 14 mA. You would need some kind of driver if you want higher output current.


thanks you so much marioruiz
the pins of package arduino also provide the same current ?

Yes, maximum of 14 mA.

marioruiz one question more, the period is in miliseconds(ms) or microseconds (us)?

It is in microseconds (us), more documentation here