20-101-0356 Rabbit Semiconductor, 20-101-0356 Datasheet - Page 54

COMPUTER SINGLE-BOARD BL1800

20-101-0356

Manufacturer Part Number
20-101-0356
Description
COMPUTER SINGLE-BOARD BL1800
Manufacturer
Rabbit Semiconductor
Datasheet

Specifications of 20-101-0356

Module/board Type
Single Board Computer Module
Product
Modules
Data Bus Width
8 bit
Processor Type
Rabbit 2000
Sram
128 KB
Flash
256 KB
Timers
8 bit, 10 bit
Number Of I/os
14
Backup Battery
3 V Lithium Coin Type
Operating Voltage
8 V to 40 V
Power Consumption
1.2 W
Board Size
89 mm x 64 mm x 19 mm
Description/function
Computer Module
For Use With/related Products
BL1800
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Other names
316-1079
used to collect some operations that are helpful to do once on every pass through the loop.
Place the cursor on this function name
and hit
<Ctrl-H>
to learn more.
BigLoopTop()
The statement at (3) waits for a time delay, in this case 200 ms. The costatement is being
executed on each pass through the big loop. When a
condition is encountered
waitfor
the first time, the current value of
is saved and then on each subsequent pass
MS_TIMER
the saved value is compared to the current value. If a
condition is not encoun-
waitfor
tered, then a jump is made to the end of the costatement (4), and on the next pass of the
loop, when the execution thread reaches the beginning of the costatement, execution
passes directly to the
statement. Once 200 ms has passed, the statement after the
waitfor
waitfor is executed. The costatement has the property that it can wait for long periods of
time, but not use a lot of execution time. Each costatement is a little program with its own
statement pointer that advances in response to conditions. On each pass through the big
loop, as little as one statement in the costatement is executed, starting at the current posi-
tion of the costatement’s statement pointer. Consult the Dynamic C User’s Manual for
more details.
The second costatement in the program debounces the switch and maintains the variable
. Debouncing is performed by making sure that the switch is either on or off for a
vswitch
long enough period of time to ensure that high-frequency electrical hash generated when
the switch contacts open or close does not affect the state of the switch. The
state-
abort
ment is illustrated at (5). If executed, the internal statement pointer is set back to the first
statement within the costatement, and a jump to the closing brace of the costatement is
made.
At (6) a use for a shadow register is illustrated. A shadow register is used to keep track of
the contents of an I/O port that is write only - it can’t be read back. If every time a write is
made to the port the same bits are set in the shadow register, then the shadow register has
the same data as the port register. In this case a test is made to see the state of the LED and
make it agree with the state of vswitch. This test is not strictly necessary, the output regis-
ter could be set every time to agree with
, but it is placed here to illustrate the
vswitch
concept of a shadow register.
To illustrate the use of snooping, use the watch window to observe
while the
vswitch
program is running. Add the variable
to the list of watch expressions. Then tog-
vswitch
gle
and the LED. Then type
<Ctrl-U>
to observe
again.
vswitch
vswitch
4.3.1 Advantages of Cooperative Multitasking
Cooperative multitasking, as implemented with language extensions, has the advantage of
being intuitive. Unlike preemptive multitasking, variables can be shared between different
tasks without having to take elaborate precautions. Sharing variables between tasks is the
greatest cause of bugs in programs that use preemptive multitasking. It might seem that
the biggest problem would be response time because of the big loop time becoming long
as the program grows. Our solution for that is a device caused slicing that is further
described in the Dynamic C User’s Manual.
50
Jackrabbit (BL1800)

Related parts for 20-101-0356