Program Example Of Dtp/External Interrupt - Fujitsu MB90480 Series Hardware Manual

F2mc-16lx 16-bit microcontroller
Table of Contents

Advertisement

CHAPTER 16 DTP/EXTERNAL INTERRUPTS
16.6

Program Example of DTP/External Interrupt

This section describes the program example of the DTP/external interrupt.
Program Example of DTP/External Interrupt
Example of setting procedure
Generate external interrupt at rising edge of signal
input by INT0.
<Initial setting>
Port
Select INT0 port input
Control INT0
Select external interrupt
detection
Interrupt related 1
Set INT0 interrupt level
Set I flag
Interrupt related 2
INT0 interrupt source
Enable INT0 interrupt
<Interrupt>
Read conversion value
Clear interrupt request flag
• Arbitrary processing
<Interrupt vector>
Set vector table
Note:
Setting related to clock and setting of _set_il (numeric
value) are required in advance. See the chapter of
clock and interrupt.
352
Program example
void EX_INT_sample_1()
{
EX_INT0_initial();
}
void EX_INT0_initial(void)
Register name. bit name
{
DDR8 .P80
IO_DDR8.bit.D80= 0;
Register name. bit name
ELVR
IO_ELVR.word= 0x0001;
LB7,LA7-LB1,LA1
LB0, LA0
ICR00
IO_ICR00 = 0x00
(CCR)
__EI();
EIRR. ER0
IO_EIRR.bit.ER0= 0;
ENIR. EN0
IO_ENIR.bit.EN0= 0;
}
__interrupt void INT0_int(void) /*
{
Register name. bit name
IO_EIRR.bit.ER0= 0;
EIRR. ER0
}
#pragma intvect INT0_int 11
Note:
For the description form of the register, see "SAMPLE I/O REGISTER FILES FOR
2
F
MC-16LX FAMILY MB90480 SERIES".
/* INT0 input */
/* Setting value:F00000001 (bit) */
/* Bit7-2= "000000" */
/* Bit1-0= "01" Detect H level */
/* Arbitrary value */
/*Enable interrupt */
/* Clear ER0 interrupt flag */
/* Enable EN0 interrupt */
*/
/* Clear ER0 interrupt flag */

Advertisement

Table of Contents
loading

Table of Contents