Page 1 of 1

PWM in analog extension

Posted: Mon May 29, 2023 5:42 pm
by f_sat
Hi, I want to generate 3 pwm to be able to control 3 brushless motors, since the pitaya only has 2 RF outputs, I thought about using the analog outputs of the extension connector, is it possible? And if so, just change the name of the pin in the code? For more information I am using the C code of the function generator.

Ej.

rp_GenFreq(RP_CH_1, 20000.0); // I only have to change "RP_CH_1" for the name of the analog pin?

Thanks

Re: PWM in analog extension

Posted: Tue May 30, 2023 9:12 am
by juretrn
The slow analog outputs are not meant for generating this sort of signal, but for creating a slowly changing (or static) DC reference.
I think the best idea would be to use the GPIO pins to create a PWM signal.

Re: PWM in analog extension

Posted: Wed May 31, 2023 12:56 am
by f_sat
I see, thanks, any idea how do this with GPIO?

Re: PWM in analog extension

Posted: Fri Jun 02, 2023 10:46 am
by redpitaya
The best way is to reprogram the FPGA logic of the GPIO pins to have them function as PWM pins.

The settings can be changed by writing into specific registers using C.

Here are a few tutorials that might be useful:
https://lniv.fe.uni-lj.si/redpitaya/
https://redpitaya.com/teaching-materials/