Forums

design rtos for lpc2148

Started by preethamreddy1989 December 19, 2012
hello friends i need a rtos program to run 3 task
1.task should measure the value (ade7757)
2.it should display on lcd
3.it should send data to zigbee

can anyone give me idea how write the program

An Engineer's Guide to the LPC2100 Series

3 ideas for you:

1 - write the code
2 - test it
3 - solve errors and bugs you might find.

Hope it works.

Regards,
Bernardo Marques.
On Wed, 2012-12-19 at 08:02 +0100, Bernardo Marques wrote:
> 3 ideas for you:
>
> 1 - write the code
> 2 - test it
> 3 - solve errors and bugs you might find.
>
> Hope it works.
>
> Regards,
> Bernardo Marques.

Better yet, hire one of the many helpful persons on
this list (and pay him/her) to write the code for you.

roelof
I assume that this is for some kind of school project.
In which case I would suggest that you would just try it first.

Communities respond best to specific (technical) questions and not to questions such as "write my code please". I'm sorry to say it but that is what your question looks like.

--
Kevin
Here it is:

while( 1 )
{
measure();
display();
send();
pause();
}

DaveS
--- In l..., "Kevin" wrote:
>
> I assume that this is for some kind of school project.

You are correct !

> In which case I would suggest that you would just try it first.
>
> Communities respond best to specific (technical) questions and not to questions such as "write my code please". I'm sorry to say it but that is what your question looks like.

The OP is from India( preethamreddy1989 is a typical name ) .

What did you expect ?

He will drop out and let the real engineers from India shine.

don
hello "Donald H"
i was asking how to start writing rtos not to write my porgram

i want to know how to run 3 task simultaneously
may be i m not too smart as of u in this programming but not too stupid
like u to embrass others

this group is to help others but not to show ur's intelligence
On 20/12/2012 10:32, preethamreddy1989 wrote:
>
> hello "Donald H"
>
> i was asking how to start writing rtos not to write my porgram
>
> i want to know how to run 3 task simultaneously
> may be i m not too smart as of u in this programming but not too stupid
> like u to embrass others
>
> this group is to help others but not to show ur's intelligence

I think the group provides the best help to those who start by helping
themselves.

On the link below you will find a very basic demo that will run in a
simulator, so no hardware required. It probably makes a good starting
point if you are not familiar with running tasks in an RTOS.

http://www.freertos.org/simple-freertos-demos.html

There are also tutorial books that take you from the very basics to an
intermediary level, but this forum is not intended for commercial plugs,
so I will note that there are lots of books available that will do the
same thing for you.

Regards,
Richard.

+ http://www.FreeRTOS.org
Designed for microcontrollers. More than 7000 downloads per month.

+ http://www.FreeRTOS.org/trace
15 interconnected trace views. An indispensable productivity tool.
--- In l..., "preethamreddy1989" wrote:
> hello "Donald H"
> i was asking how to start writing rtos not to write my porgram
>
> i want to know how to run 3 task simultaneously

Writing an RTOS is a REALLY BIG job. Take a look at the code in FreeRTOS for examples that run on the LPC2148.

Your application, as you describe it, doesn't appear to need an RTOS and there would be no advantage to using one for a sequential read-compute-write type of program. You can't 'write' until you have the results of 'compute' which is totally reliant on 'read'.

Tasks don't really run simultaneously on a single core processor.

Cooperative multitasking is a useful way to get the appearance of simultaneous execution. Most OSs like Windows use cooperative multitasking. Basically, each task surrenders its execution so other tasks get a chance to run. For example, a loop in a cooperative task might have a DoEvents() call while inside a tight loop.



For a simple read-compute-write type of program the loop looks the same:



Some people call this type of loop a SuperLoop because it gives every task a chance to execute in a round-robin scheme.

As I said, writing an RTOS is a REALLY BIG job. You'll need to do some research on this one. I would start with FreeRTOS...

Richard
On 12/19/2012 07:26 AM, preethamreddy1989 wrote:
>
> hello friends i need a rtos program to run 3 task
> 1.task should measure the value (ade7757)
> 2.it should display on lcd
> 3.it should send data to zigbee
>
> can anyone give me idea how write the program
> .

My suggestion would be to check the co-operative scheduler included and
explained in this free ebook
http://www.tte-systems.com/books/pttes

The scheduler is written in C and can be easily ported to any mcu, all
you need to change is the interrupt handler to match your device.

I doubt that your project needs a pre-emptive RTOS, I'm not even sure if
you actually need any OS.

Alex
---------------------
http://alexan.edaboard.eu/ (Home of ARMwizard, a free tool for peripheral initialization of LPC2xxx/17xx/13xx/11xx/122x microcontrollers )