Re: PWM

Started by Mike Perks May 31, 2005
matias domin matte izquierdo wrote:

> I want to drive two 6VDC motors. I'm using the L293D to control the
> direction and speed, but I need a permanent PWM output from BX-24. Is it
> posible? I think that with multitasking this is posible, but I havent'
> done
> it.
>
> Otherway, how can I drive these motors withut adding more hardware?

There is a PWM example for the BX-24 in the documentation package. The
name of the application note is Dual_PWM_App_Note_BX24.pdf and there is
example code too.

>
> And the las question. How can I communicate the BX-24 to a Basic Stamp 2?

I think it all depends on what you are trying to do. There are three
decisions to make:
- the hardware protocol i.e. SPI, I2C, RS232, RS485 etc which depends on
chip and physical requirements
- the software protocol i.e. What do the commands look like
- the management protocol i.e. master/slave, multiple master
b
I suggest you post another append with the details of hat you are trying
to do (and even why you need a separate Stamp) and that will help guide
our answers.

Mike



I want to drive two 6VDC motors. I'm using the L293D to control the
direction and speed, but I need a permanent PWM output from BX-24. Is it
posible? I think that with multitasking this is posible, but I havent' done
it.

Otherway, how can I drive these motors withut adding more hardware?

And the las question. How can I communicate the BX-24 to a Basic Stamp 2?

Thank you very much!



matias domin matte izquierdo wrote:

> Thanks Mike, I don't understand something. If I use PWM like says the app
> note simultaneously with other tasks, will be the PWM signal interferred?

Not unless you use something else that requires Timer1 such as
InputCapture or OutputCapture. See page 28 of the Operating System
reference for more info. I had this conflict problem so I developed my
own stand-alone PWM controller - see
http://home.austin.rr.com/perks/basicx/Projects/ . There are other kinds
of stand-alone PWM generators as well.

>
> About the comunication between bx24 and bs2, I'm just asking in case I
> want
> to send, for example, 2 bytes between them by RS232 (maybe for having
> more
> outputs). I really don't understand the theory, so probably I'm trying
> to do
> something strange.
>
> Thanks again
>
> Bye
>




> ... simultaneously with other tasks, will be the PWM signal
interferred?

Once PWM is started, it will endlessly continue as set. Nothing will
interfere with it unless it's timer is changed - by functions that use
it, as Mike says, or until you change it in code.

> ... communication between bx24 and bs2...

I don't see a specific example for Basic-X and BS2, but there are many
examples of inter-machine RS232 communication in
http://groups.yahoo.com/group/basicx/files/Datasheets-Appnotes-Examples-
Drawings/Comm/ . Tom
Tom Becker
--... ...--
GTBecker@GTBe... www.RighTime.com
The RighTime Clock Company, Inc., Cape Coral, Florida USA
+1239 540 5700


Thanks Mike, I don't understand something. If I use PWM like says the app
note simultaneously with other tasks, will be the PWM signal interferred?

About the comunication between bx24 and bs2, I'm just asking in case I want
to send, for example, 2 bytes between them by RS232 (maybe for having more
outputs). I really don't understand the theory, so probably I'm trying to do
something strange.

Thanks again

Bye