CT-161-CD Fujitsu Semiconductor America Inc, CT-161-CD Datasheet - Page 57

KIT 16LX FOR MB90F387

CT-161-CD

Manufacturer Part Number
CT-161-CD
Description
KIT 16LX FOR MB90F387
Manufacturer
Fujitsu Semiconductor America Inc
Series
F²MC-16LXr
Type
MCUr
Datasheets

Specifications of CT-161-CD

Contents
Board, Cable, CD
For Use With/related Products
MB90F387S
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Other names
865-1103

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
CT-161-CD
Manufacturer:
Fujitsu Semiconductor America
Quantity:
135
© Fujitsu
3.2
This section explains how to create a program to detect the switch operation state. The
program also controls LED operation to enable you to visually know that the switch operation
state is detected. The program applies the method of turning on the LED described in the
previous chapter.
3.2.1
The operation of the program to be created is as described below. Figure 3.4 is the flow
of the program that performs the operation.
How to create and execute a program to control LEDs by switch operation
(1) When SW1 is pressed, LED1 is turned on.
(2) While SW1 is in the on state, LED1 is kept lighting.
(3) When SW1 is released (set to off), LED1 is turned off.
(4) Similarly, LED2 is turned on and off according to the SW2 state.
Outline of program to be created
- When the read value is '0,' the switch can be determined to be in the on state.
- When the read value is '1,' the switch can be determined to be in the off state.
Set output pins for LED1 and LED2
Set input pins for SW1 and SW2
PDR2.bit5 = 0
PDR2.bit7 = 0
Set LED1 to on (PDR1.bit0 = 0)
Set LED2 to on (PDR1.bit1 = 0)
(PDR1.bit0=1, PDR1.bit1=1)
(DDR2.bit5=0, DDR2.bit7=0)
SW1 input state?
SW2 input state?
START
Figure 3.4 Flow of program
-
51
-
(6)
(3)
(4)
(7)
------------- (1)
PDR2.bit5 = 1
PDR2.bit7 = 1
------------- (2)
Set LED1 to off (PDR1.bit0 = 1)
Set LED2 to off (PDR1.bit1 = 1)
(5)
(8)

Related parts for CT-161-CD