Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem with implementation of PaulOS for 8051

Status
Not open for further replies.

gorkin

Advanced Member level 1
Advanced Member level 1
Joined
Feb 27, 2002
Messages
422
Helped
13
Reputation
26
Reaction score
5
Trophy points
1,298
Location
brazil
Activity points
3,375
PaulOS for 8051

Hello brothers!
I´ve found this "cooperative rtos" in schultz 8051 book website: http://www.candthe8051.com/CRTOS_V2.h

I try evaluate it, but I not have any sucess, see above my implemantation in Keil IDE, my uC is: AT89C8051RD2 with 64kB Flash and 2kB RAM.

Like above, my implementation are very simple. I have four task´s and I can see the counter variables counting at interval specified by the task switch.
In main function, I initializate the rtos and all tasks, after I entered in infinite loop...but when I try simulate, only and only task0 run...What happens?

void task0 (void)
{
static unsigned long int _i0_ = 0;
for(;;)
{
_i0_++;
}
}

void task1 (void)
{
static unsigned long int _i1_ = 0;
for(;;)
{
_i1_++;
}
}

void task2 (void)
{
static unsigned long int _i2_ = 0;
for(;;)
{
_i2_++;
}
}

void task3 (void)
{
static unsigned long int _i3_ = 0;
for(;;)
{
_i3_++;
}
}


void main (void)
{
static unsigned char CurrentTask;

INIT_RTOS(0);
CREATE(0, task0);
CREATE(1, task1);
CREATE(2, task2);
CREATE(3, task3);
RTOSGO(0);

for(;;)
{
CurrentTask = RUNNING_TASK_ID();

}
}
 

Re: PaulOS for 8051

Bro if the cooperative you must remove the

for (;;;)

or

while (1)

the preemptive you can do this but in cooperative never do with this.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top