单片机操作系统RTX51原理分析与移植
with which the following operations can be executed:
l Wait for a signal
l Send signal
l Clear signal
The task number (see section section "Task Declaration") of the receiver task is used for identifying the signals for the individual operations.
2. Message(via MailBoxes(FIFO))
n By means of the mailbox concept, messages can be exchanged free of conflicts between the individual tasks.
n RTX-51 provides a fixed number of eight mailboxes. Messages can be exchanged in words (2 bytes) via these mailboxes. In this case, a message can represent the actual data to be transferred or the identification of a data buffer(defined by the user). In comparison to the signals, mailboxes are not assigned a fixed task, but can be freely used by all tasks and interrupt functions. These are identified with a mailbox number.
Mailboxes allow the following operations:
l Send a message
l Read a message
Each mailbox is internally consists of three wait lists.(Figure 2)
Figure 2
1. Message list
List of the messages written in the mailbox. These comprise a maximum of eight messages.
2. Write wait list
Wait list for tasks which want to write a message in the message list of the mailbox (maximum 16 tasks).
3. Read wait list
Wait list for tasks which want to read a message from the message list of the mailbox (maximum 16 tasks).
3. Semaphore
n By means of the semaphore concept, resources can be shared free of conflicts between the individual tasks.
n A semaphore contains a token that your code acquires to continue execution. If the resource is already in use, the requesting task is blocked until the token is returned to the semaphore by its current owner.
n There are two types of semaphores: binary semaphores and counting semaphores. As its name implies, a binary semaphore can only take two values: zero or one (token is in or out). A counting semaphore, however, allows values between zero and 65535.
RTX-51 provides a fixed number of eight semaphores of the binary type.
Semaphores allow the following operations:
l Wait for token
l Return (send) token
2. 中断管理
RTX-51 performs task synchronisation for external events by means of the interrupt system.
Two types of interrupt processing are basically supported in this case:
1. 单片机c语言 Interrupt Functions (Interrupt are processed by c51 interrupt funcions)
l Very sudden, periodically occurring interrupts without large coupling with the rest of the system (only infrequent communication with RTX-51 tasks, etc.).
l Very important interrupts which must be served immediately independent of the current system state.
2. Task Interrupts(Interrupt are processed by fast or standard tasks of RTX-51
l Fast Task Interrupts
Important or periodic interrupts which must heavily communicate with the rest of the system when they occur.
l Standard Task Interrupts
Only seldom occurring interrupts which must not be served immediately.
RTX-51 shows considerable different response times for fast and standard tasks.
u The INTERRUPT ENABLE registers of the 8051 are managed by RTX-51 and must not be directly manipulated by the user!
u The Interrupt Priority registers of the 8051 (not to be confused with the softwaretask priorities) are not influenced by RTX-51.
3. 动态内存管理
RTX-51 uses a simple and effective algorithm, which functions with memory blocks of a fixed size. All memory blocks of the same size are managed in a socalled memory pool. A maximum of 16 memory pools each a different block size can be defined. A maximum of 255 memory blocks can be managed in each pool.
n Generate Memory Pool
The application can generate a maximum of 16 memory pools with various
- FPGA的DSP性能揭秘(06-16)
- 基于单片机通用引脚的软件UART设计(10-16)
- 分时操作系统思想在单片机中的具体应用 (10-30)
- 基于AT89C51+DSP的双CPU伺服运动控制器的研究(05-26)
- 关于RTX51 TINY的分析与探讨(05-30)
- 基于MC9S12DGl28单片机的智能寻迹车设计(04-03)