Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

RE: [AVR-Chat] Phase and Frequency Correct PWM on a Mega 8

RE: [AVR-Chat] Phase and Frequency Correct PWM on a Mega 8

2005-11-10 by Loren Boyle


Did you set the two PWM pins as outputs in the data direction reg. I seem to remember finding this buried in the manual somewhere.

Loren





Martin Jay McKee
Sent by: AVR-Chat@yahoogroups.com

Nov 09, 2005 07:46 PM Please respond to
AVR-Chat@yahoogroups.com

To
AVR-Chat@yahoogroups.com cc Subject RE: [AVR-Chat] Phase and Frequency Correct PWM on a Mega 8




The simulator was my first suspicion but I programmed a chip (using a large prescalar) and got nothing. I'm sure it's something I'm doing wrong but darned if I can find what.

Martin Jay McKee



SPONSORED LINKS Avr microcontroller Microcontrollers Pic microcontrollers 8051 microprocessor

YAHOO! GROUPS LINKS

RE: [AVR-Chat] Phase and Frequency Correct PWM on a Mega 8

2005-11-12 by Martin Jay McKee

Yes, the I/O direction pins are set. Actually since this is part of a large project I’m going to press ahead with something else and assume that I get it right sooner or later. Perhaps when I come back to it I’ll have better luck.

Martin Jay McKee

RE: [AVR-Chat] Phase and Frequency Correct PWM on a Mega 8

2005-11-12 by Larry Barello

Another approach you might consider is to use a timer as a one shot pulse generator and reset it periodically based upon some other timer (i.e. the system timer) the OCx register is set to “clear on match”, so you r register, then set “Set on match” and then “force match”, read the timer, add your pulse width poke that out to the OCx, finally then set back to “clear on match”.

Also if you want to see how to use that technique to get 8 r/c pulse outputs from two pins, look at:

http://www.barello.net/Papers/AVR%20RC%20output.pdf

-----------

Larry Barello

www.barello.net

From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf Of Martin Jay McKee
Sent: Friday, November 11, 2005 8:06 PM
To: AVR-Chat@yahoogroups.com
Subject: RE: [AVR-Chat] Phase and Frequency Correct PWM on a Mega 8

Yes, the I/O direction pins are set. Actually since this is part of a large project I’m going to press ahead with something else and assume that I get it right sooner or later. Perhaps when I come back to it I’ll have better luck.

Martin Jay McKee

Servo Control Without PWM, Was: Phase and Frequency Correct PWM on a Mega 8

2005-11-12 by Martin Jay McKee

>>Also if you want to see how to use that technique to get 8 r/c pulse
outputs from two pins, look at:

 

>>http://www.barello.net/Papers/AVR%20RC%20output.pdf

 

I saw this a while ago and I was meaning to ask (never got around to it) how
smoothly it works.  It seems that the time between pulses would vary
slightly and so allow for the possibility of jitter.  Has that shown up at
all in use?

 

Martin Jay McKee

Re: [AVR-Chat] Servo Control Without PWM, Was: Phase and Frequency Correct PWM on a Mega 8

2005-11-12 by Kevin

While the time between the pulses may move around a bit, this causes 
no problems to a servo.  It is the pulse width of the pulse that 
matters, not the period.  That said, with analog servos a faster update 
rate (period) makes them stronger, a slower one makes them weaker.  I've 
experimented with this and found that you can't make the update period 
too fast or the servo will jitter.  When going slower however what 
happens is that the servo will weaken until it does not respond any more.

DLC

