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

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
3.2.2
This program first sets the output pins for the LEDs, and then sets the input pins for the
switches. The necessity of these settings was explained in the previous section. The
program subsequently reads the value of the bit 5 of PDR2 to detect the state of SW1.
The program turns on or off LED1 according to the read value. To turn on and off
LED1, the program writes 0 or 1, respectively, to the bit 0 of PDR1. Also for SW2, the
program performs the similar processing and controls LED2.
Let us now create the actual program.
Appendix A.1, open the source file "main.c" stored in ”sample.prj”, and input the program
portion enclosed by dotted line in Figure 3.5. Use the files other than "main.c" without
modification.
procedure described in Appendix A.2. If an error message is output, check that the
content of the input program is exactly the same as the description shown in Figure 3.5.
When the build operation ends successfully, ACCEMIC MDE starts automatically.
After the ACCEMIC MDE window appears, execute the program and check its operation.
For how to execute the program, see Appendix A.3. After executing the program, press
SW1 or SW2. If LED1 or LED2 goes on, the program operation is correct.
void main(void)
{
}
Creating and executing of program
__set_il(7);
__EI();
IO_PDR1.byte = 0x00;
IO_DDR1.byte = 0x1F;
IO_DDR2.byte = 0x00;
while(1)
{
}
After the input of the program, build the program according to the
Figure 3.5 Sample program code (main routine)
if(IO_PDR2.bit.P25==1){
}
else{
}
if(IO_PDR2.bit.P25==1){
}
else{
}
Program code added
IO_PDR1.bit.P10 = 1;
IO_PDR1.bit.P10 = 0;
IO_PDR1.bit.P10 = 1;
IO_PDR1.bit.P10 = 0;
-
52
-
According to the procedure described in
(1) Port 1(LED control) output setting
(2) Port 2 (SW input) input setting
(3) SW1 input state?
(4) LED1 on
(5) LED1 off
(6) SW2 input state?
(7) LED2 on
(8) LED2 off
© Fujitsu

Related parts for CT-161-CD