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

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
The numbers in the left margin are reference indicators and are not a part of the code.
Load and run the program. Note that LED DS4 flashes once per second. Push button S1
several times and note how LED DS1 is toggled.
The flashing of LED DS4 is performed by the costatement starting at the line marked (2).
Costatements need to be executed regularly, often at least every 25 ms. To accomplish
this, the costatements are enclosed in a while loop. The term while loop is used as a handy
way to describe a style of real-time programming in which most operations are done in
one loop. The while loop starts at (1) and ends at (7). The function
User’s Manual
int vswitch;
S1
main(){
(1) while (1) {
(2)
(3)
(4)
(5)
out
ms
(6)
(7) }
}
WrPortI(SPCR,NULL,0x84);
WrPortI(PADR,&PADRShadow,0xff);
vswitch=0;
// first task flash LED DS4 every second for 200 milliseconds
// second task - debounce switch #1 and toggle virtual switch vswitch
// check button 1 and toggle vswitch on or off
// make LED agree with vswitch if vswitch has changed
BigLoopTop();
costate {
}
costate {
}
if( (PADRShadow & 1) == vswitch) {
)
BitWrPortI(PADR,&PADRShadow,0,3); // LED DS4 on
waitfor(DelayMs(200));
BitWrPortI(PADR,&PADRShadow,1,3); // LED DS4 off
waitfor(DelayMs(800));
if(BitRdPortI(PBDR,2)) abort;
waitfor(DelayMs(50));
if(BitRdPortI(PBDR,2)) abort;
vswitch=!vswitch;
while (1) {
}
BitWrPortI(PADR,&PADRShadow,!vswitch,0);
waitfor(BitRdPortI(PBDR,2)); // wait for button to go up
waitfor(DelayMs(200));
if(BitRdPortI(PBDR,2)) break;// if button up break
// state of virtual switch controlled by button
// begin main program
// set up parallel port A as output
// toggle virtual switch- button was down 50
// end of while loop, go back to start
// end of main, never come here
// if button not down skip out
// wait 50 ms
// if button not still down skip
// wait for button to be off 200 ms
// wait for 200 milliseconds
// end of while(1)
// end of costatement
// Begin a big endless loop
// turn off all LEDs
// initialize virtual switch off
// Endless loop
// begin a costatement
// light on for 200 ms
// light off for 800 ms
// end of costatement
BigLoopTop()
is
49

Related parts for 20-101-0356