Martin Jay McKee wrote:
>> >Also if you want to see how to use that technique to get 8 r/c pulse 
> outputs from two pins, look at:
> 
>  
> 
>> >http://www.barello.net/Papers/AVR%20RC%20output.pdf
> 
>  
> 
> I saw this a while ago and I was meaning to ask (never got around to it) 
> how smoothly it works.  It seems that the time between pulses would vary 
> slightly and so allow for the possibility of jitter.  Has that shown up 
> at all in use?
> 
>  
> 
> Martin Jay McKee
> 
> 
> 
> SPONSORED LINKS
> Avr microcontroller 
> <http://groups.yahoo.com/gads?t=ms&k=Avr+microcontroller&w1=Avr+microcontroller&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=98&.sig=g86_HKNqER2uDVjW9k5qxA> 
> 	Microcontrollers 
> <http://groups.yahoo.com/gads?t=ms&k=Microcontrollers&w1=Avr+microcontroller&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=98&.sig=oFcL4RTYUPZgTb9KnRA0qg> 
> 	Pic microcontrollers 
> <http://groups.yahoo.com/gads?t=ms&k=Pic+microcontrollers&w1=Avr+microcontroller&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=98&.sig=uoydrrm9rLXWB_bzKsqX6g> 
> 
> 8051 microprocessor 
> <http://groups.yahoo.com/gads?t=ms&k=8051+microprocessor&w1=Avr+microcontroller&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=98&.sig=F6bcXXU2SOtJ5tDcWnBGRQ> 
> 
> 
> 
> ------------------------------------------------------------------------
> YAHOO! GROUPS LINKS
> 
>     *  Visit your group "AVR-Chat
>       <http://groups.yahoo.com/group/AVR-Chat>" on the web.
>        
>     *  To unsubscribe from this group, send an email to:
>        AVR-Chat-unsubscribe@yahoogroups.com
>       <mailto:AVR-Chat-unsubscribe@yahoogroups.com?subject=Unsubscribe>
>        
>     *  Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
> 
> 
> ------------------------------------------------------------------------
> 

-- 
-------------------------------------------------
Dennis Clark          TTT Enterprises
www.techtoystoday.com
-------------------------------------------------

RE: [AVR-Chat] Servo Control Without PWM, Was: Phase and Frequency Correct PWM on a Mega 8

2005-11-12 by Larry Barello

There is no jitter between pulses as the timer match condition finishes one
pulse and starts the next. The processor has up to the minimum pulse width
to service the interrupt and set up the next match.

 

The only jitter would be the start of the pulse train and that would be
whatever jitter you have in your system time.  If, for example, you had a
1khz clock you could call "StartRCout()" from the interrupt handler every 24
ticks and have very low jitter.


But, besides that, Servos are pretty insensitive to the pulse repetition
rate.  Anything between 20-60hz would be fine.

 

 

-----------

Larry Barello

www.barello.net

 

  _____  
Show quoted textHide quoted text
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
Of Martin Jay McKee
Sent: Saturday, November 12, 2005 11:32 AM
To: AVR-Chat@yahoogroups.com
Subject: [AVR-Chat] Servo Control Without PWM, Was: Phase and Frequency
Correct PWM on a Mega 8

 

>>Also if you want to see how to use that technique to get 8 r/c pulse
outputs from two pins, look at:

 

>>http://www.barello.net/Papers/AVR%20RC%20output.pdf

 

I saw this a while ago and I was meaning to ask (never got around to it) how
smoothly it works.  It seems that the time between pulses would vary
slightly and so allow for the possibility of jitter.  Has that shown up at
all in use?

 

Martin Jay McKee

 

SPONSORED LINKS 


Avr
<http://groups.yahoo.com/gads?t=ms&k=Avr+microcontroller&w1=Avr+microcontrol
ler&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s
=98&.sig=g86_HKNqER2uDVjW9k5qxA>  microcontroller 

Microcontrollers
<http://groups.yahoo.com/gads?t=ms&k=Microcontrollers&w1=Avr+microcontroller
&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=98
&.sig=oFcL4RTYUPZgTb9KnRA0qg>  

Pic
<http://groups.yahoo.com/gads?t=ms&k=Pic+microcontrollers&w1=Avr+microcontro
ller&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&
s=98&.sig=uoydrrm9rLXWB_bzKsqX6g>  microcontrollers 


8051
<http://groups.yahoo.com/gads?t=ms&k=8051+microprocessor&w1=Avr+microcontrol
ler&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s
=98&.sig=F6bcXXU2SOtJ5tDcWnBGRQ>  microprocessor 

 

 

 

  _____  

YAHOO! GROUPS LINKS 

 

*	 Visit your group "AVR-Chat <http://groups.yahoo.com/group/AVR-Chat>
" on the web.
  
*	 To unsubscribe from this group, send an email to:
 AVR-Chat-unsubscribe@yahoogroups.com
<mailto:AVR-Chat-unsubscribe@yahoogroups.com?subject=Unsubscribe> 
  
*	 Your use of Yahoo! Groups is subject to the Yahoo! Terms of
<http://docs.yahoo.com/info/terms/>  Service. 

 

  _____

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.