Program Example For I/O Ports - Fujitsu Semiconductor Controller MB89950/950A Hardware Manual

F2mc-8l 8-bit microcontroller
Table of Contents

Advertisement

CHAPTER 4 I/O PORTS
4.7

Program Example for I/O Ports

This section gives an example program for using the I/O ports.
I Program example for I/O ports
G
Processing description
• Port 0 and port 1 are used to illuminate all elements of seven segment LED (eight segments if the
decimal point is included).
• The P00 pin is used for the anode common pin of the LED and the P10 to P17 pins operate as the
segment pins.
Figure 4.7-1 "Connection example for an eight segment LED" shows the connection example for an eight
segment LED.
G
Coding example
PDR0
DDR0
;---------------Main program--------------------------------------------
;-----------------------------------------------------------------------
98
Figure 4.7-1 Connection example for an eight segment LED
MB89950/950A
P00
P17
P16
P10
EQU
0000H
EQU
0001H
CSEG
:
CLRB
PDR0:0
MOV
PDR1, #11111111B
:
ENDS
END
;Address of the port 0 data register
;Address of the port 0 direction register
; [CODE SEGMENT]
;Set P00 to the "L" level
;Set all port 1 pins to the "H" level

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mb89950 seriesMb89950a series

Table of Contents