Shop OBEX P1 Docs P2 Docs Learn Events
Complete Newbie-Will an SX do the job? One or more? — Parallax Forums

Complete Newbie-Will an SX do the job? One or more?

David WannerDavid Wanner Posts: 2
edited 2006-03-16 16:15 in General Discussion
I am a complete newbie that doesn't want to attack a large project if it won't work anyway. (The salesperson said it would but advice from sales people doesn't reassure me too much. I need to create a gated PWM output that goes from 0:100% (or at least 3:97%)(varied by at pot input or possibly a digital pot) at·switch selectable rates of 5k 10k and 20kHZ. This output needs to also carry an optional (switched on/off)·1usec pulse at 5kHZ·when ever there is no PWM signal. If this 1usec pulse is "ON"·it is necessary even between the PWM pulses if they are of sufficient "off" duration. This device will have an LCD (looking at the 120 x 32 serial LCD #327936) that displays the base frequency selected·(5k 10k or 20kHZ)·and the current PWM%.·The PWM output·will be triggered by any of 3·inputs 1)a 24VDC Hi signal present 2)a 5vdc Hi TTL signal or 3) a dry contact closure (a switch, meaning the voltage is supplied by the device). I presume this·interfacing will·require a couple of optoisolators like I am currently using.···· So my big question is will I need one or two SX's and what size.
I have lots of experience with all the STAMPS. And have puchased the full SX kit and read/reread the manuals a couple of times.
(To show hope newbie I am in this though, what is the simplest way of·pushing a push button and having an output come on?) I understand the electronics but not the programming.
Any help on this would be VERY appreciated!!!
(PS·· I enjoy learning and know I have a lot to learn but this looks like something that I can use several ways)

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-03-16 08:08
    The SXes as higher speeds can handle 16 or more threads in a multiplexed arrangement. In some cases, you might call one routine 4 times, one routine every time, and another routine twice. It is up to you about how you fill out the threads.

    This is all done in SASM, not SX/B.
    You might start with combining two things, and then slowly move up to more complex combinations. Some things are very dependent on timing and have to be places first in program location.

    You might start with a State Machine diagram as it will clarify what is dependent and what is independent in terms of programing segments. It would also make it easier for others to help you. Just reading the above leaves me unsure.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • NateNate Posts: 154
    edited 2006-03-16 11:27
    David,

    Yes, this can be done with one SX28, of which you have 2 included with your SX kit.·

    I would recommend reading Gunther's book (which I believe is still incuded in the kit) and actually programming your SX with the small exercise programs that he uses for examples.· It will take time to learn how to program the SX, but you will be well rewarded when you can program this <$4 chip to do all and more than a Basic Stamp can.

    Nate
  • David WannerDavid Wanner Posts: 2
    edited 2006-03-16 15:54
    Thank you both Kramer and Nate for reassuring me that I can do what I need with 1 SX28. This is going to be fun! I will stick to SASM from the looks of things (no advantage at all in SX-B from what I see). I have always stuck with TTL. It's easier because I have worked with it for 35yrs. Now it's time to try this just for the challenge. Thanks again!
    David Wanner
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-03-16 16:13
    BTW, I have been trying to be faithful to purely SASM too.

    But you will find that the SX/B code can be quickly written and then provide a LIST file that is SASM. It certainly moves things ahead a little faster [noparse][[/noparse]It has help files too.].

    If you get stuck, don't be afraid to use it. Guenthers code is extremely good, but you may try something first in SX/B that isn't in his book and then read the SASM of it.

    Generally the ISRs are where SASM is really required.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-03-16 16:15
    I would recommend Guenther's book under any condition, and especially if you plan to go pure SASM.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.