Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
My program is varying duty cycles taking them from a lookup tgable therefore it is difficult to change ccp1rl at the same time changing ccp1con and the signal is at 200khz therefore the resolution is to be about 6 bits so how do I set these in my program.
One possibility is leaving the LSBs in CCP1CON set to zero, while changing only the eight MSBs in CCP1RL this would effectively reduce your PWM duty cycle resolution by a factor of 4.
This means your changes to the PWM duty cycle will by coarser, larger changes.
---------- Post added at 09:00 ---------- Previous post was at 08:51 ----------
Here's a thread discussing modification of PWM duty cycle:
CAN YOU PLEASE HELP ME ON SINUSOIDAL PWM .Is the value of ccpr1l loaded by an interrupt service routine of tmr2 or there is need to use another timer . I want to get a 50hz sine wave therefore should I use tmr2 to change the duty cycle.how am I going to determine the 50Hz frequency in my code most preferebly in asm.My switching frequency is 200khz .
I'm working on a ASM program using interrupts to generate PWM.
Actually, I found some code from a previous project using PWM sinusoidal generation, so I modifying it to fit your needs. I'll also physically test the algorithm.
Quick question, by "...switching frequency is 200kHz", you mean the sampling frequency of PWM, correct?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.