Has anyone ever written a program to convert PWM pulses to analog value?
If yes can you explain to me the principle.
I looked at OSCAT, but I did not find !
Thank you in advance
Best regard
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
Has anyone ever written a program to convert PWM pulses to analog value?
If yes can you explain to me the principle.
I looked at OSCAT, but I did not find !
Thank you in advance
Best regard
You have a constant frequency usually, then you know the total time between first rising edge to second rising edge:
T = 1/f.
Period can also be calculated and averaged in software if frequency is not known.
Then you check the length of the on-pulse and then for example get the percentage on-time from total periode-time.
Or even easier, use a first or second order low-pass filter and get an analog voltage.
Thanks a lot somlioy , I'll try this soon.
ja aproveitando a discussão, eu estou com um problema relacionado ao uso da biblioteca OSCAT. estou tentando usar o bloco pwm, porém nao consigo executar.nao tem uma entrada para a função execute