MDK-ARM Keil, MDK-ARM Datasheet - Page 32
![KIT REALVIEW MCU DEVELOPMENT](/photos/9/32/93274/mdk-arm_sml.jpg)
MDK-ARM
Manufacturer Part Number
MDK-ARM
Description
KIT REALVIEW MCU DEVELOPMENT
Manufacturer
Keil
Type
Compiler and IDEr
Specifications of MDK-ARM
For Use With/related Products
ARM MCUs
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
- Current page: 32 of 156
- Download datasheet (3Mb)
32
Chapter 2. Developing With an RTOS
Semaphores
Like events, semaphores are a method of synchronizing activity between two or
more tasks. Put simply, a semaphore is a container that holds a number of
tokens. As a task executes, it will reach an RTOS call to acquire a semaphore
token. If the semaphore contains one or more tokens, the task will continue
executing and the number of tokens in the semaphore will be decremented by
one. If there are currently no tokens in the semaphore, the task will be placed in
a WAITING state until a token becomes available. At any point in its execution,
a task may add a token to the semaphore causing its token count to increment by
one.
Semaphores are used to control
access to program resources.
Before a task can access a
resource, it must acquire a token.
If none is available, it waits.
When it is finished with the
resource, it must return the
token.
The diagram illustrates the use of
a semaphore to synchronize two
tasks. First, the semaphore must
be created and initialized with an
initial token count. In this case,
the semaphore is initialized with a single token. Both tasks run and reach a point
in their code where they will attempt to acquire a token from the semaphore. The
first task to reach this point will acquire the token from the semaphore and
continue execution. The second task will also attempt to acquire a token, but as
the semaphore is empty, it will halt execution and be placed into a WAITING
state until a semaphore token is available.
Meanwhile, the executing task can release a token back to the semaphore. When
this happens, the waiting task will acquire the token and leave the WAITING
state for the READY state. Once in the READY state, the scheduler will place
the task into the RUN state so that task execution can continue. Although
semaphores have a simple set of RTX API calls, they can be one of the more
difficult RTX objects to fully understand. In this section, we will first look at
how to add semaphores to an RTOS program and then go on to look at the most
useful semaphore applications.
Related parts for MDK-ARM
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
![MDK-ARM-B](/photos/28/43/284363/mdk-arm-basic_tmb.jpg)
Part Number:
Description:
KIT REALVIEW MCU DEVELOPMENT
Manufacturer:
Keil
Datasheet:
![MDK-ARM-B-SM](/photos/15/87/158780/keil_software_tmb.jpg)
Part Number:
Description:
Development Software SUPPORT EXTENSION FOR MDK-ARM-B
Manufacturer:
Keil Software
![MDK-ARM-SM](/photos/15/87/158780/keil_software_tmb.jpg)
Part Number:
Description:
Development Software SUPPORT EXTENSION FOR MDK-ARM
Manufacturer:
Keil Software
![MDK-ARM-BASIC](/photos/28/43/284363/mdk-arm-basic_tmb.jpg)
Part Number:
Description:
KIT REALVIEW MCU DEVELOPMENT
Manufacturer:
Keil
Datasheet:
![MDK-ARM-UF](/photos/15/87/158780/keil_software_tmb.jpg)
Part Number:
Description:
Development Software MCU DEV KIT FOR ARM UPG TO FLOATING LIC
Manufacturer:
Keil Tools
![MDK-ARM-F](/photos/15/87/158780/keil_software_tmb.jpg)
Part Number:
Description:
Development Software MCU DEV KIT FOR ARM W/ FLOATING LICENSE
Manufacturer:
Keil Software
![MDK-ARM3.1](/photos/26/86/268691/landingpagekeilrealviewarmkit_tmb.jpg)
Part Number:
Description:
Development Software MCU DEV KIT FOR ARM uVISION & C++ & RTX
Manufacturer:
Keil Tools
![MDK-ARM-SMB](/images/no-image3.png)
Part Number:
Description:
Development Software SUPP LICENSE RENEWAL 90+ DAYS NO TECH SUP
Manufacturer:
Keil Software
![KEIL-PK51-INTL](/images/manufacturer_photos/0/6/609/silicon_laboratories_inc_tmb.jpg)
Part Number:
Description:
KEIL C-COMPILER INTERNATIONAL
Manufacturer:
Silicon Laboratories Inc
![OM10045](/photos/9/21/92162/om10045_tmb.jpg)
Part Number:
Description:
BOARD EVAL FOR LPC213X ARM MCU
Manufacturer:
NXP Semiconductors
Datasheet:
![TWR-K60N512-KEIL](/images/manufacturer_photos/0/2/262/freescale_semiconductor_tmb.jpg)
Part Number:
Description:
K60N512 Keil Tower Kit
Manufacturer:
Freescale Semiconductor
Datasheet: