101-0401 Rabbit Semiconductor, 101-0401 Datasheet - Page 30

KIT DEV RABBIT2000/TCP/IP

101-0401

Manufacturer Part Number
101-0401
Description
KIT DEV RABBIT2000/TCP/IP
Manufacturer
Rabbit Semiconductor
Series
RabbitCore 2000r
Type
MPU Moduler
Datasheet

Specifications of 101-0401

Rohs Status
RoHS non-compliant
Contents
Rabbit 2000™ TCP/IP Development Board, Demo Board, Power Supply, Cable and Software
Processor To Be Evaluated
Rabbit 2000
Interface Type
RS-232, RS-485
For Use With/related Products
RCM2000, RCM2010, RCM2020
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
101-0401
316-1005
Q906133
The numbers in the left margin are reference indicators, and are not a part of the code.
Load and run the program. Note that LED2 flashes once per second. Push button SW1
several times and note how LED1 is toggled.
The flashing of LED2 is performed by the costatement starting at the line marked (2). Cos-
tatements need to be executed regularly, often at least every 25 ms. To accomplish this, the
costatements are enclosed in a
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 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
26
main() {
(1)
(2)
(3)
(4)
(5)
(6)
(7)
}
int vswitch;
WrPortI(PDDDR, &PDDDRShadow, 0x03); // set port D bits 0-1 as outputs
WrPortI(PDDCR, &PDDCRShadow, 0x00); // set port D to not open drain mode
vswitch = 0;
while (1) {
}
}
// First task will flash LED4 for 200 ms once per second.
costate {
// Second task - debounce SW1 and toggle vswitch
costate {
}
// make LED1 agree with vswitch
BitWrPortI(PDDR, &PDDRShadow, vswitch, 0);
// end of while loop
// end of main
BitWrPortI(PDDR, &PDDRShadow, 0xFF, 1);
waitfor(DelayMs(200));
BitWrPortI(PDDR, &PDDRShadow, 0x00, 1);
waitfor(DelayMs(800));
if (!BitRdPortI(PDDR, 2)) abort; // if button not down skip out
waitfor(DelayMs(50));
if(!BitRdPortI(PDDR, 2))
vswitch = !vswitch;
while (1) {
}
waitfor(!BitRdPortI(PDDR, 2));
waitfor(DelayMs(200));
if (!BitRdPortI(PDDR, 2))
break;
while
// state of virtual switch controlled by button S1
loop. The term
// if button still up break out of while loop
// end of costate
// toggle since button was down 50 ms
abort; // if button not still down exit
// initialize virtual switch as off
// endless loop
waitfor
while
// wait 50 ms
// wait for button to go up
// wait additional 200 ms
loop is used as a handy way
condition is encountered
// turn LED on
// wait 200 ms
// turn LED off
// wait 800 ms
TCP/IP Development Kit

Related parts for 101-0401