20-151-0178 Rabbit Semiconductor, 20-151-0178 Datasheet - Page 88
![CABLE CONVERTER RS-232 TO USB](/photos/8/97/89711/20-151-0178_sml.jpg)
20-151-0178
Manufacturer Part Number
20-151-0178
Description
CABLE CONVERTER RS-232 TO USB
Manufacturer
Rabbit Semiconductor
Datasheet
1.20-151-0178.pdf
(162 pages)
Specifications of 20-151-0178
Accessory Type
USB to RS232 Adapter
Product
Microcontroller Accessories
For Use With/related Products
Rabbit-based Boards
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Other names
20-151-0178
316-1181
316-1181
- Current page: 88 of 162
- Download datasheet (4Mb)
We will now go through each part of this new while loop in detail:
Like before, we use a costatement to make implementing debouncing easier. Now notice the
flexDigInGroup16() function call. Like flexDigOutGroup16(), this function takes an array
of Flex_IOPin pointers. However, the second parameter is a pointer to an unsigned integer.
flexDigInGroup16() places the values read from the digital inputs into this unsigned integer
(switch_values, in this case). This is done in much the same way that the outputs are used in
flexDigOutGroup16(). That is, the value read from the first input in the group is placed in the least
significant bit in the unsigned integer; the second input value is placed in the next least significant bit; etc.
Note that having a do/while loop in a costatement is not an efficient design for cooperative multitasking,
since the costatement would not yield until a switch has been pressed. In a real-world application, busy
waiting such as this should be replaced with a waitfor statement and a function call to code that would
check for the switch press and return.
Notice that we are reading the switch inputs until one of the switches has been pressed. Because we read
the values in a group, we can check all switches simultaneously.
Next, we must inspect the switch_values unsigned integer to determine which switch was pressed. To
do this, we use the value variable to check against each bit of switch_values. That is, we change
the bit that is set within the variable value in each iteration of the loop. By ORing the value variable
against switch_values, we can determine if the corresponding switch has been pressed.
82
while (1) {
costate {
// Check if a switch has been pressed
do {
} while (switch_values == 0x00);
// Determine which switch was pressed
value = 1;
switch_pressed = switches;
led = leds;
switchnum = 1;
while (!(value | switch_values)) {
}
// switch_pressed now indicates which pin was pressed
flexDigInGroup16(switches, &switch_values);
value <<= 1;
switch_pressed++;
led++;
switchnum++;
www.rabbit.com
Applications Programming
Related parts for 20-151-0178
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
![20-151-0101](/images/no-image3.png)
Part Number:
Description:
Microcontroller Modules & Accessories Assy Download 1.27MM and 2MM Pitch Cbles
Manufacturer:
Rabbit Semiconductor
![3057P-1-203](/photos/16/51/165126/3057_tmb.jpg)
Part Number:
Description:
Trimmer Resistors - Multi Turn 20Kohms 5% 1 1/4 PC Mount
Manufacturer:
Bourns Inc.
Datasheet:
![PCF8576CH/1](/images/manufacturer_photos/0/4/487/nxp_semiconductors_tmb.jpg)
Part Number:
Description:
LCD Drivers 160 SEGMENT LCD SEGMENT DRIVER
Manufacturer:
NXP Semiconductors
![350218-1](/photos/30/72/307284/pr350218-1_l_tmb.jpg)
Part Number:
Description:
20-24 awg TIN PIN REEL M-N-L
Manufacturer:
TE Connectivity
Datasheet:
![PCF2127AT/1,512](/images/manufacturer_photos/0/4/487/nxp_semiconductors_tmb.jpg)
Part Number:
Description:
IC REAL TIME CLK/CALENDAR 20SOIC
Manufacturer:
NXP Semiconductors
Datasheet:
![PCF2129AT/1,512](/images/manufacturer_photos/0/4/487/nxp_semiconductors_tmb.jpg)
Part Number:
Description:
IC REAL TIME CLK/CALENDAR 20SOIC
Manufacturer:
NXP Semiconductors
Datasheet:
![PCF2127AT/1,518](/images/manufacturer_photos/0/4/487/nxp_semiconductors_tmb.jpg)
Part Number:
Description:
IC RTC/CALENDAR TCXO QTZ 20SOIC
Manufacturer:
NXP Semiconductors
Datasheet:
![NTD3055L104-1](/images/manufacturer_photos/0/4/495/on_semiconductor_tmb.jpg)
Part Number:
Description:
Manufacturer:
ON Semiconductor
Datasheet:
![SC3306Q-1](/images/manufacturer_photos/0/0/43/amcc__applied_micro_circuits_corp__tmb.jpg)
Part Number:
Description:
20-OUTPUT LVTTL CLOCK DRIVER
Manufacturer:
AMCC (Applied Micro Circuits Corp)
![SC3308Q-1](/images/manufacturer_photos/0/0/43/amcc__applied_micro_circuits_corp__tmb.jpg)
Part Number:
Description:
20-OUTPUT LVTTL CLOCK DRIVER
Manufacturer:
AMCC (Applied Micro Circuits Corp)
![SC3506Q-1](/images/manufacturer_photos/0/0/43/amcc__applied_micro_circuits_corp__tmb.jpg)
Part Number:
Description:
20-OUTPUT CLOCK DRIVER
Manufacturer:
AMCC (Applied Micro Circuits Corp)