Figure 4-4 Connection Configuration Between Sw2 And Microcontroller Pins (Schematic Diagram) - Fujitsu F2MC-8FX Series User Manual

8-bit microcontroller bits pot yellow lin board
Hide thumbs Also See for F2MC-8FX Series:
Table of Contents

Advertisement

input to the INT5 pin changes from High to Low. Further, when SW2 is released, the input to the
INT5 pin changes from Low to High. If using the external interrupt function on the microcontroller,
an interrupt can be created using timing that changes the pin status. In other words, if using this
mechanism, the fact that the switch has been operated can be identified using the interrupt. Further,
SW3 can also be operated in the same way as SW2, but SW3 is connected to the INT6 pin on the
microcontroller. Consequently, when SW3 is operated, an INT6 pin external interrupt is created.
■SW2: OFF
Microcontroller
PDR0 register

Figure 4-4 Connection configuration between SW2 and microcontroller pins (schematic diagram)

The next section explains the methods and procedures for using the INT5 pin on the microcontroller
as an external interrupt pin. If using the INT5 pin as an external interrupt, set the I/O direction to
"input" using register DDR0 on port 0 and, further, if using combined analog input pins, it is
necessary to make port input settings. Register DDR0 on port 0 is an 8-bit register for switching the
direction (input or output direction) used by the port 0 pins. If using the pins as input ports, write "0"
to the bit corresponding to DDR0.
Further, to use the external interrupt function on the microcontroller, it is necessary to set the
external interrupt register EIC00. EIC00 is a register that selects the edge polarity and controls
interrupts for the external interrupt inputs.
This section considers when SW 2 being turned ON is detected by an interrupt. When SW2 is
released, the fact that the input level of the INT5 pin changes from Low to High has already been
explained. With the external interrupt function, it is possible to detect the change in the level from
Low to High (i.e., the rising edge) of the INT5 pin by setting the external interrupt register using the
steps (1) to (5) in the procedure described below. Consequently, using this method, it is possible to
detect when SW2 is turned ON using an interrupt.
(1) Write "1" to AIDRL bit 5, and make the settings so that the P5 pin on port 0 is used as the
input port.
(2) Write "0" to DDR0 bit 5, and set SW2 to inputs.
(3) Set EIC20 bit 4 to "0". (This prohibits INT5 interrupts.)
(4) Set EIC20 bit 5 to "1", and bit 6 to "0". (Set so that an external interrupt is created when
Vcc
INT5 pin
SW2
GND
■SW2: ON
Microcontroller
Microcontroller
INT5 pin
PDR0 register
67
AN07-00200-03E
Vcc
No
SW2
GND

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mb95f136jbs

Table of Contents