Next:
1 Introduction
Dr. Tak's Real Time Kernel (DTRTK) for the Atmel AVR MCUs
Tak Auyeung, Ph.D.
1
Introduction
2
What does an RTK do?
2
.
1
Terms
2
.
1
.
0
.
1
Process.
2
.
1
.
0
.
2
Thread.
2
.
2
Multithreading
2
.
3
Round Robin
2
.
4
Preemptive Thread Change
2
.
5
Priority Queues
2
.
6
Time Based Scheduling
2
.
7
Time Slicing
2
.
8
Inter-thread Synchronization
3
Files to Compile and Link
3
.
1
timer.S
3
.
2
rtk.S
3
.
3
main.make
4
Downloading and Installing
5
Important Application Dependent Macros
5
.
1
RTK_NUMQUEUES
5
.
2
ISR_FREQ
5
.
3
TICK_FREQ
5
.
4
TIMER_ISR
5
.
5
TIMER_RTK_PREEMPT
5
.
6
TIMER_APP_CALL
6
The API
6
.
1
struct Thread
6
.
2
struct Queue
6
.
3
extern struct Queue rtkQueues[RTK_NUMQUEUES]
6
.
4
unsigned char rtkSliceScaler
6
.
5
unsigned char rtkSliceCounter
6
.
6
void rtkInitialize(struct Thread *t, struct Queue *q)
6
.
7
void rtkThreadAdd(struct Thread *t, struct Queue *q, void *SP, void (*start)(void *), void *param)
6
.
8
void rtkThreadSuicide(void)
6
.
9
void rtkThreadKill(struct Thread* thread, struct Queue* queue)
6
.
10
struct Tick
6
.
11
struct Tick *rtkTickCountGet(struct Tick *t)
6
.
12
struct Tick *tickAdd4(struct Tick *t, unsigned long u4)
6
.
13
struct Thread *rtkCurrentThread
6
.
14
void rtkThreadSchedule(struct Thread *t, struct Tick *t)
6
.
15
void rtkThreadYield(void)
6
.
16
void rtkSemaphoreInitialize(struct Semaphore *s, char initValue)
6
.
17
void rtkSemaphoreP(struct Semaphore *s)
6
.
18
void rtkSemaphoreV(struct Semaphore *s)
6
.
19
void rtkSemaphoreVNoCS(struct Semaphore *s)
6
.
20
int rtkSemaphoreTryP(struct Semaphore *s)
7
Examples
7
.
1
onethread
7
.
2
onethread_sch
8
Advanced Topics
8
.
1
Interrupt Service Routines
8
.
1
.
1
ISR Philosophy
8
.
1
.
2
An Example
8
.
1
.
3
Implementation
8
.
1
.
4
Tak's solution
9
FAQ
9
.
1
What environment/tool set is needed?
9
.
2
I really need to use this in Windows with WinAVR, is it possible?
9
.
3
How does this RTK differ from AVRX?
9
.
4
What is the selling point of this RTK?
9
.
5
What is the future of this RTK?
9
.
6
Is this a competitive product?
9
.
7
Is this RTK free?
9
.
8
Is this RTK related to any Z-World/RabbitSemiconductor product?
About this document ...
Copyright © 2008-10-25 by Tak Auyeung