Shop OBEX P1 Docs P2 Docs Learn Events
Waveform / Pulse Generator? — Parallax Forums

Waveform / Pulse Generator?

critescrites Posts: 11
edited 2006-09-18 01:54 in General Discussion
I am looking for a little help in implementing a project. ·I was hoping someone might give me a few pointers or point me to some sample code? ·Having received my SX development kit, I’m not sure if this would better be implemented in ASM or BASIC.· As a SX neophyte and having messed around with The BASIC Stamp, I’m sure BASIC would be quicker.
·
I’m looking to generate two independent periodic waveforms, each controlled by a pot.
  1. The first waveform would be a PWM signal, 0 to 100% duty cycle, to control a small DC motor.· The duty cycle would be controlled by a pot.
  2. The second waveform would consist of a single fixed short pulse (~10 usec) followed by a delay of ~50 to 250 milliseconds.· After the delay the waveform would repeat. ·The delay would be controlled by a pot.
The repeatability·is much more important than the accuracy.

Any shred of info to get me jump started would be appreciated.

Thnx,

-TAC

Comments

  • BeanBean Posts: 8,129
    edited 2006-09-07 14:33
    TAC,
    Would be pretty simple using the two 16-bits in the SX48. SX/B would work fine.

    If you want to use the SX28, then an interrupt routine would be needed to make the signals as repeatable as possible. Some assembly in the interrupt routine may be required.

    Questions:
    1. Is 8-bits (255 levels) of PWM okay ?
    2. What resolution is required (1 millisecond ?)

    Is the SX48 an option ?

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    There are only two guaranteed ways to become weathy.
    Spend less than you make.
    Make more than you spend.
    ·
  • critescrites Posts: 11
    edited 2006-09-07 14:54
    Bean,

    1) 8 bit PWM would be just fine.
    2) Other than the short pulse, a resolution of 1 millisecond would also be ok.

    As far as the SX48, I figured the timer stuff would be just what the doctor ordred but I already have this SX28 programmer.·

    Thanks,

    -TAC
  • critescrites Posts: 11
    edited 2006-09-07 15:59
    I really don't care if I use assembly, the SX28 or 48, just looking for a little direction so I don't end up in the weeds somewhere. smile.gif

    In addition to my SX Tech Tool Kit PLUS, what would I need to program the SX48? Looks like just the SX48 Proto Board. At $10 that wouldn't hurt too bad.

    -TAC
  • BeanBean Posts: 8,129
    edited 2006-09-08 16:22
    TAC,
    Yep, if the you have the SX-Key or SX-Blitz all you need is the SX48 proto board. Order a couple, they are really handy.
    Let me know when you get them, I'll help you with the code.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    There are only two guaranteed ways to become weathy.
    Spend less than you make.
    Make more than you spend.
    ·
  • critescrites Posts: 11
    edited 2006-09-09 02:07
    Thanks Bean I placed an order today. I've started reading up on the timers in the SX48 and any help would be appreciated.
    Thanks again for all your help.
    -TAC
  • critescrites Posts: 11
    edited 2006-09-13 16:01
    Hey Bean my SX48 is showing up today so I'm ready to take you up on your offer.· ;-)

    Thnx

    -TAC
  • BeanBean Posts: 8,129
    edited 2006-09-13 17:20
    TAC,
    Hey I wanted to build one of those anyway.
    With the new ANALOGIN command and the SX48 timers it should be pretty easy.
    I'll get some code and a schematic together soon.

    Any chance of making a duplicate for me ?

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    There are only two guaranteed ways to become weathy.
    Spend less than you make.
    Make more than you spend.
    ·
  • critescrites Posts: 11
    edited 2006-09-13 23:35
    Bean,

    Bare min I'll let you know where I got the parts.· I ended up paying $1.75 each for the·UV LEDs, ouch!· I'm looking for·a battery powered desk top fountain·right now.··I'll probably buy at least two·of those if I can get a·decent price.

    -TAC

    p.s.· for those of you that want to know what we are talking about check out the video at:

    ··· http://cre.ations.net/creation/44·
  • StarManStarMan Posts: 306
    edited 2006-09-14 03:41
    Very cool project.· Don't forget to post in the projects forum when you're done.

    BTW I just bought 100 UV LEDs off ebay for about 12 cents each including shipping.· I haven't received them yet.· Don't know the quality.

    I see a lot of small fountains at the local drug store for around $15.



    Chris I.
  • BeanBean Posts: 8,129
    edited 2006-09-14 18:18
    TAC,
    The SX can provide the pulses for the pump and LEDs, but what are you going to use the drive them ?
    You'll need a power transistor or a FET or something since the SX cannot supply enough current to drive either of them.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    There are only two guaranteed ways to become weathy.
    Spend less than you make.
    Make more than you spend.
    ·
  • critescrites Posts: 11
    edited 2006-09-14 19:04
    I'll dig up some transistors that can drive an amp or so.

    There is a schmatic on http://cre.ations.net/creation/44.

    Post Edited (crites) : 9/15/2006 12:21:24 PM GMT
  • critescrites Posts: 11
    edited 2006-09-18 01:06
    Bean,

    Where can I find some info on this new ANALOGIN command?

    Since picking up a couple battery powered desk fountains this weekend (Rite-Aid) I now have all the parts I need.·· blush.gif·· Now the hard part of finding the time to put this together between all my distractions.· lol

    -TAC
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-09-18 01:52
    I like the marble race-track.· Do they go consistently or does it get dicey with them clunking into each other, going off-track, etc.?
  • BeanBean Posts: 8,129
    edited 2006-09-18 01:54
    TAC,
    The "What's New" file has some info. Basically it the same as this: http://www.sxlist.com/techref/ubicom/lib/io/adc_vp.htm

    Looking at ADC1 on the diagram, RC.6 would be the output pin and RC.7 would be the input pin.

    You would just tie one end of your pot to GND and the other end to +5 and connect the wiper to the 10K going into the circuit. MAKE SURE YOU DEFINE THE INPUT PIN AS CMOS THRESOLD like "InPin PIN RC.7 CMOS"

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    There are only two guaranteed ways to become weathy.
    Spend less than you make.
    Make more than you spend.


    Post Edited (Bean (Hitt Consulting)) : 9/18/2006 1:57:50 AM GMT
Sign In or Register to comment.