参数资料
型号: 101-0478
厂商: Rabbit Semiconductor
文件页数: 17/90页
文件大小: 0K
描述: KIT DEV RABBIT RCM2200 INTL
标准包装: 1
系列: RabbitCore 2000
类型: MPU 模块
适用于相关产品: RCM2200
所含物品: RabbitCore 模块,开发板,缆线和 Dynamic C? CD-Rom
18
RabbitCore RCM2200
tion of how Dynamic C handles multitasking with costatements and cofunctions, see
Chapter 5, “Multitasking with Dynamic C,” and Chapter 6, “The Virtual Driver,” in the
Dynamic C User’s Manual.
3.1.4.3 TOGGLELED.C
One of Dynamic C’s unique and powerful aspects is its ability to efficiently multitask
using cofunctions and costatements. This simple application demonstrates how these pro-
gram elements work.
This sample program uses two costatements to set up and manage the two tasks. Costate-
ments must be contained in a loop that will “tap” each of them at regular intervals. This
program:
1. Initializes the pins of Port A as outputs.
2. Sets all the pins of Port A high, turning off the attached LEDs.
3. Sets the toggled LED status variable vswitch to 0 (LED off).
4. Starts an endless loop using a while(1) expression, and within that loop:
Executes a costatement that flashes LED DS3;
Executes a costatement that checks the state of switch S2 and toggles the state of
vswitch
if it is pressed;
Turns LED DS2 on or off, according to the state of vswitch.
These steps repeat as long as the program is allowed to run.
The first costatement is a compressed version of FLASHLED.c, with slightly different
flash timing. It also uses the library function DelayMs() to deliver more accurate timing
than the simple delay loops of the previous program.
The second costatement does more than check the status of S2. Switch contacts often
“bounce” open and closed several times when the switch is actuated, and each bounce can
be interpreted by fast digital logic as an independent press. To clean up this input, the code
in the second costatement “debounces” the switch signal by waiting 50 milliseconds and
checking the state of the switch again. If it is detected as being closed both times, the pro-
gram considers it a valid switch press and toggles vswitch.
Unlike most C statements, the two costatements are not executed in their entirety on each
iteration of the while(1) loop. Instead, the list of statements within each costatement is
initiated on the first loop, and then executed one “slice” at a time on each successive inter-
ation. This mode of operation is known as a state machine, a powerful concept that per-
mits a single processor to efficiently handle a number of independent tasks.
The ability of Dynamic C to manage state machine programs enables you to create very
powerful and efficient embedded systems with much greater ease than other programming
methods.
More Information
See the entries for the DelayMs() function, as well as Section 5, “Multitasking with
Dynamic C,” in the Dynamic C User’s Manual.
相关PDF资料
PDF描述
RBC20DRXH CONN EDGECARD 40POS DIP .100 SLD
N001-005-BK-R CABLE PATCH CAT5E BLACK 5'
SDR-BK SCOTCH CODE REFILL BLACK
94SVPD186X0035F8 CAP ALUM 18UF 35V 20% SMD
GCC18DCMT-S288 CONN EDGECARD 36POS .100 EXTEND
相关代理商/技术参数
参数描述
101048 制造商:Jacob 功能描述:Bulk
10-1-048 制造商:IGUS 功能描述:SERIES 10 ENERGY CHAIN
101-0480 功能描述:开发板和工具包 - 其他处理器 RCM2300 DEV KIT RoHS:否 制造商:Freescale Semiconductor 产品:Development Systems 工具用于评估:P3041 核心:e500mc 接口类型:I2C, SPI, USB 工作电源电压:
101-048-033 制造商:PANCON CONNECTORS 功能描述:Conn Shrouded Header HDR 48 POS 5.08mm Solder RA Thru-Hole 制造商:ITW Pancon 功能描述:Conn Shrouded Header HDR 48 POS 5.08mm Solder RA Thru-Hole
101-0481 功能描述:KIT DEV RABBIT RCM2300 INTL RoHS:否 类别:编程器,开发系统 >> 通用嵌入式开发板和套件(MCU、DSP、FPGA、CPLD等) 系列:RabbitCore 2000 产品培训模块:Blackfin® Processor Core Architecture Overview Blackfin® Device Drivers Blackfin® Optimizations for Performance and Power Consumption Blackfin® System Services 特色产品:Blackfin? BF50x Series Processors 标准包装:1 系列:Blackfin® 类型:DSP 适用于相关产品:ADSP-BF548 所含物品:板,软件,4x4 键盘,光学拨轮,QVGA 触摸屏 LCD 和 40G 硬盘 配用:ADZS-BFBLUET-EZEXT-ND - EZ-EXTENDER DAUGHTERBOARDADZS-BFLLCD-EZEXT-ND - BOARD EXT LANDSCAP LCD INTERFACE 相关产品:ADSP-BF542BBCZ-4A-ND - IC DSP 16BIT 400MHZ 400CSBGAADSP-BF544MBBCZ-5M-ND - IC DSP 16BIT 533MHZ MDDR 400CBGAADSP-BF542MBBCZ-5M-ND - IC DSP 16BIT 533MHZ MDDR 400CBGAADSP-BF542KBCZ-6A-ND - IC DSP 16BIT 600MHZ 400CSBGAADSP-BF547MBBCZ-5M-ND - IC DSP 16BIT 533MHZ MDDR 400CBGAADSP-BF548BBCZ-5A-ND - IC DSP 16BIT 533MHZ 400CSBGAADSP-BF547BBCZ-5A-ND - IC DSP 16BIT 533MHZ 400CSBGAADSP-BF544BBCZ-5A-ND - IC DSP 16BIT 533MHZ 400CSBGAADSP-BF542BBCZ-5A-ND - IC DSP 16BIT 533MHZ 400CSBGA