English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

a pwm signal is generated by pic micro. now i want to shift the signal by 120 degrees to become the second signal. what i meant is the first signal is started at 0 deg and the second one is started 120 deg later. the second signal is still have the same frequency and duty cycle as the first one. any circuits that can do the trick?

someone please help, it's urgent!!

2006-10-30 16:39:17 · 2 answers · asked by declan 1 in Science & Mathematics Engineering

2 answers

If the frequency is constant, a simple time delay is all that it takes. If you have a clock that has 1 or 2 ticks per degree, use a simple PAL or CPLD and build a scale of 120 or 240 counter to get 1° or ½° timing accuracy.

But, if you've got a micro right there anyway, why not just generate another output that's delayed by 120 degrees from the first output? Those little PIC's usually have a bunch of timer/counters in them. Set one of them up for however many 'ticks' correspond to 120 degrees and, when it times out, it pops an interrupt and the interrupt handler turns on the 2'nd signal, and reloads the counter with however many ticks correspond to the pulse width desired. Next interrupt, you turn off the output. Keep a single bit flag so that the interrupt handler knows whether the interrupt from that timer/counter is to turn the signal 'on' or 'off' and you're done. You already probably do something similar for the 1'st PWM signal anyway.


Doug

2006-10-30 16:59:06 · answer #1 · answered by doug_donaghue 7 · 2 0

I suggest generating the second signal exactly as you generated the first.

The way to add phase shift depends on how it's implemented. You can either adjust the phase term in the equation, or adjust the offset into the lookup table, or add a time delay of some sort.

2006-11-01 11:59:32 · answer #2 · answered by _ 3 · 0 0

fedest.com, questions and answers