Hello, I need to know if can I have multitasking with one SX28 ACDP microcontro
Hello,
·I need to know if can I have multitasking
with one SX28 AC/DP microcontroller.
Do you know information about that ?
Thanks, Mark
·I need to know if can I have multitasking
with one SX28 AC/DP microcontroller.
Do you know information about that ?
Thanks, Mark
Comments
What operations do you want to multitask ?
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
“The United States is a nation of laws -· poorly written and randomly enforced.” - Frank Zappa
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.hittconsulting.com
·
I want to use the basic compiler to move
two servos and a little piezo and a pair of
light sensors.
Do you know if SX are better for multitasking
than Basic Stamps.
Thanks, Mark
Do you know if can I "join" two or more SX28
in order to have something like the propeller,
something with real multitasking?
thanks, Mark
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
“The United States is a nation of laws -· poorly written and randomly enforced.” - Frank Zappa
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.hittconsulting.com
·
But the problem I have is that the SX chips have
the Basic compiler (very similar to Basic Stamps)
and the Propeller doesn't have basic compiller . Propeller
uses a Spin lenguaje and it is different to Basic.
Do you know if there are or if Parallax will develop
somethig like to Basic for the Propeller ?
Thanks, Mark
Why do you want "real" multitasking. If "standard" multitasking (simulating multiple processors through some form of time sharing) accomplishes your goal, AND you already have the SX chips and IDE, then just use it. There are millions of computers out there multitasking away (almost every PC and Mac for example) and accomplishing lots of useful goals. If you don't know how to multitask with a single processor, then it sounds like there are still things for you to learn about the SX. I would stick with what you know until it no longer can do what you want.
Thanks,
PeterM
· I don't think you would need multitasking to to what you want.
· Just have your main loop do each thing one after the other.
· The servos should only be updated every 20mSec or so anyway.
Bean.
···
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
“The United States is a nation of laws -· poorly written and randomly enforced.” - Frank Zappa
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.hittconsulting.com
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Everything in the world is purchased by labour; and our passions are the only causes of labor." -- David·Hume (1711-76)········
You can develop a program that will "appear" to run everything at the same time ("multitask") since the SX is very fast, and 20ms between servo pulses is a lot of time to get other things done.
Here is a pseudo-code outline that may help:
So basically your SX rips through the loop at blazing speed, but what actually happens during each loop depends on the state of the timer(s) -- the actual "send to servo" code will only run when 20ms has elapsed, etc. The above is over-simplified, but hopefully it gives the general idea of how you might approach the project. My own style is usually to use just a few counters, updated regularly, and then divide them for my different "tasks", but the individual timers above are easier to read.
JonnyMac's ISR routines, and PJV's multi-tasking threads give much tighter timing control and lets you run code virtually in the "background", which could be helpful for your sound work. But understanding the basics of something like the above would help. I've done similar setups on Stamps as well, though they are much slower overall.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST