
VII - 51
Chapter 7
16-bit Timers
16-bit High Precision IGBT Output
(5)
Select the external interrupt 0 (IRQ0) input as
a IGBT trigger source with the T7ICT1-0 flag
of the TM7MD2 register.
(6)
Set the REDG0 flag of the external interrupt 0
control register (IRQ0ICR) to "1" to select the
rising edge as a the interrupt generation valid
edge.
(7)
Set the T7ICEDG flag of the TM7MD2 register
to "1" to select the IGBT trigger factor as the
specified edge of the external interrupt.
(8)
Set the interrupt level by the IRQ0LV1-0 flag of
the IRQ0ICR register.
If any interrupt request flag is already set, clear
it.
(9)
Set the IRQ0IE flag of the IRQ0ICR register to
"1" to enable the interrupt.
(10) Select fosc as a clock source by the TM7CK1-
0 flag of the TM7MD1 register. Also, select 1/2
dividing as a count clock source by the
TM7PS1-0 flag.
(11) Set the IGBT output cycle to the timer 7 preset
register 1 (TM7PR1). To be 400 Hz by dividing
10 MHz, set as;
25000 - 1 = 24999 (x'61a7')
At this time, the same value is loaded to the
timer 7 compare register 1 (TM7OC1), and the
timer 7 binary counter (TM7BC) is initialized to
x'0000'.
Setup Procedure
(5)
Select the IGBT trigger source
TM7MD2 (x'3F79')
bp1-0
: T7ICT1-0 = 00
(6)
Select the Interrupt generation valid
edge
IRQ0ICR (x'3FE2')
bp5
: REDG0
= 1
(7)
Select the IGBT trigger generation
edge
TM7MD2 (x'3F79')
bp7
: T7ICEDG = 1
(8)
Select the interruput level.
IRQ0ICR (x'3FE2')
bp7-6
: IRQ0LV1-0 = 10
(9)
Enable the interrupt.
IRQ0ICR (x'3FE2')
bp1
: IRQ0IE
= 1
(10) Select the count clock source.
TM7MD1 (x'3F78')
bp1-0
: TM7CK1-0 = 00
bp3-2
: TM7PS1-0 = 01
(11) Set the IGBT output cycle.
TM7PR1 (x'3F75',x'3F74') = x'61a7'
Description
[
Chapter 3 3-1-4. Interrupt Flag Setup ]