Sign in

username:

password:



Not a member?

Search basicx



Search tips

Subscribe to basicx



basicx by Keywords

Accelerometer | ADC | ADXL | Adxl20 | AVR | BasicStamp | BX-35 | BX28 | BX35 | COM3 | Compiler | Downloader | EEPROM | Electromagnet | GetADC | GP2D1 | GPS | I2C | IDE | Keypad | LCD | LCD+ | MIDI | Motors | Multitasking | Netmedia | Networking | PCB | PID | PlaySound | PWM | Relays | RTC | Servo | ShiftOut | SitePlayer | SPI | Stack | Timer | USB

Ads

Discussion Groups

Discussion Groups | BasicX | Barebones BX24 and Multitasking

Discussion forum for the BasicX family of microcontroller chips.

Barebones BX24 and Multitasking - Author Unknown - Nov 30 13:10:00 2001

Help! My question is, should I even bother? Is this futile?

I am attempting to make a PID controller using a barebones BX24, no
RAM Sandwich or LCD+. I'm happy with my interface running a Hitachi
HD44780 based Optrex LCD 2-line display and four input buttons (Mode
select, UP, DOWN and Commit) but am stymied by getting even a trivial
background task to run.

According to the project's .MMP file I am using only 37 bytes of
module level (static) RAM and the deepest call stack is 21 bytes, or
about 32-bytes including its largest nested call. The program uses
4700 bytes of code memory.

I've attempted a trivial global flag-setting background task with 40,
80 and 120-byte task-stacks with no luck. I've made tiny mutitasking
programs to confirm my understanding and I've scoured this group's
archives, the BasicX site, Google Groups (Usenet) and AltaVista, but
this thing just doesn't go!

I understand that without seeing the code there's a lot of useful
details absent, so my question at a gross level is simply, should I
bother? Is the barebones BX24 capable of mutitasking in a non-
trivial application?

Thanks very much for any help,
Charles Rich





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )


Re: Barebones BX24 and Multitasking - Tony Brenke - Nov 30 13:48:00 2001

the BX is capable uf running multipal tasks, and quite well.

your bigest limit will be ram.
send me your MPP file so that I can see what you have to play with.
256 total for the 24.
- comport quques
- stack space
+ resable varables ' this is good. define a few globals (2) and use them in subs &
functions as scrach pad bytes. it does help.
- nested subs 'this is very bad + a wast of space.
for the bx it is better to have many sections of code doing the same thing then to
neest the loops too deep. 2 deep max or you are wasting ram.
(I was bit with this when I started coding for the bx)
--- wrote:
> Help! My question is, should I even bother? Is this futile?
>
> I am attempting to make a PID controller using a barebones BX24, no
> RAM Sandwich or LCD+. I'm happy with my interface running a Hitachi
> HD44780 based Optrex LCD 2-line display and four input buttons (Mode
> select, UP, DOWN and Commit) but am stymied by getting even a trivial
> background task to run.
>
> According to the project's .MMP file I am using only 37 bytes of
> module level (static) RAM and the deepest call stack is 21 bytes, or
> about 32-bytes including its largest nested call. The program uses
> 4700 bytes of code memory.
>
> I've attempted a trivial global flag-setting background task with 40,
> 80 and 120-byte task-stacks with no luck. I've made tiny mutitasking
> programs to confirm my understanding and I've scoured this group's
> archives, the BasicX site, Google Groups (Usenet) and AltaVista, but
> this thing just doesn't go!
>
> I understand that without seeing the code there's a lot of useful
> details absent, so my question at a gross level is simply, should I
> bother? Is the barebones BX24 capable of mutitasking in a non-
> trivial application?
>
> Thanks very much for any help,
> Charles Rich >

__________________________________________________





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Barebones BX24 and Multitasking - Author Unknown - Nov 30 14:25:00 2001

One common thing I have seen is that there is a lack of
understanding that the multitasking is not preemptive. It is a
round robin tasking system. This means, if you one of your tasks
does not have a sleep call in it, the others will not be given a
chance to run.

