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.

[MOVED] pwm by pic microcontroller

Status
Not open for further replies.

maysara

Junior Member level 3
Junior Member level 3
Joined
Nov 11, 2013
Messages
25
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
157
how i can generate this four pwm signal by pic ?

 

Attachments

  • Pulses for clockwise rotaion.JPG
    Pulses for clockwise rotaion.JPG
    70.5 KB · Views: 165

Re: pwm by pic microcontroller

If you don't need to adjust the frequency or duty cycle and if your PIC has nothing else to do, then the easiest way to do it is to use timed instruction loops and and four digital outputs.
 

Re: pwm by pic microcontroller

the duty cycle is constant but the frequency is variable and the pic will get information from key bad and display it in LCD .
so is the time instruction and loop will be good ?
 

Re: pwm by pic microcontroller

No, you can't use timed instruction loops if the PIC has to handle the keyboard and the display too. Now I think the easiest way to do it would be to set up a timer to make periodic interrupts. At each interrupt advance a state machine variable and set or clear the appropriate output bits to make the four signals come out the way you want.

This method is subject to some phase jitter because it depends on interrupt latency, and it is speed limited because the interrupt rate cannot be faster than the interrupt service routine. When a different frequency is needed, just change the setup of the timer so it interrupts are the appropriate rate.
 
Hi,

you can use an external two bit binary counter and feed the two bits to a 1 of 4 demux.

Then output a PWM with four times the (single) frequency from your PIC and feed the counter.


Klaus
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top