Prox / RFID
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Resume / Consulting
Contact Me

LDmicro Forum - PWM

(you are viewing a thread; or go back to list of threads)

PWM (by Frank)
How i calculate minimum frequency for PWM on 16F876 at 4 MHz clock?
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?
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.

Read this
Sun Nov 7 2021, 05:00:58
(no subject) (by Frank)
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?
Sun Nov 14 2021, 13:03:54
Post a reply to this comment:
Your Name:
Your Email:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):