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.

Astable Multivibrator with PIC microcontroller

Status
Not open for further replies.

abuhafss

Full Member level 2
Full Member level 2
Joined
Aug 8, 2010
Messages
142
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,296
Visit site
Activity points
2,383
Hi

I have recently started learning PIC programing.
So far made 2-3 programs, playing with LEDs.
Before proceeding further for pulse generating programs, I have a question:

For a frequency say 1-2KHz, is there any specific keyword to have the required duty cycle & frequency output or we have to manually set the ON period+OFF period to define one cycle and then repeat it? If there is some specific keyword, please let me know.

Thanks.

p.'s. I am using PIC Basic.
 
Last edited:

Try with to program PWM module
That will help you to achieve your requirement
 
Last edited:

What type of pic you use? there is a variety of pic micro controllers that contain built-in dedicated PWM modules that work in the background of the program. download device's datasheet and read it carefully.

example: PIC18f452.
 

there is a variety of pic micro controllers that contain built-in dedicated PWM modules that work in the background of the program. download device's datasheet and read it carefully.

example: PIC18f452.

I have learnt about HPWM command.............Thanks.

But, can you please explain me how to specify frequency of the pulse train using PWM command. Actually, I could not get the term CYCLE used with the command PWM.

Thanks.
 

since you already done with HPWM commands, check the timer modules in your device datasheets. as you know frequency is about time taken to finish one complete cycle. actually 3 modules you need to read about carefully

1) HPWM.
2) Timers.
3) interrupts.
that was the hard way;

the easy way..
using basic commands like in proton ide for example
HPWM channel number (1 or 2) , Duty , Frequency
hpwm 1,127,1000 <--- this will start train of pulses on the specified pin with 50% duty cycle and 1 khz frequency.
but you need first to declare the hpwm pin in the start of your program.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top