3.1.1 Other Sample Programs Illustrating Digital I/O
? DEMOJR2.C —repeatedly flashes LED DS3 (which is controlled by PA2) on the Proto-
typing Board.
This sample program also illustrates the use of the runwatch() function to allow
Dynamic C to update watch expressions while running. To test this:
1. Add a watch expression for "k" under "Inspect:Add/Del Watch Expression."
2. Click "Add to top" so that it will be permanently in the watch list.
3. While the program is running, type <Ctrl+U> to update the watch window.
? DEMOJR3.C —demonstrates the use of costatements to LED DS4 (which is controlled
by PA3) on the Prototyping Board. This sample program will also watch button S1
(PB2) and toggle LED DS1 (which is controlled by PA0) on/off when pressed. Note
that S1 presses are debounced by the software.
Parallel Port A can be set for all outputs or all inputs via the slave port control register
(SPCTR). Do not use Parallel Port A if the slave port is being used.
Bits 0–5 on Parallel Port B are always inputs, and bits 6–7 are always outputs. Do not
use Parallel Port B if the slave port is being used.
? JRIOTEST.C —exercises the BL1810's four digital output channels, the one analog
input channel, and the two analog output channels.
? JRIO_COF.C —demonstrates the use of cofunctions with the analog input driver.
Before you run this sample program, connect DA1 to AD0 on header J7 of the Proto-
typing Board to provide an input voltage. Once the sample program is running, it will
read the input voltage ten times while another costatement is executed concurrently. The
values will be printed out in the Dynamic C STDIO window at the end of the program.
Before running the RABDB01.C and the RABDB02.C sample programs, you will need to
install 3 mm LEDs such as the Vishay Telefunken TLUR4400 at DS5–DS8 on the Jack-
rabbit Prototyping Board. These LEDs are included with the Rabbit 2000 Development Kit.
? RABDB01.C —flashes LEDs DS5–DS8 on the Prototyping Board (which are connected
to PA4–PA7) when corresponding switches S1–S4 (which are connected to PB2–PB5)
are pressed. The buzzer, which is driven by HV0 from PE0, will also sound whenever
switch S1 switch is pressed.
? RABDB02.C —flashes LEDs DS5–DS8 on the Prototyping Board (which are connected
to PA4–PA7) when corresponding switches S1–S4 (which are connected to PB2–PB5)
are pressed. The buzzer, which is driven by HV0 from PE0, will also sound whenever
switch S1 switch is pressed.
22
Rabbit 2000 Development Kit
相关PDF资料
101-0523 KIT DEV RABBIT3000/RCM3000
101-1109 KIT EMBEDDED PLC APPLICATION
101-1147 KIT RIO PROGRAM I/O
101-606 CONN SOCKET IDC 60POS W/KEY GOLD
10113616-01531LF CONN MOD JACK 8PORT 8/8 R/A PCB
10117863-5036010LF CONN MOD JACK 8/8 R/A PCB
10118061-5005010LF CONN MOD JACK 2PORT 8/8 R/A PCB
10118062-5001310LF CONN MOD JACK 4PORT 8/8 R/A PCB
相关代理商/技术参数
101-0359-000 制造商:ITT Interconnect Solutions 功能描述:1010359000 / 101-0359-000 / Circular
10103592 制造商:FCI-CONNECTOR 制造商全称:FCI connector 功能描述:MICRO-USB B-TYPE REVERSE
10103592-0001LF 功能描述:USB接头 5P Quick Connect Micro USB TypeB Plug RoHS:否 制造商:FCI 产品:USB Type A Connectors 标准:USB 3.0 端口数量: 位置/触点数量:9 型式:Female 电流额定值:1.8 A 安装风格:Through Hole 端接类型:Solder Pin 连接器类型:USB 3.0 Receptacle
10103593 制造商:FCI-CONNECTOR 制造商全称:FCI connector 功能描述:MICRO-USB B-TYPE MID-MOUNT
10103593-0001LF 功能描述:USB接头 5P Quick Connect Micro USB TypeB RCPT RoHS:否 制造商:FCI 产品:USB Type A Connectors 标准:USB 3.0 端口数量: 位置/触点数量:9 型式:Female 电流额定值:1.8 A 安装风格:Through Hole 端接类型:Solder Pin 连接器类型:USB 3.0 Receptacle
10103593-0001LF 制造商:FCI 功能描述:MICRO USB B, RECEPTACLE, 5POS, SMT RT AN
10103594 制造商:FCI-CONNECTOR 制造商全称:FCI connector 功能描述:MICRO-USB B-TYPE RECEP.
10103594-0001LF 功能描述:USB接头 5P Quick Connect Micro USB TypeB Rcpt RoHS:否 制造商:FCI 产品:USB Type A Connectors 标准:USB 3.0 端口数量: 位置/触点数量:9 型式:Female 电流额定值:1.8 A 安装风格:Through Hole 端接类型:Solder Pin 连接器类型:USB 3.0 Receptacle