Complete Newbie-Will an SX do the job? One or more?
David Wanner
Posts: 2
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)
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
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
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 Wanner
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 Williams
Applications Engineer, Parallax