Comments on: Generating PWM with PIC Microcontroller using Hi-Tech C https://electrosome.com/pwm-pic-microcontroller-hi-tech-c/ You Inspire.....We Create..... Fri, 15 May 2020 15:26:32 +0000 hourly 1 https://wordpress.org/?v=6.1.1 By: praveen https://electrosome.com/pwm-pic-microcontroller-hi-tech-c/#comments/9656 Fri, 15 May 2020 15:26:32 +0000 https://electrosome.com/?p=7342#comment-9656 In reply to Ligo George.

its difficult to check data sheets again and again, so its better to quit embedded study 😛

]]>
By: Ligo George https://electrosome.com/pwm-pic-microcontroller-hi-tech-c/#comments/9650 Mon, 11 May 2020 14:09:34 +0000 https://electrosome.com/?p=7342#comment-9650 In reply to praveen.

Check the datasheet of PIC 16F877A, register CCPxCON. In that bits CCPxX and CCPxY are least significant bits of PWM duty.

]]>
By: praveen https://electrosome.com/pwm-pic-microcontroller-hi-tech-c/#comments/9646 Mon, 11 May 2020 07:52:43 +0000 https://electrosome.com/?p=7342#comment-9646 CCP1X = duty & 2;
CCP1Y = duty & 1;
can u explain this?

]]>
By: ajit nayak https://electrosome.com/pwm-pic-microcontroller-hi-tech-c/#comments/6942 Fri, 24 Nov 2017 13:11:00 +0000 https://electrosome.com/?p=7342#comment-6942 Thanks for Provide information.
IF i want to change frequency how can i change it. PWM1_Init() function will during first time . Is it means when program enter while loop it generate frequency @ 5khz??
int PWM_Max_Duty()
{
return(_XTAL_FREQ/(freq*TMR2PRESCALE);
}
what does freq default value ?? it has been defined as long.

]]>
By: Ligo George https://electrosome.com/pwm-pic-microcontroller-hi-tech-c/#comments/6519 Sun, 27 Nov 2016 09:16:00 +0000 https://electrosome.com/?p=7342#comment-6519 In reply to ranjith thottathil.

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.

]]>
By: Ligo George https://electrosome.com/pwm-pic-microcontroller-hi-tech-c/#comments/6490 Sun, 27 Nov 2016 07:50:00 +0000 https://electrosome.com/?p=7342#comment-6490 In reply to Jason Ah Woei.

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.

]]>
By: ranjith thottathil https://electrosome.com/pwm-pic-microcontroller-hi-tech-c/#comments/6463 Thu, 24 Nov 2016 06:17:00 +0000 https://electrosome.com/?p=7342#comment-6463 can u help me into implement a stepper motor angle controller using pwm where we can change pwm frequency using 4*3 keypad?

]]>
By: Jason Ah Woei https://electrosome.com/pwm-pic-microcontroller-hi-tech-c/#comments/6422 Tue, 18 Oct 2016 14:17:00 +0000 https://electrosome.com/?p=7342#comment-6422 PWM1_Duty(unsigned int duty)
{
if(duty>2;
}
}

can someone explain to me how this code work in calculating duty cycle
Pls help, Thank you

]]>
By: Ligo George https://electrosome.com/pwm-pic-microcontroller-hi-tech-c/#comments/5402 Sat, 03 Oct 2015 09:21:00 +0000 https://electrosome.com/?p=7342#comment-5402 In reply to Aashish Joshi.

TRISB = 0; is not required there
TRISC bit will be written by PWM1_Init() function.

]]>
By: Aashish Joshi https://electrosome.com/pwm-pic-microcontroller-hi-tech-c/#comments/5260 Fri, 21 Aug 2015 06:26:00 +0000 https://electrosome.com/?p=7342#comment-5260 Hi i ve seen in your code TRISB = 0; you are making port B as output but in your circuit diagram you are taking output from port C

]]>