352
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.
Program example
void EX_INT_sample_1()
{
EX_INT0_initial();
}
<Initial setting>
void EX_INT0_initial(void)
{
IO_DDR8.bit.D80= 0;
/* INT0 input */
IO_ELVR.word= 0x0001;
/* Setting value:F00000001 (bit) */
/* Bit7-2= "000000" */
/* Bit1-0= "01" Detect H level */
IO_ICR00 = 0x00
/* Arbitrary value */
__EI();
/*Enable interrupt */
IO_EIRR.bit.ER0= 0;
/* Clear ER0 interrupt flag */
IO_ENIR.bit.EN0= 0;
/* Enable EN0 interrupt */
}
<Interrupt>
__interrupt void INT0_int(void) /* */
{
IO_EIRR.bit.ER0= 0;
/* Clear ER0 interrupt flag */
}
<Interrupt vector>
•
Set vector table
#pragma intvect INT0_int 11
Note:
Setting related to clock and setting of _set_il (numeric
value) are required in advance. See the chapter of
clock and interrupt.
Note:
For the description form of the register, see "SAMPLE I/O REGISTER FILES FOR
F
2
MC-16LX FAMILY MB90480 SERIES".
•
Port
Register name. bit name
Select INT0 port input
DDR8 .P80
•
Control INT0
Register name. bit name
Select external interrupt
detection
ELVR
LB7,LA7-LB1,LA1
LB0, LA0
•
Interrupt related 1
Set INT0 interrupt level
ICR00
Set I flag
(CCR)
•
Interrupt related 2
INT0 interrupt source
EIRR. ER0
Enable INT0 interrupt
ENIR. EN0
•
Read conversion value
Register name. bit name
Clear interrupt request flag
EIRR. ER0
•
Arbitrary processing
Summary of Contents for MB90480 Series
Page 2: ......
Page 4: ......
Page 10: ...vi ...
Page 128: ...106 CHAPTER 4 RESET ...
Page 174: ...152 CHAPTER 6 LOW POWER CONSUMPTION MODE ...
Page 198: ...176 CHAPTER 7 MODE SETTING ...
Page 220: ...198 CHAPTER 9 TIMEBASE TIMER ...
Page 238: ...216 CHAPTER 11 WATCH TIMER ...
Page 280: ...258 CHAPTER 12 16 BIT INPUT OUTPUT TIMER ...
Page 406: ...384 CHAPTER 17 8 10 BIT A D CONVERTER ...
Page 478: ...456 CHAPTER 20 CHIP SELECTION FACILITY ...
Page 494: ...472 CHAPTER 21 ADDRESS MATCH DETECTION FUNCTION ...
Page 498: ...476 CHAPTER 22 ROM MIRROR FUNCTION SELECTION MODULE ...
Page 526: ...504 CHAPTER 23 2M 3M BIT FLASH MEMORY ...
Page 536: ...514 CHAPTER 24 EXAMPLES OF MB90F481B MB90F482B MB90F488B MB90F489B SERIAL PROGRAMMING ...
Page 570: ...548 CHAPTER 25 PWC TIMER ONLY MB90485 SERIES ...
Page 688: ......