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.

Help me with code for generating PWM signal using PIC

Status
Not open for further replies.

devonsc

Advanced Member level 4
Joined
Nov 30, 2004
Messages
115
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,298
Activity points
1,931
Newbie - PWM using PIC

Hi there,

Do you guys mind guiding on regarding the following matter? I tried writing the code for to generate a PWM signal. As shown in the following is what I get after referring to a website. However, would like to ask if Line A and Line B is necessary? Am I right to say that with the presence of Line C, I can ignore both Line A and Line B? Thanks in advance.

********************************************

PWM:
MOVLW B'00010001' ; BITS OF 9 TO 2
MOVWF CCPR1L
BCF CCP1CON,CCP1X ; Line A
BCF CCP1CON,CCP1Y ; Line B
MOVLW B'00000100' ; TMR2 = ON, PRESCALE = 1
MOVWF T2CON
MOVLW B'00001100' ; Line C
MOVWF CCP1CON
RETURN

********************************************
 

Re: Newbie - PWM using PIC

hai

yes the lines a and b are not necessary when using line c
if you want full program send me pm
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top