Re: Very simple multitasking on MSP430

From: dmm (dmmilne_removethis__at_ozemail.com.au)
Date: 09/26/04


Date: Sun, 26 Sep 2004 10:26:24 +1000

On Sat, 25 Sep 2004 11:35:24 +0200, Andreas <somewhere@else.com> wrote:

>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

Perhaps you can obtain a few ideas by this design. A Japanese
gentleman has created a capacitance meter using the comparator
of an AT90S2313, then sends a serial output to a LED display.

The circuit and source code is available at

http://elm-chan.org/works/cmc/report.html



Relevant Pages

  • Very simple multitasking on MSP430
    ... The measurement has to run every certain time. ... The RX function can be implemented blocking (waiting for an interrupt to ... 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: Low drift OP amp for photodiode circuit
    ... You can reset the cap with a MOSFET wired in parallel with it. ... Thus the slope of the V vs T curve can be measured much more accurately than the instantaneous voltage across the feedback resistor. ... will make the measurement much easier, and if you have a universal counter, there's no problem getting lots of digits on a frequency measurement. ... The reset process does have thermal noise, but as long as you measure the voltage just after reset and subtract that from the measurement, there's no thermal noise in the photocurrent measurement. ...
    (sci.electronics.design)
  • Re: Very simple multitasking on MSP430
    ... > The measurement has to run every certain time. ... You could use an interrupt function for the bus data. ... it has highest priority. ...
    (comp.arch.embedded)
  • Re: Low drift OP amp for photodiode circuit
    ... method is to use a capacitor instead of the feedback resistor, ... feedback resistor. ... frequency of the reset pulses. ... will make the measurement much easier, and if you have a universal ...
    (sci.electronics.design)