How i calculate minimum frequency for PWM on 16F876 at 4 MHz clock?
Thanks
Sat Nov 6 2021, 15:21:38
(no subject)(by MGP)
See the datasheet page 61
With a 4MHz clock you can go above 240MHz.
I wouldn't calculate it but try, LDmicro shows an error when compiling if you go too high or too low.
Sun Nov 7 2021, 02:48:50
(no subject)(by MGP)
Sorry must be 240kHz.
Sun Nov 7 2021, 02:49:41
(no subject)(by Frank)
240 kilohertz? really? and if i need 30 max 40 hertz?
what i change?
thanks
Sun Nov 7 2021, 03:17:21
(no subject)(by MGP)
30 - 40Hz is too low for a 4MHz clock, try it, LDmicro will give you an error.
You need an 800kHZ clock or lower or a controller with a internal oscillator.
Thanks everyone for the answers. I Ttry at 1Mhz clock.
I still have a question:
What math operation should I use if I want reverse PWM to the signal?
For example now I have ADC inputs from 0 to 1024 and PWM from 0 to 100%.
I would like PWM 100% at ADC 0 and PWM 0 at ADC 1024.
Thanks to everyone and greetings from Italy.
Mon Nov 8 2021, 14:14:03
(no subject)(by MGP)
This is how I do it.
Mon Nov 8 2021, 18:14:50, download attachment 000-test.ld
(no subject)(by Frank)
Error at open your file.
Yor version of LDmicro?
Thanks