its difficult to check data sheets again and again, so its better to quit embedded study 😛
]]>Check the datasheet of PIC 16F877A, register CCPxCON. In that bits CCPxX and CCPxY are least significant bits of PWM duty.
]]>Kindly use our forums ( https://electrosome.com/forums/ ) for asking doubts outside the scope of above article.
Please mail to [email protected] if you need premium support.
]]>The main thing that you need to understand is the PWM resolution will change depending on the oscillator frequency and pwm frequency. That is why we are calculating like this.
]]>can someone explain to me how this code work in calculating duty cycle
Pls help, Thank you
TRISB = 0; is not required there
TRISC bit will be written by PWM1_Init() function.