Hi,
I try to use PWM timer with a portenta.
I follow the example provided in the example folder for the portenta:
import time
from pyb import Pin, Timer
tim = Timer(4, freq=1000) # Frequency in Hz
ch1 = tim.channel(1, Timer.PWM, pin=Pin("P7"), pulse_width_percent=50)
But i have the message “Pin(P7) doesn’t exist”
I have try differnet namming for the pin.
When i put Pin(“PC7”) i then have the following error:
"Pin(C7) doesn’t have an af for timer(4)
I have try randomly and if i put Pin(PB7) it doesn’t spit any error message
But according to the arduino pinout there is no PB7
What’s going on ?
I want to try the one name “PC7” on the portenta pinout diagram. https://www.mouser.co.id/new/arduino/arduino-portenta-h7/
Where can i find the proper pin name to use pwm?
The example is likely wrong, I copied it from OpenMV examples. Will need to check the pinout to find which pins map to which timer/channels and enable them for Python.
thanks for your help.
Only PWM7 is available with the vision shield?
I did not notice that. My plan was to program on PWM3,
I guess i have to change it
Other pins may be free it depends on the exact shield you have, and what it has on board, but to be on the safe side you should only use PWM7 while using the vision shield.
I have just tried it out and it work with the PWM3 if i don’t use the camera at the same time. Which is my case in my code. i just use the camera to capture image for qrcode reading.