SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER with CLOSED CAPTION DECODER
and ON-SCREEN DISPLAY CONTROLLER
DESCRIPTION
The M37271MF-XXXSP is a single-chip microcomputer designed with
CMOS silicon gate technology. It is housed in a 52-pin shrink plastic
molded DIP.
In addition to their simple instruction sets, the ROM, RAM and I/O
addresses are placed on the same memory map to enable easy programming.
The M37271MF-XXXSP has a OSD function and a data slicer function, so it is useful for a channel selection system for TV with a closed
caption decoder. The features of the M37271EF-XXXSP and the
M37271EFSP are similar to those of the M37271MF-XXXSP except
that these chips have a built-in PROM which can be written electrically.
FEATURES
Number of basic instructions .....................................................71
•
Memory size
•
The minimum instruction execution time
•
.......................................... 0.5
Power source voltage .................................................. 5 V ± 10 %
0.5 µs (the minimum instruction execution time, at 8 MHz oscillation frequency)
8 MHz (maximum)
60 K bytes
1024 bytes
14464 bytes
1920 bytes
7-bit ✕ 1 (N-channel open-drain output structure, can be used as PWM
output pins)
1-bit ✕ 1 (CMOS input/output structure)
4-bit ✕ 1 (CMOS input/output structure, can be used as OSD output pin,
INT input pin, serial input pin)
4-bit ✕ 1 (N-channel open-drain output structure, can be used as multi-
master I2C-BUS interface)
8-bit ✕ 1 (CMOS input/output structure, can be used as A-D input pins)
2-bit ✕ 1 (CMOS input/output structure)
5-bit ✕ 1 (can be used as A-D input pins, INT input pins, external clock
input pins)
2-bit ✕ 1 (N-channel open-drain output structure when serial I/O is used,
can be used as serial I/O pins)
4-bit ✕ 1 (CMOS output structure, can be used as OSD output)
1-bit ✕ 1 (can be used as sub-clock input pin, OSD clock input pin)
1-bit ✕ 1 (CMOS output structure when LC is oscillating, can be used as
Apply voltage of 5 V ± 10 % (typical) to VCC and AVCC, and 0 V to VSS.
This is connected to VSS.
To enter the reset state, the reset input pin must be kept at a “L” for 2 µs or more (under
normal VCC conditions).
If more time is needed for the quartz-crystal oscillator to stabilize, this “L” condition should
be maintained for the required time.
This chip has an internal clock generating circuit. To control generating frequency, an
external ceramic resonator or a quartz-crystal oscillator is connected between pins XIN and
XOUT. If an external clock is used, the clock source should be connected to the XIN pin and
the XOUT pin should be left open.
Port P0 is an 8-bit I/O port with direction register allowing each I/O bit to be individually
programmed as input or output. At reset, this port is set to input mode. The output structure
of P03 is CMOS output, that of P00–P02 and P04–P07 are N-channel open-drain output.
The note out of this Table gives a full of port P0 function.
Pins P00–P02 and P04–P07 are also used as PWM output pins PWM4–PWM6 and PWM0–
PWM3 respectively. The output structure is N-channel open-drain output.
Port P1 is an 8-bit I/O port and has basically the same functions as port P0. The output
structure of P10 and P15–P17 is CMOS output, that of P11–P14 is N-channel open-drain
output.
Pins P10, P15, P16 are also used as OSD output pins OUT2, I1, I2 respectively. The output
structure is CMOS output.
Pins P11–P14 are used as SCL1, SCL2, SDA1 and SDA2 respectively, when multi-master
I2C-BUS interface is used. The output structure is N-channel open-drain output.
P17 pin is also used as serial I/O data input pin SIN.
Port P2 is an 8-bit I/O port and has basically the same functions as port P0. The output
structure is CMOS output.
Pins P24–P26 are also used as analog input pins AD3–AD1 respectively.
Ports P30 and P31 are a 2-bit I/O port and has basically the same functions as port P0. The
output structure is CMOS output.
Ports P40–P46 are a 7-bit input port.
P40 pin is also used as analog input pin AD4.
Pins P41, P44 are also used as external interrupt input INT2, INT1.
Pins P42 and P43 are also used as external clock input pins TIM2, TIM3 respectively.
P45 pin is used as serial I/O data output pin SOUT. The output structure is N-channel open-
drain output.
P46 pin is used as serial I/O synchronizing clock input/output pin SCLK. The output struc-
ture is N-channel open-drain output.
Ports P52–P55 are a 4-bit output port. The output structure is CMOS output.
Pins P52–P55 are also used as OSD output pins R, G, B, OUT1 respectively.
6
MITSUBISHI MICROCOMPUTERS
M37271MF-XXXSP
M37271EF-XXXSP, M37271EFSP
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER with CLOSED CAPTION DECODER
PIN DESCRIPTION (continued)
P63/OSC1/
XCIN,
P64/OSC2/
XCOUT
CVIN
VHOLD
RVCO
HLF
HSYNC
VSYNC
Note : As shown in the memory map (Figure 3), port P0 is accessed as a memory at address 00C016 of zero page. Port P0 has the port P0
Input port
Clock input for OSD
Clock output for OSD
Sub-clock output
Sub-clock input
I/O for data slicer
HSYNC input
VSYNC input
direction register (address 00C116 of zero page) which can be used to program each bit as an input (“0”) or an output (“1”). The pins
programmed as “1” in the direction register are output pins. When pins are programmed as “0,” they are input pins. When pins are
programmed as output pins, the output data are written into the port latch and then output. When data is read from the output pins, the
output pin level is not read but the data of the port latch is read. This allows a previously-output value to be read correctly even if the
output “L” voltage has risen, for example, because a light emitting diode was directly driven. The input pins are in the floating state, so the
values of the pins can be read. When data is written into the input pin, it is written only into the port latch, while the pin remains in the
floating state.
Input
Input
Output
Output
Input
Input
Input
Input
Input
Ports P63 and P64 are 2-bit input port.
P63 pin is also used as OSD clock input pin OSC1.
P64 pin is also used as OSD clock output pin OSC2. The output structure is CMOS output.
P64 pin is also used as sub-clock output pin XCOUT. The output structure is CMOS output.
P63 pin is also used as sub-clock input pin XCIN.
Input composite video signal through a capacitor.
Connect a capacitor between VHOLD and VSS.
Connect a resistor between RVCO and VSS.
Connect a filter using of a capacitor and a resistor between HLF and VSS.
This is a horizontal synchronizing signal input for OSD.
This is a vertical synchronizing signal input for OSD.
and ON-SCREEN DISPLAY CONTROLLER
7
MITSUBISHI MICROCOMPUTERS
M37271MF-XXXSP
M37271EF-XXXSP, M37271EFSP
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER with CLOSED CAPTION DECODER
and ON-SCREEN DISPLAY CONTROLLER
FUNCTIONAL DESCRIPTION
Central Processing Unit (CPU)
The M37271MF-XXXSP uses the standard 740 family instruction set.
Refer to the table of 740 family addressing modes and machine instructions or the SERIES 740 < Software > User’s Manual for details
on the instruction set.
Machine-resident 740 family instructions are as follows:
The FST, SLW instruction cannot be used.
The MUL, DIV, WIT and STP instruction can be used.
70
1100
CPU mode register
(CPUM (CM) : address 00FB
Processor mode bits
b1 b0
0 0 : Single-chip mode
0 1 :
1 0 :
1 1 :
Stack page selection bit (Note)
0 : Zero page
1 : 1 page
Fix these bits to “1.”
COUT drivability selection bit
X
0 : Low drive
1 : High drive
Main colock (X
0 : Oscillating
1 : Stopped
Internal system clock selection bit
0 : X
1 : X
CPU Mode Register
The CPU mode register contains the stack page selection bit and
internal system clock selection bit. The CPU mode register is allocated at address 00FB16.
Note: Please beware of this bit when programming because it
Fig. 1. Structure of CPU mode register
is set to “1” after the reset release.
8
MITSUBISHI MICROCOMPUTERS
M37271MF-XXXSP
M37271EF-XXXSP, M37271EFSP
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER with CLOSED CAPTION DECODER
and ON-SCREEN DISPLAY CONTROLLER
MEMORY
Special Function Register (SFR) Area
The special function register (SFR) area in the zero page contains
control registers such as I/O ports and timers.
RAM
RAM is used for data storage and for stack area of subroutine calls
and interrupts.
ROM
ROM is used for storing user programs as well as the interrupt vector
area.
RAM for OSD
RAM for display is used for specifying the character codes and colors to display.
ROM for OSD
ROM for display is used for storing character data.
0000
16
Zero page
RAM
(1024 bytes)
RAM for OSD (Note)
(1920 bytes)
00C0
00FF
0200
023F
0300
053F
0800
0FFF
1000
16
16
16
16
16
16
16
16
16
SFR1 area
SFR2 area
Not used
Not used
Interrupt Vector Area
The interrupt vector area contains reset and interrupt vectors.
Zero Page
The 256 bytes from addresses 000016 to 00FF16 are called the zero
page area. The internal RAM and the special function registers (SFR)
are allocated to this area.
The zero page addressing mode can be used to specify memory and
register addresses in the zero page area. Access to this area with
only 2 bytes is possible in the zero page addressing mode.
Special Page
The 256 bytes from addresses FF0016 to FFFF16 are called the special page area. The special page addressing mode can be used to
specify memory addresses in the special page area. Access to this
area with only 2 bytes is possible in the special page addressing
mode.
10000
ROM for OSD
(14464 bytes)
10800
1567F
18000
16
16
16
16
Not used
Not used
ROM
(60 K bytes)
Fig. 2. Memory map
FF00
FFDE
FFFF
16
16
Interrupt vector area
16
Special page
1E43F
1FFFF
16
16
Not used
9
MITSUBISHI MICROCOMPUTERS
M37271MF-XXXSP
M37271EF-XXXSP, M37271EFSP
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER with CLOSED CAPTION DECODER
and ON-SCREEN DISPLAY CONTROLLER
■SFR1 area (addresses C016 to DF16)
: Nothing is allocated
: Fix this bit to “0” ( do not write “1”)
: “0” immediately after reset
0
?
: undefined immediately after reset
Address
C0
16
C1
16
C2
16
C3
16
C4
16
C5
16
C6
16
C7
16
C8
16
C9
16
CA
16
CB
16
CC
16
CD
16
CE
16
CF
16
D0
16
D1
16
D2
16
D3
16
D4
16
D5
16
D6
16
D7
16
D8
16
D9
16
DA
16
DB
16
DC
16
DD
16
DE
16
DF
16
Register
Port P0 (P0)
Port P0 direction register (D0)
Port P1 (P1)
Port P1 direction register (D1)
Port P2 (P2)
Port P2 direction register (D2)
Port P3 (P3)
Port P3 direction register (D3)
Port P4 (P4)
Port P4 direction register (D4)
Port P5 (P5)
OSD port control register (PF)
Port P6 (P6)
OSD control register (OC)
Horizontal position register (HP)
Block control register 1 (BC1)
Block control register 2 (BC2)
Block control register 3 (BC3)
Block control register 4 (BC4)
Block control register 5 (BC5)
Block control register 6 (BC6)
Block control register 7 (BC7)
Block control register 8 (BC8)
Block control register 9 (BC9)
Block control register 10 (BC10)
Block control register 11 (BC11)
Block control register 12 (BC12)
Block control register 13 (BC13)
Block control register 14 (BC14)
Block control register 15 (BC15)
Block control register 16 (BC16)
Fig. 6. Memory map of special function register 2 (SFR2) (2)
13
MITSUBISHI MICROCOMPUTERS
M37271MF-XXXSP
M37271EF-XXXSP, M37271EFSP
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER with CLOSED CAPTION DECODER
and ON-SCREEN DISPLAY CONTROLLER
: Nothing is allocated
1
: “1” immediately after reset
?
: undefined immediately after reset
Register
b7
Processor status register (PS)
Program counter (PCH)
Program counter (PCL)
Fig. 7. Internal state of processor status register and program counter at reset
Bit allocationState immediately after reset
IZCDBTVN???????
b0
b7
Contents of address FFFF
Contents of address FFFE
b0
1
16
16
14
MITSUBISHI MICROCOMPUTERS
M37271MF-XXXSP
M37271EF-XXXSP, M37271EFSP
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER with CLOSED CAPTION DECODER
and ON-SCREEN DISPLAY CONTROLLER
INTERRUPTS
Interrupts can be caused by 18 different sources consisting of 4 external, 12 internal, 1 software, and reset. Interrupts are vectored interrupts with priorities shown in Table 1. Reset is also included in the
table because its operation is similar to an interrupt.
When an interrupt is accepted,
(1) The contents of the program counter and processor status
register are automatically stored into the stack.
(2) The interrupt disable flag I is set to “1” and the corresponding
interrupt request bit is set to “0.”
(3) The jump destination address stored in the vector address enters
the program counter.
Other interrupts are disabled when the interrupt disable flag is set to
“1.”
All interrupts except the BRK instruction interrupt have an interrupt
request bit and an interrupt enable bit. The interrupt request bits are
in interrupt request registers 1 and 2 and the interrupt enable bits are
in interrupt control registers 1 and 2. Figure 8 shows the structure of
the interrupt-related registers.
Interrupts other than the BRK instruction interrupt and reset are accepted when the interrupt enable bit is “1,” interrupt request bit is “1,”
and the interrupt disable flag is “0.” The interrupt request bit can be
set to “0” by a program, but not set to “1.” The interrupt enable bit can
be set to “0” and “1” by a program.
Reset is treated as a non-maskable interrupt with the highest priority.
Figure 9 shows interrupt control.
Interrupt Causes
(1) VSYNC and OSD interrupts
The VSYNC interrupt is an interrupt request synchronized with
the vertical sync signal.
The OSD interrupt occurs after character block display to the
CRT is completed.
(2) INT1, INT2, INT3 interrupts
With an external interrupt input, the system detects that the level
of a pin changes from “L” to “H” or from “H” to “L,” and generates
an interrupt request. The input active edge can be selected by
bits 3, 4 and 6 of the interrupt interval determination control register (address 021216) : when this bit is “0,” a change from “L” to
“H” is detected; when it is “1,” a change from “H” to “L” is detected. Note that all bits are cleared to “0” at reset.
(3) Timer 1, 2, 3 and 4 interrupts
An interrupt is generated by an overflow of timer 1, 2, 3 or 4.
(4) Serial I/O interrupt
This is an interrupt request from the clock synchronous serial
I/O function.
(5) f(XIN)/4096 interrupt
This interrupt occurs regularly with a f(XIN)/4096 period. Set bit 0
of the PWM mode register 1 to “0.”
(6) Data slicer interrupt
An interrupt occurs when slicing data is completed.
(7) Multi-master I2C-BUS interface interrupt
This is an interrupt request related to the multi-master I2C-BUS
interface.
(8) A-D conversion interrupt
An interrupt occurs at the completion of A-D conversion. Since
A-D conversion interrupt and the INT3 interrupt share the same
vector, an interrupt source is selected by bit 7 of the interrupt
interval determination control register (address 021216).
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER with CLOSED CAPTION DECODER
and ON-SCREEN DISPLAY CONTROLLER
(9)Timer 5 · 6 interrupt
An interrupt is generated by an overflow of timer 5 or 6. Their
priorities are same, and can be switched by software.
(10)BRK instruction interrupt
This software interrupt has the least significant priority. It does
not have a corresponding interrupt enable bit, and it is not affected by the interrupt disable flag I (non-maskable).
Interrupt request bit
Interrupt enable bit
Interrupt disable flag I
BRK instruction
Reset
Interrupt
request
Fig. 9. Interrupt control
7
0
Interrupt request register 1
(IREQ1: address 00FC
Timer 1 interrupt request bit
Timer 2 interrupt request bit
Timer 3 interrupt request bit
Timer 4 interrupt request bit
OSD interrupt request bit
V
SYNC
interrupt request bit
A-D conversion ⋅ INT3 interrupt
request bit
7
16
)
0
0
Interrupt request register 2
(IREQ2: address 00FD
16
)
INT1 interrupt request bit
Data slicer interrupt request bit
Serial I/O interrupt request bit
f(XIN)/4096 interrupt request bit
INT2 interrupt request bit
Multi-master I2C-BUS
interface interrupt request bit
Timer 5 ⋅ 6 interrupt request bit
Interrupt control register 1
( ICON1: address 00FE
Timer 1 interrupt enable bit
Timer 2 interrupt enable bit
Timer 3 interrupt enable bit
Timer 4 interrupt enable bit
OSD interrupt enable bit
V
SYNC
interrupt enable bit
A-D conversion ⋅ INT3 interrupt
request bit
Fig. 8. Structure of interrupt-related registers
16
7
16
)
0 : Interrupt disabled
1 : Interrupt enabled
0
Interrupt control register 2
( ICON2 : address 00FF
INT1 interrupt enable bit
Data slicer interrupt enable bit
Serial I/O interrupt enable bit
f(XIN)/4096 interrupt enable bit
INT2 interrupt enable bit
2
Multi-master I
C-BUS
interface enable bit
Timer 5 ⋅ 6 interrupt enable bit
Timer 5 ⋅ 6 interrupt switch bit
0 : Timer 5
1 : Timer 6
16
)
MITSUBISHI MICROCOMPUTERS
M37271MF-XXXSP
M37271EF-XXXSP, M37271EFSP
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER with CLOSED CAPTION DECODER
and ON-SCREEN DISPLAY CONTROLLER
TIMERS
The M37271MF-XXXSP has 6 timers: timer 1, timer 2, timer 3,
timer 4, timer 5, and timer 6. All timers are 8-bit timers with the 8-bit
timer latch. The timer block diagram is shown in Figure 11.
All of the timers count down and their divide ratio is 1/(n+1), where n
is the value of timer latch. The value is set to a timer at the same time
by writing a count value to the corresponding timer latch (addresses
00F016 to 00F316 : timers 1 to 4, addresses 020C16 and 020D16 :
timers 5 and 6).
The count value is decremented by 1. The timer interrupt request bit
is set to “1” by a timer overflow at the next count pulse after the count
value reaches “0016”.
(1) Timer 1
Timer 1 can select one of the following count sources:
f(XIN)/16 or f(XCIN)/16
•
f(XIN)/4096 or f(XCIN)/4096
•
External clock from the P42/TIM2 pin
•
The count source of timer 1 is selected by setting bits 5 and 0 of the
timer mode register 1 (address 00F416). Either f(XIN) or f(XCIN) is
selected by bit 7 of the CPU mode register.
Timer 1 interrupt request occurs at timer 1 overflow.
(2) Timer 2
Timer 2 can select one of the following count sources:
f(XIN)/16 or f(XCIN)/16
•
Timer 1 overflow signal
•
External clock from the P42/TIM2 pin
•
The count source of timer 2 is selected by setting bits 4 and 1 of the
timer mode register 1 (address 00F416). Either f(XIN) or f(XCIN) is
selected by bit 7 of the CPU mode register. When timer 1 overflow
signal is a count source for the timer 2, the timer 1 functions as an 8bit prescaler.
Timer 2 interrupt request occurs at timer 2 overflow.
(3) Timer 3
Timer 3 can select one of the following count sources:
f(XIN)/16 or f(XCIN)/16
•
f(XCIN)
•
External clock from the P43/TIM3 pin
•
The count source of timer 3 is selected by setting bit 0 of the timer
mode register 2 (address 00F516) and bit 6 at address 00C716. Either f(XIN) or f(XCIN) is selected by bit 7 of the CPU mode register.
Timer 3 interrupt request occurs at timer 3 overflow.
(5) Timer 5
Timer 5 can select one of the following count sources:
f(XIN)/16 or f(XCIN)/16
•
Timer 2 overflow signal
•
Timer 4 overflow signal
•
The count source of timer 3 is selected by setting bit 6 of the timer
mode register 1 (address 00F416) and bit 7 of the timer mode register 2 (address 00F516). Either f(XIN) or f(XCIN) is selected by bit 7 of
the CPU mode register.
Timer 5 interrupt request occurs at timer 5 overflow.
(6) Timer 6
Timer 6 can select one of the following count sources:
f(XIN)/16 or f(XCIN)/16
•
Timer 5 overflow signal
•
The count source of timer 6 is selected by setting bit 7 of the timer
mode register 1 (address 00F416). Either f(XIN) or f(XCIN) is selected
by bit 7 of the CPU mode register. When timer 5 overflow signal is a
count source for the timer 6, the timer 5 functions as an 8-bit prescaler.
Timer 6 interrupt request occurs at timer 6 overflow.
At reset, timers 3 and 4 are connected by hardware and “FF16” is
automatically set in timer 3; “0716” in timer 4. The f(XIN) ✽ /16 is selected as the timer 3 count source. The internal reset is released by
timer 4 overflow at these state, the internal clock is connected.
At execution of the STP instruction, timers 3 and 4 are connected by
hardware and “FF16” is automatically set in timer 3; “0716” in timer 4.
However, the f(XIN) ✽ /16 is not selected as the timer 3 count source.
So set both bit 0 of the timer mode register 2 (address 00F516) and
bit 6 at address 00C716 to “0” before the execution of the STP instruction (f(XIN) ✽ /16 is selected as the timer 3 count source). The
internal STP state is released by timer 4 overflow at these state, the
internal clock is connected.
Because of this, the program starts with the stable clock.
✽ : When bit 7 of the CPU mode register (CM7) is “1,” f(XIN) be-
comes f(XCIN).
The structure of timer-related registers is shown in Figure 10.
(4) Timer 4
Timer 4 can select one of the following count sources:
f(XIN)/16 or f(XCIN)/16
•
f(XIN)/2 or f(XCIN)/2
•
f(XCIN)
•
The count source of timer 3 is selected by setting bits 4 and 1 of the
timer mode register 2 (address 00F516). Either f(XIN) or f(XCIN) is
selected by bit 7 of the CPU mode register. When timer 3 overflow
signal is a count source for the timer 4, the timer 3 functions as an 8bit prescaler.
Timer 4 interrupt request occurs at timer 4 overflow.
17
70
Timer mode register 1
(TMR1 : address 00F416)
Timer 1 count source selection bit 1
0 : f(X
IN
)/16 or f(X
CIN
)/16 (Note)
1 : Count source selected by bit 5
of TMR1
Timer 2 count source selection bit 1
0 : Count source selected by bit 4 of
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER with CLOSED CAPTION DECODER
and ON-SCREEN DISPLAY CONTROLLER
Fig. 10. Structure of timer-related registers
18
MITSUBISHI MICROCOMPUTERS
M37271MF-XXXSP
M37271EF-XXXSP, M37271EFSP
CIN
X
XIN
P42/TIM2
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER with CLOSED CAPTION DECODER
CM7
1/2
TMR15
1/8
TMR10
TMR12
TMR14
Timer 2 latch (8)
TMR11
TMR13
1/4096
and ON-SCREEN DISPLAY CONTROLLER
Data bus
8
Timer 1 latch (8)
8
Timer 1 (8)
8
8
8
Timer 2 (8)
8
Timer 1
interrupt request
Timer 2
interrupt request
P4
3/TIM3
Selection gate : Connected to
TMR1 : Timer mode register 1
TMR2 : Timer mode register 2
TM3EL : Timer 3 count source
switch bit (address 00C7
CM : CPU mode register
TMR21
black colored
side at reset
16)
TMR20
TMR24
TMR27
TM3EL
TMR22
TMR21
TMR23
TMR16
TMR25
Timer 3 latch (8)
8
Timer 3 (8)
Timer 4 latch (8)
8
Timer 4 (8)
Timer 5 latch (8)
8
Timer 5 (8)
8
FF16
8
8
0716
8
8
8
8
Reset
STP instruction
Timer 3
interrupt request
Timer 4
interrupt request
Timer 5
interrupt request
Notes 1: “H” pulse width of external clock inputs TIM2 and TIM3 needs 4 machine cycles or more.
2: When the external clock source is selected, timers 1, 2, and 3 are counted at a rising edge of input signal.
3: In the stop mode or the wait mode, external clock inputs TIM2 and TIM3 cannot be used.
Fig. 11. Timer block diagram
TMR17
TMR26
Timer 6 latch (8)
8
Timer 6 (8)
Timer 6
interrupt request
8
19
MITSUBISHI MICROCOMPUTERS
M37271MF-XXXSP
M37271EF-XXXSP, M37271EFSP
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER with CLOSED CAPTION DECODER
and ON-SCREEN DISPLAY CONTROLLER
SERIAL I/O
The M37271MF-XXXSP has a built-in serial I/O which can either transmit or receive 8-bit data in serial in the clock synchronous mode.
The serial I/O block diagram is shown in Figure 12. The synchronizing clock I/O pin (SCLK), and data output pin (SOUT) also function as
port P4, data input pin (SIN) also functions as port P1.
Bit 2 of the serial I/O mode register (address 021316) selects whether
the synchronizing clock is supplied internally or externally (from the
P46/SCLK pin). When an internal clock is selected, bits 1 and 0 select
whether f(XIN) is divided by 8, 16, 32, or 64. To use P45/SOUT and
P46/SCLK pins for serial I/O, set the corresponding bits of the port P4
direction register (address 00C916) to “0.” To use P17/SIN pin for
serial I/O, set the corresponding bit of the port P1 direction register
(address 00C316) to “0.”
X
CIN
1/2
X
P46/S
CLK
IN
1/2
CM7
1/2
Synchronization
circuit
SM2
S
Serial I/O counter (8)
The operation of the serial I/O function is described below. The function of the serial I/O differs depending on the clock source; external
clock or internal clock.
Data bus
Frequency divider
1/2
1/81/41/16
SM1
SM0
Selection gate: Connect to
black colored
side at reset.
CM : CPU mode register
SM : Serial I/O mode register
Serial I/O
interrupt request
P45/S
OUT
: LSB
MSB
SM5
(Note)
P17/S
IN
Serial I/O shift register (8)
(Address 021416)
8
Note : When the data is set in the serial I/O register (address 021416), the register functions as the serial I/O shift register.
Fig. 12. Serial I/O block diagram
20
MITSUBISHI MICROCOMPUTERS
M37271MF-XXXSP
M37271EF-XXXSP, M37271EFSP
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER with CLOSED CAPTION DECODER
Internal clock—the serial I/O counter is set to “7” during write cycle
into the serial I/O register (address 021416), and transfer clock goes
“H” forcibly. At each falling edge of the transfer clock after the write
cycle, serial data is output from the SOUT pin. Transfer direction can
be selected by bit 5 of the serial I/O mode register. At each rising
edge of the transfer clock, data is input from the SIN pin and data in
the serial I/O register is shifted 1 bit.
After the transfer clock has counted 8 times, the serial I/O counter
becomes “0” and the transfer clock stops at “H.” At this time the interrupt request bit is set to “1.”
External clock—when an external clock is selected as the clock
source, the interrupt request is set to “1” after the transfer clock has
counted 8 times. However, transfer operation does not stop, so control the clock externally. Use the external clock of 500kHz or less
with a duty cycle of 50%.
The serial I/O timing is shown in Figure 13. When using an external
clock for transfer, the external clock must be held at “H” for initializing
the serial I/O counter. When switching between an internal clock and
an external clock, do not switch during transfer. Also, be sure to initialize the serial I/O counter after switching.
Notes 1: On programming, note that the serial I/O counter is set by
writing to the serial I/O register with the bit managing instructions as SEB and CLB instructions.
2: When an external clock is used as the synchronizing clock,
write transmit data to the serial I/O register at “H” of the
transfer clock input level.
7
0
and ON-SCREEN DISPLAY CONTROLLER
0
0
Serial I/O mode register
(SM : address 0213
Internal synchronizing clock
selection bits
b1 b0
0 0 : f(X
IN)/8 or f(XCIN)/8
0 1 : f(XIN)/16 or f(XCIN)/16
1 0 : f(X
IN)/32 or f(XCIN)/32
1 1 : f(XIN)/64 or f(XCIN)/64
Synchronizing clock selection bit
0 : External clock
1 : Internal clock
Port function selection bit
1, P13 functions as port
0 : P1
1 : SCL1, SDA1
Port function selection bit
0 : P12, P14 functions as port
1 : SCL2, SDA2
Transfer direction selection bit
0 : LSB first
1 : MSB first
Fix these bits to “0”
16)
Synchroninzing clock
Transfer clock
Serial I/O register
write signal
Serial I/O output
S
Serial I/O input
Note : When an internal clock is selected, the S
S
OUT
IN
Fig. 13. Serial I/O timing (for LSB first)
Fig. 14. Structure of serial I/O mode register
D
0
D
1
D
2
D
3
D
4
D
OUT
pin is at high-impedance after transfer is completed.
(Note)
5
D
6
D
7
Interrupt request bit is set to “1”
21
MITSUBISHI MICROCOMPUTERS
M37271MF-XXXSP
M37271EF-XXXSP, M37271EFSP
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER with CLOSED CAPTION DECODER
and ON-SCREEN DISPLAY CONTROLLER
PWM OUTPUT FUNCTION
The M37271MF-XXXSP is equipped with seven 8-bit PWMs (PWM0–
PWM6). PWM0–PWM6 have the same circuit structure and an 8-bit
resolution with minimum resolution bit width of 4 µs (for f(XIN) = 8
MHz) and repeat period of 1024 µs.
Figure 15 shows the PWM block diagram. The PWM timing generating circuit applies individual control signals to PWM0–PWM6 using
f(XIN) divided by 2 as a reference signal.
(1) Data Setting
When outputting PWM0–PWM6, set 8-bit output data in the PWMi
register (i means 0 to 6; addresses 020016 to 020616).
(2) Transmitting Data from Register to PWM circuit
Data transfer from the 8-bit PWM register to 8-bit PWM circuit is
executed at writing data to the register.
The signal output from the 8-bit PWM output pin corresponds to the
contents of this register.
(3) Operating of 8-bit PWM
The following is the explanation about PWM operation.
At first, set the bit 0 of PWM mode register 1 (address 020A16) to “0”
(at reset, bit 0 is already set to “0” automatically), so that the PWM
count source is supplied.
PWM0–PWM3 are also used as pins P04–P07, PWM4–PWM6 are
also used as pins P00–P02, respectively. Set the corresponding bits
of the port P0 direction register to “1” (output mode). And select each
output polarity by bit 3 of the PWM mode register 1 (address 020A16).
Then, set bits 7 to 0 of the PWM output control register 2 to “1”
(PWM output).
The PWM waveform is output from the PWM output pins by setting
these registers.
Figure 16 shows the 8-bit PWM timing. One cycle (T) is composed
of 256 (28) segments. The 8 kinds of pulses relative to the weight of
each bit (bits 0 to 7) are output inside the circuit during 1 cycle. Refer
to Figure 16 (a). The 8-bit PWM outputs waveform which is the logical sum (OR) of pulses corresponding to the contents of bits 0 to 7 of
the 8-bit PWM register. Several examples are shown in Figure 16
(b). 256 kinds of output (“H” level area: 0/256 to 255/256) are selected by changing the contents of the PWM register. A length of
entirely “H” output cannot be output, i.e. 256/256.
(4) Output after Reset
At reset, the output of ports P00–P02 and P04–P07 is in the highimpedance state, port P50 outputs “L,” and the contents of the PWM
register and the PWM circuit are undefined. Note that after reset, the
PWM output is undefined until setting the PWM register.
22
MITSUBISHI MICROCOMPUTERS
M37271MF-XXXSP
M37271EF-XXXSP, M37271EFSP
Data bus
X
PWM0 register
(Address 0200
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER with CLOSED CAPTION DECODER
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER with CLOSED CAPTION DECODER
and ON-SCREEN DISPLAY CONTROLLER
A-D CONVERTER
(1)A-D Conversion Register (AD)
A-D conversion reigister is a read-only register that stores the result
of an A-D conversion. This register should not be read during A-D
conversion.
(2)A-D Control Register (ADCON)
The A-D control register controls A-D conversion. Bits 1 and 0 of this
register select analog input pins. When these pins are not used as
anlog input pins, they are used as ordinary I/O pins. Bit 3 is the A-D
conversion completion bit, A-D conversion is started by writing “0” to
this bit. The value of this bit remains at “0” during an A-D conversion,
then changes to “1” when the A-D conversion is completed.
Bit 4 controls connection between the resistor ladder and VCC. When
not using the A-D converter, the resistor ladder can be cut off from
the internal VCC by setting this bit to “0.” This can realize the lowpower dissipation.
(3)Comparison Voltage Generator (Resistor
Ladder)
The voltage generator divides the voltage between VSS and VCC by
256, and outputs the divided voltages to the comparator as the reference voltage Vref.
(4)Channel Selector
The channel selector connects an analog input pin selected by bits 1
and 0 of the A-D control register to the comparator.
(5)Comparator and Control Circuit
The conversion result of the analog input voltage and the reference
voltage “Vref” is stored in the A-D conversion register. The A-D conversion completion bit and A-D conversion interrupt request bit are
set to “1” at the completion of A-D conversion.
A-D conversion completion bit
0 : Conversion in purogress
1 : Conversion completed
VCC connection selection bit
0 : OFF
1 : ON
Fix this bit to “0.”
A-D control register
(address 00EF
P26/AD1
5
/AD2
P2
4
/AD3
P2
P4
0
/AD4
Fig. 19. A-D comparator block diagram
16
)
Comparator
Channel selector
Data bus
b7b0
2
A-D control circuit
A-D conversion register
Switch tree
Resistor ladder
VSSV
8
(address 00EE16)
CC
A-D conversion
interrupt request
26
MITSUBISHI MICROCOMPUTERS
M37271MF-XXXSP
M37271EF-XXXSP, M37271EFSP
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER with CLOSED CAPTION DECODER
and ON-SCREEN DISPLAY CONTROLLER
(6) Conversion Method
1Set bit 7 of the interrupt interval determination control register (ad-
dress 021216) to “1” to generate an interrupt request at completion of A-D conversion.
2Set the A-D conversion · INT3 interrupt request bit to “0” (even
when A-D conversion is started, the A-D conversion · INT3 interrupt bit is not set to “0” automatically).
3When using A-D conversion interrupt, enable interrupts by setting
A-D conversion · INT3 interrupt request bit to “1” and setting the
interrupt disable flag to “0.”
4Set the VCC connection selection bit to “1” to connect VCC to the
resistor ladder.
5Select analog input pins by setting the analog input selection bit of
the A-D control register.
6Set the A-D conversion completion bit to “0.” This write operation
starts the A-D conversion. Do not read the A-D conversion register during the A-D conversion.
7Verify the completion of the conversion by the state (“1”) of the
A-D conversion completion bit, that (“1”) of A-D conversion · INT3
interrupt bit, or the occurrence of an A-D conversion interrupt.
8Read the A-D conversion register to obtain the conversion results.
Note : When the ladder resistor is disconnect from VCC, set the VCC
connection selection bit to “0” between steps 7and 8.
(7) Internal Operation
At the time when the A-D conversion starts, the following operations
are automatically performed.
1The A-D conversion register is set to “0016.”
2The most significant bit of the A-D conversion register becomes
“1, ” and the comparison voltage “Vref” is input to the comparator.
At this point, Vref is compared with the analog input voltage “VIN .”
3Bit 7 is determined by the comparison result as follows.
When Vref < VIN : bit 7 holds “1”
When Vref > VIN : bit 7 becomes “0”
With the above operations, the analog value is converted into a digital value. The A-D conversion terminates in a maximum 50 machine
cycles (12.5 µs at f(XIN) = 8 MHz) after it starts, and the conversion
result is stored in the A-D conversion register.
An A-D conversion interrupt request occurs at the same time of A-D
conversion completion, the A-D conversion · INT3 interrupt request
bit becomes “1.” The A-D conversion completion bit also becomes
“1.”
Table 2. Expression for Vref and VREF
A-D conversion register contents “n”
(decimal notation)
00
Note: VREF indicates the voltage of internal VCC.
VREF
256
Vref (V)
✕ (n – 0.5)1 to 255
A-D conversion start
1st comparison start
2nd comparison start
3rd comparison start
Contents of A-D conversion register
00000000
1
0000000
1000000
1
12
100000
Reference voltage (V
V
REF
–
2
V
REF
±
2
V
REF
±
2
V
REF
8th comparison start
A-D conversion completion
(8th comparison completion)
Fig. 20. Changes in A-D conversion register and comparison voltage during A-D conversion
1234567
1
12345678
Digital value corresponding to
analog input voltage.
m
: Value determined by mth (m = 1 to 8) result
±±±
2
V
REF
512
V
REF
4
V
REF
4
V
REF
4
.......
ref
)
[V]
0
V
REF
–
512
V
REF
±
8
V
REF
8
REF
V
±
256
V
REF
–
512
.....
REF
V
–
512
27
MITSUBISHI MICROCOMPUTERS
M37271MF-XXXSP
M37271EF-XXXSP, M37271EFSP
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER with CLOSED CAPTION DECODER
and ON-SCREEN DISPLAY CONTROLLER
(8) Definition of A-D Conversion Accuracy
The definition of A-D conversion accuracy is described below.
1Relative accuracy
· Zero transition error (V0T)
The deviation of the input voltage at which A-D conversion output
data changes from “0” to “1,” from the corresponding ideal A-D
conversion characteristics between 0 and VREF.
V0T =
· Full-scale transition error (VFST)
The deviation of the input voltage at which A-D conversion output
data changes from “255” to “254,” from the corresponding ideal AD conversion characteristics between 0 and VREF.
VFST =
· Non-linearity error
The deviation of the actual A-D conversion characteristics, from the
ideal A-D conversion characteristics between V0 and V254.
Non-linearity error =
(V0 –1/2 ✕ VREF/256)
1LSB
(VREF – 3/2 ✕ VREF/256) – V254
1LSB
Vn – (1LSB ✕ n + V0)
1LSB
[LSB]
[LSB]
[LSB]
· Differential non-linearity error
The deviation of the input voltage required to change output data
by “1,” from the corresponding ideal A-D conversion characteristics between 0 and VREF.
(Vn+1 – Vn) – 1LSB
1LSB
2Absolute accuracy
· Absolute accuracy error
The deviation of the actual A-D conversion characteristics, from the
ideal A-D conversion characteristics between 0 and VREF.
Absolute accuracy error =
Note: The analog input voltage “Vn” at which A-D conversion output
data changes from “n” to “n + 1” (n ; 0 to 254) is as follows
(refer to Figure 18).
1LSB with respect to relative accuracy =
1LSBA with respect to absolute accuracy =
Vn – 1LSBA ✕ (n+1/2)
1LSBA
V254 – V0
254
VREF
256
[LSB]Differential non-linearity error =
[LSB]
[V]
[V]
Output
data
255
254
n+1
n
Actual A-D
conversion
characteristics
1
2
0
Full-scale transition error
(V
FST
)
Differential nonlinearity error
A
1LSB
A
LSB
1LSB
V
0
V
1
Zero transition error (V0T)
1LSB
Non-linearity error
Absolute accuracy
Ideal A-D conversion characteristics
between V
VnV
0
and V
n+1
254
V
254
3
LSB
A
2
Analog input
V
REF
voltage (V)
Fig. 21. Definition of A-D conversion precision
28
MITSUBISHI MICROCOMPUTERS
M37271MF-XXXSP
M37271EF-XXXSP, M37271EFSP
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER with CLOSED CAPTION DECODER
and ON-SCREEN DISPLAY CONTROLLER
DATA SLICER
The M37271MF-XXXSP includes the data slicer function for the
closed caption decoder (referred to as the CCD). This function takes
out the caption data superimposed in the vertical blanking interval of
a composite video signal. A composite video signal which makes
the sync chip’s polarity negative is input to the CVIN pin.
Composite
video
signal
Hundred of kiloohms
to 1 MΩ
V
HOLD
1000 pF
External circuit
Note: Make the length of wiring which is
connected to V
and CV
so that a leakage current may
not be generated when mounting
a resistor or a capacitor on each
pin.
HOLD, HLF, RVCO
IN pin as short as possible
Sync slice
(address
0.1µF
Low-pass
filter
Reference
voltage
generating
circuit
register 3
00E316)
0000101
470Ω
IN
CV
Clamping
circuit
Sync slice
circuit
+
–
Comparator
Data slicer control
register 3
(address 0210
Clock run-in detect
register 3
(address 0208
Clock run-in
register 3
(address 0209
Data register 2
(address 00E5
16)
16)
16)
16)
560 pF
Data register 4
(address 00ED
1µF
H
When the data slicer function is not used, the data slicer circuit can
be cut off by setting bit 0 of the data slicer control register 1 (address
00EA16) to “0.” Also, the timing signal generating circuit can be cut
off by setting bit 0 of data slicer control register 2 (address 00EB16)
to “0.” These settings can realize the low-power dissipation.
1 kΩ
200 pF
SYNC
Synchronizing
signal counter
Synchronizing
separation
circuit
Timing signal
generating
circuit
Clock run-in
determination
circuit
Data slice line
specification
circuit
Start bit detecting
circuit
Data clock
generating circuit
16-bit shift register
high-orderlow-order
Data register 1
(address 00E4
16)
15 kΩ
HLFRVCO
16)
Interrupt request
generating circuit
Data register 3
(address 00EC
Sync pulse counter
register
16
(address 020F
)
Clock run-in register 2
16
(address 00E7
)
01 0111
Data slicer control register 2
16
(address 00EB
00
)
0
Data slicer control register 1
16
(address 00EA
)
000
Data slicer ON/OFF
Window register
(address 00E2
16
)
00
0101
Clock run-in register 1
(address 00E6
16
)
100
Caption position register
(address 00E0
16
)
Start bit position register
16
(address 00E1
)
Clock run-in detect register 1
(address 00E8
16
)
Clock run-in detect register 2
(address 00E9
16
)
Data slicer
interrupt
request
16)
Data bus
Fig. 22. Data slicer block diagram
29
MITSUBISHI MICROCOMPUTERS
M37271MF-XXXSP
M37271EF-XXXSP, M37271EFSP
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER with CLOSED CAPTION DECODER
and ON-SCREEN DISPLAY CONTROLLER
Figure 23 shows the structure of the data slicer control registers.
000
b2 b1
0 0 F2
0 1 F1
1 0 F1 and F2
1 1 F1 and F2
07
Data slicer control register 1
16
(DSC1: address 00EA
)
Data slicer control bit
0: Data slicer stopped
1: Data slicer operating
Field to be sliced data selection bit
Field of main data
slice line
Field for setting
reference voltage
F2
F1
F2
F1
Fix these bits to “0.”
Field determination flag
sep
0 :
H
sep
V
sep
H
1 :
sep
V
000
07
Data slicer control register 2
(DSC2: address 00EB
16
)
Timing signal generating circuit
control bit
0: Stopped
1: Operating
Reference clock source selection
bit
0: Video signal
SYNC
1: H
signal
Test bit: read-only
Fix these bits to “0.”
V-pulse shape determination flag
0: Match
1: Mismatch
Fix this bit to “0.”
Fix this bit to “0.”
Data latch completion flag for caption
data in main data slice line
0: Data is not yet latched
1: Data is latched
Definition of fields 1 (F1) and 2 (F2)
sep
H
F1 :
SYNC
V
sep
V
sep
H
F2 :
SYNC
V
sep
V
Fig. 23. Structure of data slicer control registers
Test bit: read-only
07
Data slicer control register 3
(DSC3: address 0210
Line selection bit for slice voltage
0: Main data slice line
1: Sub-data slice line
Field to be sliced data selection bit
Field of sub-data
b2 b1
slice line
0 0 F2
0 1 F1
1 0 F1 and F2
1 1 F1 and F2
Setting bit of sub-data slice line
16
)
Field for setting
reference voltage
F2
F1
F2
F1
30
Loading...
+ 67 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.