Very simple multitasking on MSP430

From: Andreas (somewhere_at_else.com)
Date: 09/25/04


Date: Sat, 25 Sep 2004 11:35:24 +0200

Hi!
I have to program a MSP430F11(0/1)1 (1/2KB Flash, 128B RAM)
to do 2 tasks:

- RX/TX bus connection
- measure a capacitance with timer_A

The measurement has to run every certain time. But this has not the
highest priority. It is better for me to loose one measurement cycle and
therefore get incoming bus data. At this point I remark, that I can't
adjust interrupt priorities in the MSP430, they are built in.
The RX function can be implemented blocking (waiting for an interrupt to
occur) or non-blocking (by waiting for an interrupt OR a timeout).
How can the tasks be arranged to work pseudo-simultanous?
I know the simple OS versions available for the MSP430, but they need
too much memory. I tried to use 16-bit watchdog as an interval timer to
get a system time source. Its interrupt has the highest priority, hasn't
it? Now I need a very very simple scheduler.

I thought about this, too:
In this scenario I use the watchdog timer in reset mode as task timer.
I have a reset-persistent RAM area, where I can hold status variables
over a reset. So I can use a state variable (measure/RXTX) and switch to
the corresponding next action after a reset. If the task time is used
up, I get a reset by the watchdog timer, switch to the other task by
asking my state variable and so on. So I have a reset context switch ;-)

What do you think?

Regards,
Andreas



Relevant Pages

  • Re: Very simple multitasking on MSP430
    ... >The measurement has to run every certain time. ... Its interrupt has the highest priority, ... >In this scenario I use the watchdog timer in reset mode as task timer. ...
    (comp.arch.embedded)
  • Re: Very simple multitasking on MSP430
    ... > The measurement has to run every certain time. ... > adjust interrupt priorities in the MSP430, ... Its interrupt has the highest priority, ... > In this scenario I use the watchdog timer in reset mode as task timer. ...
    (comp.arch.embedded)
  • Re: Bill Gates slow burns over control-alt-delete -- funny video
    ... only generates the standard "INT 1" interrupt. ... section of the boot sequence after the RAM and hardware detection tests ... than a minimum time, then the CPU is reset ... the system can't bypass the NMI ...
    (comp.os.linux.misc)
  • Re: dmesg: PCI interrupts are no longer routed automatically.........
    ... the ISR reads all the INTCSR ... If the PLX had been reset, then the INTCSR bits would all ... available before the chip could generate an interrupt. ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: R: hc12,can i return from interrupt and jump elsewhere?
    ... then you can use a watchdog reset. ... reception of an interrupt event, ... .I'm trying to implement an USB protocol using a 9s12 microcontroller,that i ... It is raccomended that anytime an USB device receives a bus reset it has to ...
    (comp.arch.embedded)