Re: Need Advice on PWM and other stuff
- From: Joe <nuisancewildlife@xxxxxxxxxxxxx>
- Date: 26 May 2007 16:39:43 -0700
On May 26, 3:06 pm, Bob Smith <bsm...@xxxxxxxxxxxxx> wrote:
Joe wrote:
I have a circuit for PWM using a 555 and a potentiometer to vary the
duty cycle.
I decided that using the motor driven potentiometer was folly, and I
will probably use mosfet switches to change the resistor values (and,
hence, the duty cycle) in my PWM control module. Unless folks have a
better idea.
Since you have an AVR, you might want to replace the 555
with a pin(2) from the AVR. Depending on which AVR you have
you may already have a couple of PWM counters on board.
Even if you don't have the PWM counters you can build one
easily enough with a timer interrupt.
Using an AVR for the PWM output gives you a little more
flexibility in how to set the motor speed.
I'm about to do the same thing (AVR/PWM) for my bot so let
me know if you want more specific help.
Bob
Hello Bob,
Yes, a very kind offer. Just one pin? I would love to use the avr, but
I don't know how, even after reading the dox. I am going to have one
micro whose sole function will be to control the motors and steering
(and, at first, will have to decode the signals from my RC and timeout
when it stops receiving the once every 18ms pulse that the transmitter
generates when it is on, just a safety precaution in case the thing's
running full tilt and my RC transmitter batteries go dead, or it goes
out of range). I will add micros later for sensors, navigation, etc.
as needed.
I have in my possession the following:
ATTiny 2313 (I know that has 4 PWMs aboard), but limited memory
ATMega 8515, my favorite
ATMega8535, because of the A/D's. I haven't used this one yet.
Bascom full version programming language. 1.1.83
STK 500 programmer.
I cannot seem to wrap my head around how to use the timers for PWM and
get a timeout if needed also. Being more inclined to hardware, I
thought I would use a separate PWM (which probably sounds insane).
Anyway, suggestions on which micro would be the best to use, and, If
possible, I would like to control each motor with its own PWM so I can
slow down instead of stopping one of them to make a turn.
Now, if it so happens that you don't use Bascom, then a flow chart
(antiquated term, I know), or description of which pins I have to
use, details, details, and I can probly figure out how to code it
myself in Bascom.
Thank you for the reply, I look forward to this to enhance my
understanding of all the functions these avrs can perform.
Joe
.
- Follow-Ups:
- Re: Need Advice on PWM and other stuff
- From: Bob Smith
- Re: Need Advice on PWM and other stuff
- References:
- Need Advice on PWM and other stuff
- From: Joe
- Re: Need Advice on PWM and other stuff
- From: Bob Smith
- Need Advice on PWM and other stuff
- Prev by Date: Re: Microcontroller options
- Next by Date: Re: Microcontroller options
- Previous by thread: Re: Need Advice on PWM and other stuff
- Next by thread: Re: Need Advice on PWM and other stuff
- Index(es):
Relevant Pages
|