Myke's Home Page

Book CD-ROM Home

File Copying/Harddrive Setup

Development Tools

Experiments

Projects

Useful Code Snippets and Macros

Introduction to Electronics

Introduction to Programming

Datasheets

PCBs

Links

McGraw-Hill Professional Publishing

"RTOS1" Project

I have always liked developing applications in a Real Time Operating System (RTOS) environment. This is especially true for complex applications where different hardware devices are implemented. In this project and RTOS2, I will introduce you to the concept along with some simple applications.

Click Here to look at the PICmicro MCU source code.

The circuits used for this application are:

The bill of materials for this application is listed in the table below.

Part Description
PIC18C452 PIC18C452-JW
LED 8x LED, Individual or use 10x LED "Bargraph" Display
4 MHz 4 MHz Ceramic Resonator with Internal Capacitors
10K 10K, 1/4 Watt Resistor
220 8x 220 Ohm, 1/4 Watt Resistors
0.1 uF 0.1 uF, 16 Volt Tantalum Capacitor
Miscellaneous Prototyping Card, Wiring, +5 Volt 500 mA Power Supply

The RTOS system requests are listed in the table below:

RTOS Request Input Output Macro
Start Task - Starting Address
- Priorty
- File Register Size Requirements
- Carry Reset, OK and New Task Number in "WREG"
- Carry Set, NO Available Tasks or more than 63 Task Variables Requested
TaskStart Address, Priority, Size
Address, Priority and Size are all constants
Next Task None None TaskNext
Wait for Interrupt - Interrupt Number None IntWait Interrupt
Interrupt is a Constant
Send Message - Task Number
2 Byte Message in FSR0L/FSR1L
None MsgSend TaskNumber
TaskNumber is a Variable
Wait for Message None - 2 Byte Message in FSR0L/FSR1L
TaskNumber in WREG
MsgWait
Read Message - Task Number - Carry Reset 2 Byte Message in FSR0L/FSR1L
- Carry Set, no message to receive
MsgRead TaskNumber
TaskNumber is a Variable
Ack Message - Task Number - Carry Reset Operation Complete
- Carry Set, no message to acknowledge
MsgRead TaskNumber
TaskNumber is a Variable

The Interrupt List and Numbers are:

Interrupt Number Interrupt Source Register Location
0 TMR1 PIR1
1 TMR1 PIR1
2 CCP1 PIR1
3 SSP PIR1
4 USART TX PIR1
5 USART RX PIR1
6 AD PIR1
7 PSP PIR1
8 CCP2 PIR2
9 TMR3 PIR2
10 LVD PIR2
11 BCL PIR2
12 RB INTCON
13 INT0 INTCON
14 TMR0 (16.384 msec delay) INTCON
15 Not Avaliable Used by the RTOS

The RTOS Template can be accesseed by clicking Here.