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.

How to use free RTOS socurce code

Status
Not open for further replies.

vead

Full Member level 5
Joined
Nov 27, 2011
Messages
285
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
india
Activity points
3,815
Hello
I wrote my first program in c for LED blinking. I think every beginner start with LED. The same concept I want to apply for RTOS Design. I have been looking many documents , saw many sample programs but I could not understand how to start writing small real time operating. I decided to write real time program for LED's. the reason why I want to use only LED's because I am familiar with LED's working. I can easily track with LED program what's happening program. actually I want to learn how use free RTOS program with my project. I am using cortex M3, three LED's and Keil compiler to write RTOS program.

In project, I will use Cortex M3 and three LED'S and three switches. RTOS kernel will have two features scheduling and multiplexing

Tasks or Multitasking
Task1-Turn ON/OFF LED1 by using Switch1
Task2-Turn ON/OFF LED2 by using Switch2
Task2-Turn ON/OFF LED1 by using Switch3

Scheduling: do every task one by one
Task1---task2----Task3 (repeat all tasks)

How to start ? What should be in headers and what should be in the source files?

Note: I know RTOS is designed to satisfy timing constraints. someone will agree or disagree with my idea but think I am just looking starting and simple steps. My aim is only learning so that's why I started with LED'S
 


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
void vMyTask( void *pvParameters )
{
const TickType_t xOneSecond = pdMS_TO_TICKS( 1000 );
 
    for( ;; )
    {
        // Turn LED on.  (psuedocode)
        LEDState( on );
        // Wait 1000ms
        vTaskDelay( xOneSecond );
        // Turn LED off.
        LEDState( off );
        // Wait 1000ms.
        vTaskDelay( xOneSecond );
    }
}



A good place to start https://www.freertos.org/Documentation/RTOS_book.html
 
Last edited by a moderator:


Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top