The 38C3 group is the 8-bit microcomputer based on the 740 family
core technology.
The 38C3 group has a LCD drive control circuit, a 10-channel A-D
converter, and a Serial I/O as additional functions.
The various microcomputers in the 38C3 group include variations of
internal memory size and packaging. For details, refer to the section
on part numbering.
For details on availability of microcomputers in the 38C3 group, refer
to the section on group expansion.
Products under development or planning : the development schedule and specification may be revised without notice.
Planning products may be stopped the development.
Mask ROM version
One Time PROM version
One Time PROM version (blank)
EPROM version
Mask ROM version
One Time PROM version
One Time PROM version (blank)
EPROM version
1024
As of April 1998
Remarks
6
FUNCTIONAL DESCRIPTION
CENTRAL PROCESSING UNIT (CPU)
The 38C3 group uses the standard 740 family instruction set. Refer
to the table of 740 family addressing modes and machine instructions or the 740 Family Software Manual for details on the instruction
set.
Machine-resident 740 family instructions are as follows:
The FST and SLW instruction cannot be used.
The STP, WIT, MUL, and DIV instruction can be used.
[CPU Mode Register (CPUM)] 003B16
The CPU mode register contains the stack page selection bit and the
internal system clock selection bit.
The CPU mode register is allocated at address 003B
16.
MITSUBISHI MICROCOMPUTERS
38C3 Group
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
b7b0
Fig. 5 Structure of CPU mode register
CPU mode register
(CPUM (CM) : address 003B
Processor mode bits
b1 b0
0 0 : Single-chip mode
0 1 :
1 0 :
1 1 :
Stack page selection bit
0 : RAM in the zero page is used as stack area
1 : RAM in page 1 is used as stack area
Not used (returns “1” when read)
(Do not write “0” to this bit.)
Port X
0 : I/O port
1 : X
Main clock ( X
0 : Operating
1 : Stopped
Main clock division ratio selection bit
0 : f(X
1 : f(X
Internal system clock selection bit
0 : X
1 : X
Not available
C
switch bit
CIN
, X
COUT
IN–XOUT
IN
)/2 (high-speed mode)
IN
)/8 (middle-speed mode)
IN-XOUT
selected (middle-/high-speed mode)
CIN-XCOUT
16
)
) stop bit
selected (low-speed mode)
7
MITSUBISHI MICROCOMPUTERS
38C3 Group
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
MEMORY
Special Function Register (SFR) Area
The Special Function Register 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
The first 128 bytes and the last 2 bytes of ROM are reserved for
device testing and the rest is user area for storing programs.
Interrupt Vector Area
The interrupt vector area contains reset and interrupt vectors.
RAM area
RAM size
(bytes)
192
256
384
512
640
768
896
1024
Address
XXXX
00FF
013F
01BF
023F
02BF
033F
03BF
043F
16
16
16
16
16
16
16
16
16
Zero Page
Access to this area with only 2 bytes is possible in the zero page
addressing mode.
Special Page
Access to this area with only 2 bytes is possible in the special page
addressing mode.
ROM correct low-order address register 2 (Note)
ROM correct high-order address register 3 (Note)
0F06
16
ROM correct low-order address register 3 (Note)
0F07
16
ROM correct high-order address register 4 (Note)
0F08
16
ROM correct low-order address register 4 (Note)
0F09
16
Note: This register is valid only in mask ROM version.
Fig. 7 Memory map of special function register (SFR)
0F0A
16
ROM correct high-order address register 5 (Note)
0F0B
16
ROM correct low-order address register 5 (Note)
0F0C
16
ROM correct high-order address register 6 (Note)
0F0D
16
ROM correct low-order address register 6 (Note)
0F0E
16
ROM correct high-order address register 7 (Note)
ROM correct low-order address register 7 (Note)
0F0F
16
0F10
16
ROM correct high-order address register 8 (Note)
ROM correct low-order address register 8 (Note)
0F11
16
9
I/O PORTS
[Direction Registers (ports P2, P4, P5
0, P52–P57,
and P6–P8)]
The I/O ports P2, P4, P50, P52–P57, and P6–P8 have direction registers which determine the input/output direction of each individual
pin. Each bit in a direction register corresponds to one pin, each pin
can be set to be input port or output port.
When “0” is written to the bit corresponding to a pin, that pin becomes an input pin. When “1” is written to that bit, that pin becomes
an output pin.
If data is read from a pin set to output, the value of the port output
latch is read, not the value of the pin itself. Pins set to input are floating. If a pin set to input is written to, only the port output latch is
written to and the pin remains floating.
[Direction Registers (ports P0 and P1)]
Ports P0 and P1 have direction registers which determine the input/
output direction of each individual port.
Each port in a direction register corresponds to one port, each port
can be set to be input or output.
When “0” is written to the bit 0 of a direction register, that port becomes an input port. When “1” is written to that port, that port becomes an output port. Bits 1 to 7 of ports P0 and P1 direction registers are not used.
Pull-up/Pull-down Control
By setting the PULL register A (address 001616) or the PULL register
B (address 0017
16), ports except for ports P3 and P51 can control
either pull-down or pull-up (pins that are shared with the segment
output pins for LCD are pull-down; all other pins are pull-up) with a
program.
However, the contents of PULL register A and PULL register B do
not affect ports programmed as the output ports.
Port P8 Output Selection
Ports P80 to P87 can be switched to N-channel open-drain output by
setting “1” to the port P8 output selection register.
MITSUBISHI MICROCOMPUTERS
38C3 Group
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
b7b0
b7b0
Note : The contents of PULL register A and PULL register B
do not affect ports programmed as the output ports.
Fig. 8 Structure of PULL register A and PULL register B
b7b0
Fig. 9 Structure of port P8 output selection register
PULL register A
(PULLA : address 0016
P00–P07 pull-down
P1
0
–P17 pull-down
0
–P27 pull-down
P2
Not used
P7
0
, P71 pull-up
P8
0
–P87 pull-up
Not used (return “0” when read)
PULL register B
(PULLB : address 0017
P40–P43 pull-up
P4
4
–P47 pull-up
P5
0
, P52, P53 pull-up
4
–P57 pull-up
P5
P6
0
, P63 pull-up
P6
4
–P67 pull-up
Not used (return “0” when read)
0 : Disable
1 : Enable
Port P8 output selection register
(P8SEL : address 0018
0 : CMOS output (in output mode)
1 : N-channel open-drain output
(in output mode)
16
)
16
)
16)
Table 4 List of I/O port function (1)
Pin
P00/SEG8 –
Name
Port P0
Input/Output
Input/Output,
P07/SEG15
P10/SEG16 –
Port P1
Input/Output,
P17/SEG23
P20/SEG0 –
P27/SEG7
P30/SEG24 –
P37/SEG31
Port P2
Port P3
Input/Output,
individual bits
individual bits
10
port unit
port unit
Output,
I/O format
CMOS compatible input
level
CMOS 3-state output
CMOS compatible input
level
CMOS 3-state output
CMOS compatible input
CMOS 3-state output
CMOS 3-state output
Non-port function
LCD segment output
LCD segment output
LCD segment output
LCD segment output
Related SFRs
PULL register A
Segment output enable register
PULL register A
Segment output enable register
PULL register A
Segment output enable register
Segment output enable register
Ref. No.
(1)
(2)
MITSUBISHI MICROCOMPUTERS
38C3 Group
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
Table 5 List of I/O port function (2)
Pin
P40/SCLK2
P41/T1OUT
P42/T3OUT
P43/φ
P44/SIN
P45/SOUT
P46/SCLK1
P47/SRDY
P50/TAOUT
P51
P52/PWM1
P53/CNTR0
P54/CNTR1
P55/INT0
P56/INT1
P57/INT2
P60/AN0
–
P67/AN7
P70/XCIN
P71/XCOUT
P80 – P87
COM0 – COM
Notes 1: Make sure that the input level at each pin is either 0 V or VCC during execution of the STP instruction.
When an input level is at an intermediate potential, a current will flow from V
2: For details of the functions of ports P0 to P3 in modes other than single-chip mode, and how to use double function ports as function I/O ports, refer to the
applicable sections.
3
Name
Port P4
Port P5
Port P6
Port P7
Port P8
Common
Input/Output
Input/Output,
individual bits
Input/Output,
individual bits
Input
Input/Output,
individual bits
Input/Output,
individual bits
Input/Output,
individual bits
Input/Output,
individual bits
Output
I/O format
CMOS compatible input
level
CMOS 3-state output
CMOS compatible input
level
CMOS 3-state output
CMOS compatible input
level
CMOS compatible input
level
CMOS 3-state output
CMOS compatible input
level
CMOS 3-state output
CMOS compatible input
level
CMOS 3-state output
CMOS compatible input
level
CMOS 3-state output
LCD common output
Non-port function
Serial I/O function I/O
Timer output
Timer output
φ clock output
Serial I/O function I/O
Timer A output
PWM output
External count I/O
External interrupt input
A-D converter input
Sub-clock generating
circuit I/O
Key input (key-on
wake-up) interrupt input
CC to VSS through the input-stage gate.
Serial I/O control registers
1, 2
PULL register B
Timer 12 mode register
PULL register B
Timer 34 mode register
PULL register B
φ output control register
PULL register B
Serial I/O control registers
1, 2
PULL register B
Timer A mode register
Timer A control reigster
PULL register B
Timer 56 mode register
PULL register B
Interrupt edge selection register
PULL register B
Interrupt edge selection register
PULL register B
A-D control register
PULL register B
CPU mode register
PULL register A
Interrupt control register 2
PULL register A
LCD mode register
Related SFRs
Ref. No.
(3)
(4)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(4)
(12)
(12)
(13)
(14)
(15)
(17)
(16)
11
MITSUBISHI MICROCOMPUTERS
38C3 Group
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
(1)Ports P0, P1, P2
VL2/V
Segment output enable bit
Direction register
Data bus
Note : Port P0, P1 direction registers are only bit 0.
(3)Port P4
P-channel output disable bit
Serial I/O mode selection bit
Port latch
0
Direction register
VL1/V
(Note)
Segment output enable bit
L3
SS
Pull-down control
Pull-up control
(2)Port P3
Segment output enable bit
Data busPort latch
(4)Ports P41, P42, P5
Timer 1 output selection bit
Timer 3 output selection bit
Timer 6 output selection bit
Direction register
VL2/V
L3
VL1/V
SS
Pull-down control
Segment output enable bit
2
Pull-up control
Data bus
(5)Port P4
Data bus
Port latch
Serial I/O clock output
3
Direction register
Port latch
φ output control bit
Fig. 10 Port block diagram (1)
Data bus
(6)Port P4
Pull-up control
Data bus
φ
Port latch
Timer 1 output
Timer 3 output
Timer 6 output
4
Direction register
Port latch
Pull-up control
Serial I/O input
12
MITSUBISHI MICROCOMPUTERS
38C3 Group
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
(7)Port P4
Data bus
(9)Port P4
Data bus
5
P-channel output disable bit
Serial I/O port selection bit
Serial I/O output
7
S
RDY
output enable bit
Direction register
Port latch
Direction register
Port latch
Pull-up control
Pull-up control
(8)Port P4
Data bus
(10)Port P5
Data bus
6
P-channel output disable bit
Serial I/O mode selection bit
Direction register
Serial I/O clock output
0
Timer A output enable bit
Direction register
Pull-up control
Port latch
Serial I/O clock input
Pull-up control
(Note)
Port latch
Serial I/O ready output
(11)Port P5
1
Data bus
Note: The initihal value of M version becomes “1” (output).
Fig. 11 Port block diagram (2)
Timer A output
(12)Ports P53–P5
Data bus
7
Direction register
Port latch
INT0–INT2 interrupt input
0
,CNTR1 interrupt input
CNTR
Pull-up control
13
MITSUBISHI MICROCOMPUTERS
38C3 Group
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
(13)Port P6
Data bus
(15)Port P7
Data bus
Direction register
Port latch
1
Port Xc switch bit
Direction register
Port latch
Pull-up control
A-D conversion input
Analog input pin selection bit
Port selection • pull-up control
(14)Port P7
Data bus
(16)COM0–COM
0
Port selection • pull-up control
Port Xc switch bit
Direction register
Port latch
Sub-clock generating circuit input
3
V
L3
V
L2
V
L1
The gate input signal of each
transistor is controlled by the
LCD duty ratio and the bias
value.
(17)Port P8
P-channel output disable bit
Direction register
Data bus
Key input (key-on wake-up) interrupt input
Port latch
Fig. 12 Port block diagram (3)
Port P7
Port Xc switch bit
Pull-up control
Oscillator
0
14
INTERRUPTS
Interrupts occur by sixteen sources: six external, nine internal, and
one software.
Interrupt Control
Each interrupt except the BRK instruction interrupt have both an interrupt request bit and an interrupt enable bit, and is controlled by the
interrupt disable flag. An interrupt occurs if the corresponding interrupt request and enable bits are “1” and the interrupt disable flag is
“0”.
Interrupt enable bits can be set or cleared by software. Interrupt request bits can be cleared by software, but cannot be set by software.
The BRK instruction interrupt and reset cannot be disabled with any
flag or bit. The I flag disables all interrupts except the BRK instruction
interrupt and reset. If several interrupts requests occurs at the same
time the interrupt with highest priority is accepted first.
MITSUBISHI MICROCOMPUTERS
38C3 Group
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
Interrupt Operation
By acceptance of an interrupt, the following operations are automatically performed:
1.The processing being executed is stopped.
2.The contents of the program counter and processor status register are automatically pushed onto the stack.
3.The interrupt disable flag is set and the corresponding interrupt
request bit is cleared.
4.The interrupt jump destination address is read from the vector
table into the program counter.
■Notes on Interrupts
When the active edge of an external interrupt (INT
or CNTR1) is set or an vector interrupt source where several interrupt
source is assigned to the same vector address is switched, the corresponding interrupt request bit may also be set. Therefore, take following sequence:
(1) Disable the interrupt.
(2) Change the active edge in interrupt edge selection register.
(3) Clear the set interrupt request bit to “0.”
(4) Enable the interrupt.
2: Reset function in the same way as an interrupt with the highest priority.
Priority
Vector Addresses (Note 1)
High
1
FFFD16
2
FFFB16
3
FFF916
4
FFF716
5
FFF516
6
FFF316
7
FFF116
8
FFEF16
9
FFED16
10
11
12
13
14
15
16
17
FFEB16
FFE916
FFE716
FFE516
FFE316
FFE116
FFDF16
FFDD16
Low
FFFC16
FFFA16
FFF816
FFF616
FFF416
FFF216
FFF016
FFEE16
FFEC16
FFEA16
FFE816
FFE616
FFE416
FFE216
FFE016
FFDE16
FFDC16
At reset
At detection of either rising or falling edge of
INT
0 intput
At detection of either rising or falling edge of
INT1 input
At detection of either rising or falling edge of
INT2 input
At completion of serial I/O data transmit/receive
At timer A underflow
At timer 1 underflow
At timer 2 underflow
At timer 3 underflow
At timer 4 underflow
At timer 5 underflow
At timer 6 underflow
At detection of either rising or falling edge of
CNTR0 input
At detection of either rising or falling edge of
CNTR1 input
At falling of port P8 (at input) input logical level
AND
At completion of A-D conversion
At BRK instruction execution
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
Interrupt Request
Generating Conditions
MITSUBISHI MICROCOMPUTERS
38C3 Group
Remarks
Non-maskable
External interrupt
(active edge selectable)
External interrupt
(active edge selectable)
External interrupt
(active edge selectable)
Valid when serial I/O is selected
STP release timer underflow
External interrupt
(active edge selectable)
External interrupt
(active edge selectable)
External interrupt
(falling valid)
Valid when A-D conversion interrupt
is selected
Non-maskable software interrupt
16
Interrupt request bit
Interrupt enable bit
Interrupt disable flag (I)
MITSUBISHI MICROCOMPUTERS
38C3 Group
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
Fig. 13 Interrupt control
b7b0
b7b0
Interrupt edge selection register
16
(INTEDGE : address 003A
)
INT0 interrupt edge selection bit
INT
1
interrupt edge selection bit
2
interrupt edge selection bit
INT
Not used (return “0” when read)
CNTR
0
active edge switch bit
CNTR
1
active edge switch bit
Interrupt request register 1
16
(IREQ1 : address 003C
)
INT0 interrupt request bit
INT
1
interrupt request bit
2
interrupt request bit
INT
Serial I/O interrupt request bit
Timer A interrupt request bit
Timer 1 interrupt request bit
Timer 2 interrupt request bit
Timer 3 interrupt request bit
Timer 4 interrupt request bit
Timer 5 interrupt request bit
Timer 6 interrupt request bit
CNTR
0
interrupt request bit
1
interrupt request bit
CNTR
Key input interrupt request bit
AD conversion interrupt request bit
Not used (returns “0” when read)
b7b0
Interrupt control register 1
(ICON1 : address 003E
INT0 interrupt enable bit
1
interrupt enable bit
INT
INT
2
interrupt enable bit
Serial I/O interrupt enable bit
Timer A interrupt enable bit
Timer 1 interrupt enable bit
Timer 2 interrupt enable bit
Timer 3 interrupt enable bit
Fig. 14 Structure of interrupt-related registers
b7b0
16
)
Interrupt control register 2
(ICON2 : address 003F
16
)
Timer 4 interrupt enable bit
Timer 5 interrupt enable bit
Timer 6 interrupt enable bit
CNTR
0
interrupt enable bit
1
interrupt enable bit
CNTR
Key input interrupt enable bit
AD conversion interrupt enable bit
Not used (returns “0” when read)
(Do not write “1” to this bit)
0 : Interrupts disabled
1 : Interrupts enabled
17
MITSUBISHI MICROCOMPUTERS
38C3 Group
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
Key Input Interrupt (Key-on Wake-Up)
A key input interrupt request is generated by applying “L” level to any
pin of port P8 that have been set to input mode. In other words, it is
generated when AND of input level goes from “1” to “0”. An example
Port PXx
“L” level output
PULL register A
Bit 5 = “1”
P8
P8
P8
7
output
6
output
5
output
✽
✽
✽ ✽
✽ ✽
✽ ✽✽
Port P8
latch
Port P8
latch
Port P8
latch
of using a key input interrupt is shown in Figure 15, where an interrupt request is generated by pressing one of the keys consisted as
an active-low key matrix which inputs to ports P8
Port P8
direction register = “1”
7
6
5
7
Port P8
direction register = “1”
6
5
Port P8
direction register = “1”
0–P83.
Key input interrupt request
P8
4
output
P8
P8
P8
P8
3
input
2
input
1
input
0
input
4
Port P8
✽ ✽✽
Port P8
latch
✽ ✽✽
Port P8
latch
✽ ✽✽
Port P8
latch
✽ ✽✽
Port P8
latch
✽
✽ ✽
Port P8
latch
direction register = “1”
4
Port P8
3
direction register = “0”
3
Port P8
2
direction register = “0”
2
Port P8
1
direction register = “0”
1
0
Port P8
direction register = “0”
0
Port P8
Input reading circuit
Fig. 15 Connection example when using key input interrupt and port P8 block diagram
18
✽ P-channel transistor for pull-up
✽ ✽ CMOS output buffer
TIMERS
8-Bit Timer
The 38C3 group has six built-in timers : Timer 1, Timer 2, Timer 3,
Timer 4, Timer 5, and Timer 6.
Each timer has the 8-bit timer latch. All timers are down-counters.
When the timer reaches “00
count pulse. Then the contents of the timer latch is reloaded into the
timer and the timer continues down-counting. When a timer
underflows, the interrupt request bit corresponding to that timer is
set to “1.”
The count can be stopped by setting the stop bit of each timer to “1.”
The system clock φ can be set to either the high-speed mode or lowspeed mode with the CPU mode register. At the same time, timer
internal count source is switched to either f(X
●Timer 1, Timer 2
The count sources of timer 1 and timer 2 can be selected by setting
the timer 12 mode register. A rectangular waveform of timer 1 underflow signal divided by 2 is output from the P4
form polarity changes each time timer 1 overflows. The active edge
of the external clock CNTR
interrupt edge selection register.
At reset or when executing the STP instruction, all bits of the timer 12
mode register are cleared to “0,” timer 1 is set to “FF
set to “01
16.”
●Timer 3, Timer 4
The count sources of timer 3 and timer 4 can be selected by setting
the timer 34 mode register. A rectangular waveform of timer 3 underflow signal divided by 2 is output from the P4
form polarity changes each time timer 3 overflows. The active edge
of the external clock CNTR
interrupt edge selection register.
●Timer 5, Timer 6
The count sources of timer 5 and timer 6 can be selected by setting
the timer 56 mode register. A rectangular waveform of timer 6 underflow signal divided by 2 can be output from the P5
●Timer 6 PWM1 Mode
Timer 6 can output a rectangular waveform with “H” duty cycle n/
(n+m) from the P5
2/PWM1 pin by setting the timer 56 mode register
(refer to Figure 17). The n is the value set in timer 6 latch (address
16) and m is the value in the timer 6 PWM register (address
0025
0027
16). If n is “0,” the PWM output is “L,” if m is “0,” the PWM output
is “H” (n = 0 is prior than m = 0). In the PWM mode, interrupts occur
at the rising edge of the PWM output.
10 : External count input CNTR
11 : Not available
Timer 1 output selection bit (P4
0 : I/O port
1 : Timer 1 output
Not used (returns “0” when read)
(Do not write “1” to this bit.)
b0
Timer 34 mode register
(T34M: address 0029
Timer 3 count stop bit
0 : Count operation
1 : Count stop
Timer 4 count stop bit
0 : Count operation
1 : Count stop
Timer 3 count source selection bits
00 : f(X
01 : Underflow of Timer 2
10 : f(X
11 : f(X
Timer 4 count source selection bits
00 : f(X
01 : Underflow of Timer 3
10 : External count input CNTR
11 : Not available
Timer 3 output selection bit (P4
0 : I/O port
1 : Timer 3 output
Not used (returns “0” when read)
(Do not write “1” to this bit.)
1 : Underflow of Timer 4
Timer 6 operation mode selection bit
0 : Timer mode
1 : PWM mode
Timer 6 count source selection bits
00 : f(X
01 : Underflow of Timer 5
10 : Underflow of Timer 4
11 : Not available
Timer 6 (PWM) output selection bit (P5
0 : I/O port
1 : Timer 6 output
Not used (returns “0” when read)
(Do not write “1” to this bit.)
)/16 or f(X
)
)/32 or f(X
)/128 or f(X
)
IN
)/16 or f(X
IN
)/32 or f(X
IN
)/128 or f(X
IN
)/16 or f(X
)/16 or f(X
IN
)/16 or f(X
16
)
CIN
)/16
CIN
)/32
CIN
)/128
16
)
CIN
)/16
CIN
)/32
CIN
)/128
CIN
)/16
16
)
CIN
)/16
CIN
)/16
0
1
)
1
2
)
2
)
Fig. 16 Structure of Timer Related Register
19
Loading...
+ 43 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.