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

LDmicro Forum - PWM not work

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

PWM not work (by Frank )
Good morning. I have a problem with the PWM of ldmicro. I often use PIC 16F867 or 877.Every time I try to use the PWM function I always have the problem of a high instability of the output. if associated with an input it often goes to 100% even if I have a small value at the input. As if the reading were unstable. In the simulation I have only 2 lines, reading ADC and PWM. I was quite disappointed by this problem, which was always present and never resolved. Or do I make some mistake? Thank you
Mon Jul 19 2021, 04:03:23
(no subject) (by Calubert paulino)
Put your program and I will review it. I use the PWM a lot, you must divide the ADC, if you don't divide it, it won't do you right since it is 1024/11.
If you give me the software you have, I will give you the lines you need to make the PWM

Pon tu programa y lo revisare yo uso bastante el PWM, debes dividir el ADC, si no lo divides no tehra bien ya que es 1024 /11.
si me pasas el software que tienes yo te pondré las líneas que te faltan para hacer el PWM
Mon Jul 19 2021, 06:50:47
(no subject) (by franco )
Thank you for your reply. I explain better because I do not have the file with me. The PWM goes from zero to 100% with bits from zero to 1024 right? The ADC reading then goes from zero to how much? Excuse me and thanks again for your patience.
Mon Jul 19 2021, 10:22:00
(no subject) (by Calubert paulino)
I give you the program of how you should do it and I would like you to tell me if it went well.

Te paso el programa de como debes hacerlo
Mon Jul 19 2021, 12:08:34, download attachment LDPWM.ld
(no subject) (by Calubert paulino)
as the PWM is from 0 to 100 (%), and ADC is 1024: 10 is = 102.4 if you realize I divided it by 11 which is = 93.09. I made it so you can see it but if you want it to be real at 100x100, you have to subtract or add the remaining digits if it is divided by 10 = 102 (in this case it is subtract -2, if the case is Division 11 = 94 you must add + 6,

como el PWM es de 0 a 100 (%), y ADC es 1024:10 es = 102,4 si te das cuenta yo lo dividí por 11 que es =93,09. telo hice para que lo veas pero si quieres que sea real al 100x100, tienes que restar o sumar los dígitos sobrantes si es dividido entre 10=102 (en este caso es restar -2, si el caso es Division 11=94 deves sumar +6,
Mon Jul 19 2021, 12:18:42
(no subject) (by Franco )
Thanks again, you've been crystal clear. I thought that the value to be assigned to the PWM was not the percentage but the absolute value in bits, 1024 per 100%. Thank you all.
Mon Jul 19 2021, 12:24:40
(no subject) (by Calubert paulino)

attached subtraction and addition of 2 channel PWM.
So that you can see how adding and subtracting by heyo is done, 2 ADCs have been put to see one adding and the other subtracting, hambos are correct.


adjunto resta y suma de PWM 2 canales
Mon Jul 19 2021, 12:55:35, download attachment LDPWM2Canales.ld
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):