The 3850 group is the 8-bit microcomputer based on the 740 family core technology.
The 3850 group is designed for the household products and office
automation equipment and includes serial I/O functions, 8-bit
timer, and A-D converter.
Products under development or planning : the development schedule and specification may be revised without notice.
Planning products may be stopped the development.
One Time PROM version
One Time PROM version (blank)
512
42S1B-A
EPROM version (stock only replaced by M38504E6SS)
Mask ROM version
42P2R-A
One Time PROM version
One Time PROM version (blank)
Mask ROM version
42P4B
One Time PROM version
One Time PROM version (blank)
640
42S1B-A
EPROM version
Mask ROM version
42P2R-A
One Time PROM version
One Time PROM version (blank)
As of August 1998
5
FUNCTIONAL DESCRIPTION
CENTRAL PROCESSING UNIT (CPU)
The 3850 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 instructions cannot be used.
The STP, WIT, MUL, and DIV instructions can be used.
[CPU Mode Register (CPUM)] 003B16
The CPU mode register contains the stack page selection bit, etc.
The CPU mode register is allocated at address 003B
Fig. 7 Memory map of special function register (SFR)
8
I/O PORTS
The I/O ports have direction registers which determine the input/
output direction of each individual pin. Each bit in a direction register corresponds to one pin, and 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 which is 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.
Serial I/O control
register
Timer XY mode register
A-D control register
Timer XY mode register
Interrupt edge selection
register
Interrupt edge selection
register
PWM control register
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
9
MITSUBISHI MICROCOMPUTERS
3850 Group
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
(1) Port P0, P1
Data bus
(3) Port P2
Data bus
1
Port XC switch bit
(5) Port P2
Serial I/O enable bit
Receive enable bit
Data bus
Direction
register
Port latch
Direction
register
Port latch
Sub-clock generating circuit input
4
Direction
register
Port latch
(2) Port P2
Data bus
(4) Port P2
Data bus
(6) Port P2
0
Port XC switch bit
Direction
register
Port latch
2, P23
Port latch
5
P-channel output disable bit
Serial I/O enable bit
Transmit enable bit
Direction
register
Direction
register
Port P2
Port X
Oscillator
1
C
switch bit
(7) Port P2
Serial I/O clock
Serial I/O enable bit
Serial I/O mode selection bit
Data bus
6
selection bit
Serial I/O enable bit
Direction
register
Port latch
Serial clock output
Fig. 8 Port block diagram (1)
Serial I/O input
External clock input
Data bus
(8) Port P2
Serial I/O mode selection bit
7
Serial I/O enable bit
RDY
output enable bit
S
Data bus
Serial ready output
Port latch
Serial I/O output
Pulse output mode
Pulse output mode
Direction
register
Port latch
Timer output
CNTR
0
interrupt
input
10
MITSUBISHI MICROCOMPUTERS
3850 Group
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
(9) Port P30–P3
Data bus
(11) Port P41–P4
Data bus
4
Direction
register
Port latch
A-D converter input
3
Direction
register
Port latch
Fig. 9 Port block diagram (2)
Analog input pin selection bit
Interrupt input
(10) Port P4
(12) Port P4
Data busPort latch
0
Data bus
4
PWM output enable bit
Direction
register
PWM output
Direction
register
Port latch
Pulse output mode
Timer output
CNTR1 interrupt input
11
MITSUBISHI MICROCOMPUTERS
3850 Group
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
INTERRUPTS
Interrupts occur by 14 sources among 14 sources: six external,
seven internal, and one software.
Interrupt Control
Each interrupt is controlled by an interrupt request bit, an interrupt
enable bit, and the interrupt disable flag except for the software interrupt set by the BRK instruction. 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 cannot be disabled with any flag or bit. The I
(interrupt disable) flag disables all interrupts except the BRK instruction interrupt.
When several interrupts occur at the same time, the interrupts are
received according to priority.
Interrupt Operation
By acceptance of an interrupt, the following operations are automatically performed:
1. The contents of the program counter and the processor status
register are automatically pushed onto the stack.
2. The interrupt disable flag is set and the corresponding interrupt
request bit is cleared.
3. The interrupt jump destination address is read from the vector
table into the program counter.
■Notes
When the active edge of an external interrupt (INT0–INT3, CNTR0,
CNTR
1) is set, the corresponding interrupt request bit may also be
set. Therefore, take the following sequence:
1. Disable the interrupt
2. Change the interrupt edge selection register
(the timer XY mode register for CNTR
INT0 interrupt enable bit
Reserved(Do not write "1" to this bit)
1
interrupt enable bit
INT
INT
2
interrupt enable bit
INT
3
interrupt enable bit
Reserved(Do not write "1" to this bit)
Timer X interrupt enable bit
Timer Y interrupt enable bit
0 : Interrupts disabled
1 : Interrupts enabled
Fig. 11 Structure of interrupt-related registers (1)
14
b7 b0
16
)
Interrupt control register 2
(ICON2 : address 003F
16
)
Timer 1 interrupt enable bit
Timer 2 interrupt enable bit
Serial I/O reception interrupt enable bit
Serial I/O transmit interrupt enable bit
CNTR
0
interrupt enable bit
CNTR
1
interrupt enable bit
AD converter interrupt enable bit
Not used (returns “0” when read)
(Do not write “1” to this bit)
0 : Interrupts disabled
1 : Interrupts enabled
MITSUBISHI MICROCOMPUTERS
3850 Group
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
TIMERS
The 3850 group has four timers: timer X, timer Y, timer 1, and
timer 2.
The division ratio of each timer or prescaler is given by 1/(n + 1),
where n is the value in the corresponding timer or prescaler latch.
All timers are count down. When the timer reaches “00
derflow occurs at the next count pulse and the corresponding
timer latch is reloaded into the timer and the count is continued.
When a timer underflows, the interrupt request bit corresponding
to that timer is set to “1”.
The count source of prescaler 12 is the oscillation frequency
which is selected by timer 12 count source selection bit. The output of prescaler 12 is counted by timer 1 and timer 2, and a timer
underflow sets the interrupt request bit.
Timer X and Timer Y
Timer X and Timer Y can each select in one of four operating
modes by setting the timer XY mode register.
(1) Timer Mode
The timer counts the count source selected by Timer count source
selection bit.
(2) Pulse Output Mode
The timer counts the count source selected by Timer count source
selection bit. Whenever the contents of the timer reach “00
signal output from the CNTR
CNTR
0 (or CNTR1) active edge selection bit is “0”, output begins
0 (or CNTR1) pin is inverted. If the
16”, the
at “ H”.
If it is “1”, output starts at “L”. When using a timer in this mode, set
the corresponding port P2
7 ( or port P40) direction register to out-
put mode.
(3) Event Counter Mode
Operation in event counter mode is the same as in timer mode, except that the timer counts signals input through the CNTR
CNTR
1 pin.
When the CNTR
rising edge of the CNTR
When the CNTR
falling edge of the CNTR
0 (or CNTR1) active edge selection bit is “0”, the
0 (or CNTR1) pin is counted.
0 (or CNTR1) active edge selection bit is “1”, the
0 (or CNTR1) pin is counted.
0 or
(4) Pulse Width Measurement Mode
If the CNTR0 (or CNTR1) active edge selection bit is “0”, the timer
counts the selected signals by the count source selection bit while
the CNTR
tive edge selection bit is “1”, the timer counts it while the CNTR
(or CNTR1) pin is at “L”.
0 (or CNTR1) pin is at “H”. If the CNTR0 (or CNTR1) ac-
1 : f(XIN)/2 (f(X
Timer 12 count source selection bit
0 : f(X
IN
1 : f(X
CIN
Not used (returns “0” when read)
16
)
Fig. 13 Structure of timer count source selection register
The count can be stopped by setting “1” to the timer X (or timer Y)
count stop bit in any mode. The corresponding interrupt request
bit is set each time a timer underflows.
■Note
When switching the count source by the timer 12, X and Y count
source bit, the value of timer count is altered in unconsiderable
amount owing to generating of a thin pulses in the count input
signals.
Therefore, select the timer count source before set the value to
the prescaler and the timer.
15
Data bus
MITSUBISHI MICROCOMPUTERS
3850 Group
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
f(XIN)/16
f(XIN)/2
Timer X count source selection bit
7/CNTR0
P2
7
Port P2
direction register
f(XIN)/16
f(XIN)/2
Timer Y count source selection bit
P40/CNTR1
Port P4
direction register
CNTR
edge selection
“0”
“1”
Port P2
latch
Pulse output mode
CNTR
edge selection
“0”
“1”
Port P4
0
Pulse output mode
latch
0 active
bit
7
1 active
bit
0
Pulse width
measurement
mode
Event
counter
mode
CNTR
edge selection
bit
Pulse width
measurement mode
Event
counter
mode
CNTR1 active
edge selection
bit
Timer mode
Pulse output mode
Timer X count stop bit
0 active
“1”
“0”
Timer mode
Pulse output mode
Timer Y count stop bit
“1”
“0”
Data bus
Prescaler X latch (8)
Prescaler X (8)
Q
Toggle flip-flop
Q
R
Data bus
Prescaler Y latch (8)
Prescaler Y (8)
Q
Toggle flip-flop
Q
R
Timer X latch (8)
Timer X (8)
T
Timer X latch write pulse
Pulse output mode
Timer Y latch (8)
Timer Y (8)
T
Timer Y latch write pulse
Pulse output mode
To timer X interrupt
request bit
To CNTR
0 interrupt
request bit
To timer Y interrupt
request bit
To CNTR
1 interrupt
request bit
Prescaler 12 latch (8)
f(XIN)/16
f(XCIN)
Timer 12 count source selection bit
Prescaler 12 (8)
Fig. 14 Block diagram of timer X, timer Y, timer 1, and timer 2
16
Timer 1 latch (8)
Timer 1 (8)
Timer 2 latch (8)
Timer 2 (8)
To timer 2 interrupt
request bit
To timer 1 interrupt
request bit
Loading...
+ 36 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.