If this is the case, just throw in a few Sleep( 0 ) calls in loops
and the such and things will start to move. --- In basicx@y..., crich@f... wrote:
> Help! My question is, should I even bother? Is this futile?
>
> I am attempting to make a PID controller using a barebones BX24,
no
> RAM Sandwich or LCD+. I'm happy with my interface running a
Hitachi
> HD44780 based Optrex LCD 2-line display and four input buttons
(Mode
> select, UP, DOWN and Commit) but am stymied by getting even a
trivial
> background task to run.
>
> According to the project's .MMP file I am using only 37 bytes of
> module level (static) RAM and the deepest call stack is 21 bytes,
or
> about 32-bytes including its largest nested call. The program
uses
> 4700 bytes of code memory.
>
> I've attempted a trivial global flag-setting background task with
40,
> 80 and 120-byte task-stacks with no luck. I've made tiny
mutitasking
> programs to confirm my understanding and I've scoured this group's
> archives, the BasicX site, Google Groups (Usenet) and AltaVista,
but
> this thing just doesn't go!
>
> I understand that without seeing the code there's a lot of useful
> details absent, so my question at a gross level is simply, should
I
> bother? Is the barebones BX24 capable of mutitasking in a non-
> trivial application?
>
> Thanks very much for any help,
> Charles Rich





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Barebones BX24 and Multitasking - Frank Manning - Nov 30 15:09:00 2001

From: <> writes:

> According to the project's .MMP file I am using only 37 bytes of
> module level (static) RAM and the deepest call stack is 21 bytes,
> or about 32-bytes including its largest nested call. The program
> uses 4700 bytes of code memory.
> [...]
> I understand that without seeing the code there's a lot of useful
> details absent, so my question at a gross level is simply, should
> I bother? Is the barebones BX24 capable of mutitasking in a non-
> trivial application?

If the call stack really only uses 32 bytes, then multitasking should be no
problem.

But it's very difficult to say without seeing the code. Any chance you could
post it? Or at least the general requirements?

-- Frank Manning
-- NetMedia, Inc.





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Barebones BX24 and Multitasking - Frank Manning - Nov 30 15:09:00 2001

From: <> writes:

> According to the project's .MMP file I am using only 37 bytes of
> module level (static) RAM and the deepest call stack is 21 bytes,
> or about 32-bytes including its largest nested call. The program
> uses 4700 bytes of code memory.
> [...]
> I understand that without seeing the code there's a lot of useful
> details absent, so my question at a gross level is simply, should
> I bother? Is the barebones BX24 capable of mutitasking in a non-
> trivial application?

If the call stack really only uses 32 bytes, then multitasking should be no
problem.

But it's very difficult to say without seeing the code. Any chance you could
post it? Or at least the general requirements?

-- Frank Manning
-- NetMedia, Inc.





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Barebones BX24 and Multitasking - Author Unknown - Dec 1 19:18:00 2001

Thanks Frank,

I have been unrolling the nested calls in the program in order to
flatten the call stack. So the code may look like a mess but I have
uploaded it to the bx24 files area of the group. I am mostly
encouraged by just hearing that it *should* multitask fine. This is
apparently just part of the learning curve for me.

I'd like to thank everyone who has commented on this so far. I have
learned a lot from you all.

Thanks,
Charles Rich
(Seattle-area, USA) --- In basicx@y..., "Frank Manning" <fmanning@n...> wrote:
> From: <crich@f...> writes:
>
> > According to the project's .MMP file I am using only 37 bytes of
> > module level (static) RAM and the deepest call stack is 21 bytes,
> > or about 32-bytes including its largest nested call. The program
> > uses 4700 bytes of code memory.
> > [...]
> > I understand that without seeing the code there's a lot of useful
> > details absent, so my question at a gross level is simply, should
> > I bother? Is the barebones BX24 capable of mutitasking in a non-
> > trivial application?
>
> If the call stack really only uses 32 bytes, then multitasking
should be no
> problem.
>
> But it's very difficult to say without seeing the code. Any chance
you could
> post it? Or at least the general requirements?
>
> -- Frank Manning
> -- NetMedia, Inc.




(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Re: Barebones BX24 and Multitasking - Frank Manning - Dec 2 22:11:00 2001

From: Charles Rich <>

> I have been unrolling the nested calls in the program in
> order to flatten the call stack. So the code may look
> like a mess but I have uploaded it to the bx24 files
> area of the group. [...]

Well, I wouldn't call the code a mess. In fact, it's not very often I see
indentation that good -- I only found one or two mistakes. Other than that,
it's right up there with Peter Anderson's code, if you ask me.

I don't see any obvious problems with the multitasking part. What symptoms
are you seeing? Does the program hang or what?

Also, what setting are you using for the maximum length of variable length
strings?

-- Frank Manning
-- NetMedia, Inc.




(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )