Continue to Site

Welcome to EDAboard.com

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.

How to configure the duty cycle and period for PWM pulse generation in PIC16F877A?

Status
Not open for further replies.

vijiembed

Newbie level 5
Newbie level 5
Joined
Jul 8, 2008
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,331
Hai friends,
i m fresher in embedded field.
I have some doubts in PWM pulse generation in PIC16f877a microcontroller.
i need the details about duty cycle and period.
How to configure the values.
 

рингтон pic16 void ccp1

i don't think there should be any problems with PWM of pic
you should better study its data sheet and data sheet of mid range family of pic microcontrollers.
they can be easily obtained from microchip site

pwm is concerned with Timer 2
by changing value of PR2 register you can change the duty cycle
 

pwm con pic16f877a y 4 megas

I can send you the code you just have to add these files

if u need please Post a reply on the same topic
 
pulse generator using microprocessor 8051

duty cycle is nothing but... in a given pulse cycle.... duty cyle is ration of time when pulse is high to the total time of pulse cycle...,
period is nothing put one complete cycle after which signal repeates.
 

pulse generator program by using 8051 pic

hi,

If i am using an AT mega 64 controller do i need to have any extra hardware to generate PWM..?? (PWM would be D to A ?? )

I am asking this cause I don't have much about this concept but got to know that PWM can be used to generate melody sounds( i.e. sounds like ringtones etc..) from a speaker or siren connected with the controller..

Other way is to On/Off the the speaker to generate some sound but these won't provide melodious sound..

On the software part what are things that we need to do.. i got to know that we can use 2 timers to control.. Can anyone provide me with any refrence like a weblink or a document that can give me an idea abt how to implement it..??


Surya
 

pulse generation usin pic 16f877a

Hai,

Thanks forur reply.
Actually, by changing the value of PR2 register, we can change the period.
But what value will be loaded in CCPR1L register.
Thats my doubt.
Thanks in advance.

Regs,
VIJI
 

pulse generation using 8051 microcontroller

ccprx resister is used for 8 msb of duty cycle.
for detail refer to PICmicro™ Mid-Range MCU Family Reference Manual

void pwm(char dutycycle1,char dutycycle2)
{
TMR2=0;
PR2=0xFF; //PWM FREQUENCY
/************************* PWM1****************************************/
CCPR1L=dutycycle1; //8 msb of duty cycle
CCP1CON=0x0C; //-|-|CCP1X|CCP1Y|1|1|0|0 0X_C FOR ENABLING PWM
//CCP1X:CCP1Y = PWM LSB 0X_0 FOR DISABLING PWM
TRISC2 = 0; //MAKING CCP1 PIN O/P

/******************************PWM2************************************/
CCPR2L=dutycycle; //8 msb of duty cycle
CCP2CON=0x0C; //-|-|CCP2X|CCP2Y|1|1|0|0 0X_C FOR ENABLING PWM
//CCP1X:CCP1Y = PWM LSB 0X_0 FOR DISABLING PWM
TRISC1 = 0; //MAKING CCP2 PIN O/P


T2CON = 0b00000100; //CONFIGURE T2CON |-|4 POST SCALE BITS |TMR2ON| 2 PRESCALE BITS|
}
 

the pwm generation

Hai,
Thanks for ur guidance.
I successfully created PWM pulses.
Thanks a lot.


Regards,
VIJI.R
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top