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.

variable duty cycle using micrrobasic

Status
Not open for further replies.

switimira

Member level 1
Joined
Dec 5, 2009
Messages
37
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,523
hi...can anybody help me modify this coding..this coding only generate 50% duty cycle..if possible i want to generate variable duty cycle..:cry:

program PWMBoost
main:
TRISC.2 = 0 ' CCP1 (PortC.2 = Output)
PR2 = 110 ' Set PWM Period for approximately 45KHz
CCPR1L = 55 ' Set PWM Duty-Cycle to 50%
CCP1CON = %00001100 ' Select PWM Mode
T2CON = %00000100 ' Timer2 = ON + 1:1 prescale
while true
wend
end.

Added after 2 hours 19 minutes:

i want to use push button connected to RA0..when the push button is press, it will change the duty cycle..can anybody help..please..
this is the schematic
 

i'm using 20MHz crystal oscillator..
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top