M37641M8 MITSUBISHI | Alldatasheet
Document overview
- Manufacturer or author: Provided By ALLDATASHEET.COM(FREE DATASHEET DOWNLOAD SITE)
- PDF pages: 149
Technical content
7641 Group
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change.DESCRIPTION The 7641 group is the 8-bit microcomputer based on the 7600 series core (740 family core compatible) technology. The 7641 group is designed for PC peripheral devices, including the USB, DMAC, Serial I/O, UART, Timer, Master CPU bus interface and so on.
FEATURES
<Microcomputer mode) (at 24 MHz oscillation frequency) G Memory size (external 5 including Key input, internal 18, software 1) G USB function control unit 8-bit ✕ 3 (Timers 1, 2, 3) (connect to external ceramic resonator or quartz-crystal oscillator) G Power source voltage G Packages <Flash memory mode> G Power source voltage At 24 MHz oscillation frequency, φ = 6 MHz G Memory size Parallel I/O mode Standard serial I/O mode CPU rewrite mode G Erasing method Batch erasing Block erasing G Program/Erase control by software command G ROM code protection Available in parallel I/O mode and standard serial I/O mode APPLICATION Audio, musical instrument, printer, scanner, modem, other PC pe- ripheral devices I Notes 1. The specifications of this product are subject to change be- cause it is under development. Inquire the use of Mitsubishi Electric Corporation. 2. The flash memory version cannot be used for application em- bedded in the MCU card.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. PIN CONFIGURATION (TOP VIEW) Fig. 1 M37641M8-XXXFP, M37641F8FP pin configuration P 74/ O B F1 2 5 2 6 2 7 2 8 2 9 3 0 3 1 3 2 3 3 3 4 3 5 3 6 3 7 3 8 3 9 4 0 6 0 6 5 6 6 6 7 6 8 6 9 7 0 7 1 7 2 7 3 7 4 7 5 7 6 7 7 7 8 8 0 P61/DQ1 P56/R(E) P 55/ A0 P53/IBF0 P52/OBF0 CNV SS /VPP RESET AV CC AV SS P44/CNTR 1 P 87/ R T S1 P 86/ C T S1 VCC P50/XCIN VSS XIN XOUT P51/TOUT /XCOUT LPF P 85/ U R X D 1 P 84/ U T X D 1 P 32 P 31 M 3 7 6 4 1 M 8 - X X X F P M F F P P60/DQ0 P57/W/(R/W) P 54/ S0 P43/CNTR 0 P42/INT1 P41/INT0 P40/EDMA 6 1 6 2 6 3 6 4 P 83/ R T S2/ S T X D P 82/ C T S2/ S R X D P 81/ U R X D 2/ S C L K P 80/ U T X D 2/ S R D Y P 37/ R D P 36/ W R P 35/ S Y N C O U T P 34/φ O U T P 33/ D M AO U T P 30/ R D Y P 17/ A B1 P 16/ A B1 P 15/ A B1 P 14/ A B1 P 13/ A B1 P 12/ A B1 P 11/ A B9 P 10/ A B8 P 07/ A B7 P 06/ A B6 P 05/ A B5 P 04/ A B4 P 03/ A B3 P 02/ A B2 P 01/ A B1 P 00/ A B0 P 27/ D B7 P 26/ D B6 P 25/ D B5 P 24/ D B4 P 23/ D B3 P 22/ D B2 P 21/ D B1 P 20/ D B0 P 73/ I B F1/ H L D A P 72/ S1 P 71/ H O L D P 70/ S O F U S B D + U S B D - E x t . C a p VS S VC C P 67/ D Q 7 P 66/ D Q 6 P 65/ D Q 5 P 64/ D Q 4 P63/DQ3 P 62/ D Q 2 P 74/ O B F1 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0 3 2 3 3 3 4 3 5 3 6 3 7 3 8 3 9 4 0 4 1 4 2 4 3 4 4 4 5 4 6 4 7 4 8 4 9 5 0 5 1 5 2 5 3 5 4 5 5 5 6 6 5 6 6 6 7 6 8 6 9 P 61/ D Q 1 P56/R(E) P 55/ A0 P53/IBF0 P52/OBF0 C N VS S/ VP P RESET AV CC AV SS P 44/ C N T R 1 P 87/ R T S1 P86/CTS1 VCC P50/XCIN VSS XIN XOUT P51/TOUT /XCOUT L P F P 85/ U R X D 1 P 84/ U T X D 1 P 32 P 31 M37641M8-XXXHP M37641F8HP P 60/ D Q 0 P 54/ S0 P 43/ C N T R 0 P 42/ I N T1 P 41/ I N T0 6 1 6 2 6 3 6 4 P 83/ R T S2/ S T X D P 82/ C T S2/ S R X D P 81/ U R X D 2/ S C L K P 80/ U T X D 2/ S R D Y P 37/ R D P 36/ W R P 35/ S Y N C O U T P 34/φ O U T P 33/ D M AO U T P 30/ R D Y P 17/ A B1 P 16/ A B1 P 15/ A B1 P 14/ A B1 P 13/ A B1 P 12/ A B1 P 11/ A B9 P 10/ A B8 P 07/ A B7 P 06/ A B6 P 05/ A B5 P 04/ A B4 P 03/ A B3 P 02/ A B2 P 01/ A B1 P 00/ A B0 P 27/ D B7 P 26/ D B6 P 25/ D B5 P 24/ D B4 P 23/ D B3 P 22/ D B2 P21/DB1 P20/DB0 U S B D + U S B D - E x t . C a p VS S VC C P 67/ D Q 7 P 66/ D Q 6 P 65/ D Q 5 P 64/ D Q 4 P 63/ D Q 3 P 62/ D Q 2 P 40/ E D M A P 71/ H O L D P 70/ S O F P72/S1 P 73/ I B F1/ H L D A Package type : 80P6N-A Package type : 80P6Q-A Fig. 2 M37641M8-XXXHP, M37641F8HP pin configuration
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. FUNCTIONAL BLOCK DIAGRAM (Package: 80P6N-A) Fig. 3 Functional block diagram TOUT C P U A X Y S PC H PC L PS RESET V CC V SS R O M R A M P2(8) I/O port P0 P0(8) P1(8) P3(8) P5(8) 49 50 51 52 53 54 55 56 41 42 43 44 45 46 47 48 57 58 59 60 61 62 63 64 33 34 35 36 37 38 39 40 P6(8) 20 21 22 23 24 X IN X OUT Timer X (16)Timer Y (16) Timer 1 (8) Timer 2 (8)Timer 3 (8) 77 78 79 P7(5) 65 66 67 69 P8(8) 26 27 28 29 30 31 32 CNTR 1, CNTR USB V CC 74 V SS 73 CNV SS UART1 (8) UART2 (8) SOF 70 71 345678 1 1 1 2 W(R/W)R(E),A S 0,IBF OBF INT INT P4(5) DMA [DMA OUT Ext.Cap LPF AV SS DQ 0 to DQ S 1, IBF OBF T OUT 3 6 [φ OUT [EDMA] [RD] [WR] [SYNC OUT ][ R D Y ] [HLDA] [HOLD] AVcc Main clock input Main clock output Clock generating circuit Reset input X CIN X COUT φ Serial I/O (8) Master CPU bus interface X CIN Key input I/O port P1 I/O port P2 I/O port P3 I/O port P4 I/O port P5 I/O port P6 I/O port P7 I/O port P8 Reset
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. P50/XCIN, P51/TOUT / XCOUT , P52/OBF0, P53/IBF0, P54/S0, P55/A0, P56/R(E), P57/W(R/W) Vss pin.
- This controls the MCU operating mode. Connect this pin to Vss. If connecting this pin to Vcc, the internal ROM is inhibited. In the flash memory version this pin functions as a VPP power supply input pin.
- These pins are the power supply inputs for analog circuitry.
- Reset input pin for active “L.”
- Connect a ceramic resonator or a quartz-crystal oscillator between the XIN and XOUT pins to set the oscillation frequency.
- If an external clock is used, connect the clock source to the XIN pin and leave the XOUT pin open.
- Loop filter for the frequency synthesizer.
- Power supply input pin for 3.3 V USB line driver.
- USB D+ voltage signal port. Connect a 27 to 33 Ω (recommended) resistor in series.
- USB D- voltage signal port. Connect a 27 to 33 Ω (recommended) resistor in series.
- 8-bit I/O port.
- CMOS compatible input level.
- CMOS 3-state output structure.
- I/O direction register allows each pin to be individually programmed as either input or output.
- When connecting an external memory, these function as the address bus.
- 8-bit I/O port.
- CMOS compatible input level.
- CMOS 3-state output structure.
- I/O direction register allows each pin to be individually programmed as either input or output.
- When connecting an external memory, these function as the address bus.
- Key-on wake-up interrupt input pin V CC , VSS CNVss/V PP AVss/AVcc RESET XIN XOUT LPF Ext. Cap. USB D+ USB D- 0/AB0– P07/AB7 Name Power source CNVss Analog power supply Reset input Clock input Clock output LPF
3.3 V line power
Function except a port function PIN DESCRIPTION Table 1 Pin description (1) Function P10/AB8– P17/AB15 P20/DB0– P27/DB7
- 8-bit I/O port.
- CMOS compatible input level or VIHL input level.
- CMOS 3-state output structure.
- I/O direction register allows each pin to be individually programmed as either input or output.
- When connecting an external memory, these function as the data bus.
- 8-bit I/O port.
- CMOS compatible input level.
- CMOS 3-state output structure.
- I/O direction register allows each pin to be individually programmed as either input or output.
- When connecting an external memory, these function as the control bus. 0/RDY, P31, P32, P33/DMA OUT , P34/φ OUT , P35/SYNCOUT , P36/WR,
- 8-bit I/O port.
- CMOS compatible input level.
- CMOS 3-state output structure.
- I/O direction register allows each pin to be individually programmed as either input or output.
- When connecting an external memory, these function as the control bus.
- 8-bit I/O port.
- CMOS compatible input level.
- CMOS 3-state output structure.
- I/O direction register allows each pin to be individually programmed as either input or output.
- When enabling the Master CPU bus interface function, CMOS or TTL input level can be selected as an input. I/O port P1 I/O port P2 I/O port P3 (See Remarks.) I/O port P4
- External memory control pin I/O port P5 7/RD P40/EDMA, P41/INT0, P42/INT1, P43/CNTR 0, P44/CNTR 1
- External memory control pin
- External interrupt pin
- Timer X, Timer Y pin
- Sub-clock generating input pin
- Timers 1, 2 pulse output pins
- Sub-clock generating output pin
- Master CPU bus interface pin Pin
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. Pin Name Function except a port functionFunction Table 2 Pin description (2) P60/DQ0– P67/DQ7 I/O port P6 • 8-bit I/O port.
- CMOS compatible input level.
- CMOS 3-state output structure.
- I/O direction register allows each pin to be individually programmed as either input or output.
- When enabling the bus interface function, CMOS or TTL input level can be selected as its input.
- 5-bit I/O port.
- CMOS compatible input level.
- CMOS 3-state output structure.
- I/O direction register allows each pin to be individually programmed as either input or output.
- Master CPU bus interface pin 0/SOF, P71/HOLD, P72/S1, P73/IBF1/ HLDA, P74/OBF1 P80/UTXD 2/ SRDY, P81/URXD 2/ SCLK, P82/CTS2/ SRXD, P83/RTS2/ STXD, P84/UTXD 1, P85/URXD 1, P86/CTS1, P87/RTS1 I/O port P7 I/O port P8 • 8-bit I/O port.
- CMOS compatible input level.
- CMOS 3-state output structure.
- I/O direction register allows each pin to be individually pro- grammed as either input or output.
- USB function pin
- Master CPU bus interface pin
- Serial I/O pin
- UART2 pin
- UART1 pin Remarks
- DMA OUT pin If externally detecting the timing of DMA execution, use the signal from this pin. It is “H” level during DMA transferring. This signal is valid in the memory expansion and microprocessor modes.
- SYNC OUT pin If externally detecting the timing of OP code fetch, use the signal from this pin. This signal is valid in the memory expansion and microprocessor modes.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change.PART NUMBERING Fig. 4 Part numbering M37641 M 8 – XXX FPProduct ROM size/ 8: 32768 bytes The first 128 bytes and the last 4 bytes of ROM are reserved areas; they cannot be used. In the flash memory version, these areas can be used for program and erase. Memory type M: Mask ROM version F: Flash memory version RAM size M37641M8 : 1024 bytes M37641F8 : 2560 bytes Package type FP: 80P6N-A package HP: 80P6Q-A package ROM number Omitted in Flash memory version. –: Standard A –: High-speed version Omitted in Flash memory version. Flash memory size
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change.GROUP EXPANSION Mitsubishi plans to expand the 7641 group as follows. Memory Type Supports for mask ROM and flash memory versions. Memory Size Memory Expansion Plan Fig. 5 Memory expansion plan Currently planning products are listed below. As of Feb. 2001 Package 80P6N-A 80P6Q-A 80P6N-A 80P6Q-A Product name M37641M8-XXXFP M37641M8-XXXHP M37641F8FP M37641F8HP ROM size (bytes) ROM size for User in ( ) 32768 (32636) RAM size (bytes) 1024 Table 3 Support products Mask ROM version Remarks Packages R O M e x t e r n a l K K 32 K K K 20 K 16 K 12 K 8 K 384 512 640 768 896 1024 1152 1280 1408 1536 2048 3072 4032 M37641F8 ROM size (bytes) RAM size (bytes) P r o d u c t s u n d e r d e v e l o p m e n t o r p l a n n i n g t h e d e v e l o p m e n t s c h e d u l e a n d s p e c i f i c a t i o n m a y b e r e v i s e d w i t h o u t n o t i c e M37641M8 Under development 32768 2560 Flash memory version
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. FUNCTIONAL DESCRIPTION CENTRAL PROCESSING UNIT (CPU) The 7641 group uses the standard 7600 series instruction set. Refer to the 7600 Series Software Manual for details on the instruction set. The 7600 series has an upward compatible instruction set, of which instruction execution cycles are shortened, for 740 series. [Accumulator (A)] The accumulator is an 8-bit register. Data operations such as data transfer, etc., are executed mainly through the accumulator. [Index Register X (X)] The index register X is an 8-bit register. In the index addressing modes, the value of the OPERAND is added to the contents of register X and specifies the real address. [Index Register Y (Y)] The index register Y is an 8-bit register. In partial instruction, the value of the OPERAND is added to the contents of register Y and specifies the real address. [Stack Pointer (S)] The stack pointer is an 8-bit register used during subroutine calls and interrupts. This register indicates start address of stored area (stack) for storing registers during subroutine calls and interrupts. The low-order 8 bits of the stack address are determined by the con- tents of the stack pointer. The high-order 8 bits of the stack address are determined by the stack page selection bit. If the stack page selection bit is “0” , the high-order 8 bits becomes “00 16”. If the stack page selection bit is “1”, the high-order 8 bits becomes “0116”. The operations of pushing register contents onto the stack and pop- ping them from the stack are shown in Figure 7. Store registers other than those described in Figure 7 with program when the user needs them during interrupts or subroutine calls. [Program Counter (PC)] The program counter is a 16-bit counter consisting of two 8-bit regis- ters PC H and PCL. It is used to indicate the address of the next in- struction to be executed. Fig. 6 7600 series CPU register structure A Accumulator b7 b0 b7b8b15 b0 b7 b0 X Index register X Y Index register Y S Stack pointer PC L Program counterPC H N V T B D I Z C Processor status register (PS) Carry flag Zero flag Interrupt disable flag Decimal mode flag Break flag Index X mode flag Overflow flag Negative flag
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. Table 4 Push and pop instructions of accumulator or processor status register Accumulator Processor status register Push instruction to stack PHA PHP Pop instruction from stack PLA PLP Fig. 7 Register push and pop at interrupt generation and subroutine call N o t e: C o n d i t i o n f o r a c c e p t a n c e o f a n i n t e r r u p t I n t e r r u p t e n a b l e f l a g i s “ 1 ” E x e c u t e J S R O n g o i n g R o u t i n e M S P C H ) S S M S P C L) E x e c u t e R T S P C L)M S S S S S S S P C H )M S S u b r o u t i n e P O P re t u r n a d d r e s s f r o m s t a c k P u s h r e t u r n a d d r e s s o n s t a c k M S P S E x e c u t e R T I P S S S S S S I n t e r r u p t S e r v i c e R o u t i n e P O P c o n t e n t s o f p r o c e s s o r s t a t u s r e g i s t e r f r o m s t a c k M S P C H ) S S M S P C L) S S P C L)M S S S S S P C H )M S P O P r e t u r n a d d r e s s f r o m s t a c k I F l a g i s s e t f r o m “ 0 ” t o “ 1 ” F e t c h t h e j u m p v e c t o r P u s h r e t u r n a d d r e s s o n s t a c k P u s h c o n t e n t s o f p r o c e s s o r s t a t u s r e g i s t e r o n s t a c k I n t e r r u p t r e q u e s t N o t e I n t e r r u p t d i s a b l e f l a g i s “ 0 ”
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. [Processor status register (PS)] The processor status register is an 8-bit register consisting of 5 flags which indicate the status of the processor after an arithmetic opera- tion and 3 flags which decide MCU operation. Branch operations can be performed by testing the Carry (C) flag , Zero (Z) flag, Overflow (V) flag, or the Negative (N) flag. In decimal mode, the Z, V, N flags are not valid.
- Bit 0: Carry flag (C) The C flag contains a carry or borrow generated by the arithmetic logic unit (ALU) immediately after an arithmetic operation. It can also be changed by a shift or rotate instruction.
- Bit 1: Zero flag (Z) The Z flag is set if the result of an immediate arithmetic operation or a data transfer is “0”, and cleared if the result is anything other than “0”.
- Bit 2: Interrupt disable flag (I) The I flag disables all interrupts except for the interrupt generated by the BRK instruction. Interrupts are disabled when the I flag is “1”.
- Bit 3: Decimal mode flag (D) The D flag determines whether additions and subtractions are executed in binary or decimal. Binary arithmetic is executed when this flag is “0”; decimal arithmetic is executed when it is “1”. Decimal correction is automatic in decimal mode. Only the ADC
- Bit 4: Break flag (B) The B flag is used to indicate that the current interrupt was generated by the BRK instruction. The BRK flag in the processor status register is always “0”. When the BRK instruction is used to generate an interrupt, the processor status register is pushed onto the stack with the break flag set to “1”.
- Bit 5: Index X mode flag (T) When the T flag is “0”, arithmetic operations are performed between accumulator and memory. When the T flag is “1”, direct arithmetic operations and direct data transfers are enabled between memory locations.
- Bit 6: Overflow flag (V) The V flag is used during the addition or subtraction of one byte of signed data. It is set if the result exceeds +127 to -128. When the BIT instruction is executed, bit 6 of the memory location operated on by the BIT instruction is stored in the overflow flag.
- Bit 7: Negative flag (N) The N flag is set if the result of an arithmetic operation or data transfer is negative. When the BIT instruction is executed, bit 7 of the memory location operated on by the BIT instruction is stored in the negative flag. Table 5 Set and clear instructions of each bit of processor status register Set instruction Clear instruction C flag SEC CLC Z flag I flag SEI CLI D flag SED CLD B flag T flag SET CLT V flag CLV N flag
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. [CPU Mode Registers A, B (CPUMA, CPUMB)] 000016, 000116 The CPU mode register contains the stack page select bit and the CPU operating mode select bit and so on. The CPU mode registers are allocated at address 0000 16, 000116. Fig. 8 Structure of CPU mode register I Notes Do not use the microprocessor mode in the flash memory version. CPU mode register A (address 000016) CPMA P r o c e s s o r m o d e b i t s b b S i n g l e c h i p m o d e M e m o r y e x p a n s i o n m o d e M i c r o p r o c e s s o r m o d e o t e N o t a v a i l a b l e S t a c k p a g e s e l e c t b i t P a g e P a g e F i x t o S u b c l o c k XC I N - XC O U s t o p b i t O s c i l l a t i n g S t o p p e d M a i n c l o c k XI N - XO U s t o p b i t O s c i l l a t i n g S t o p p e d I n t e r n a l s y s t e m c l o c k s e l e c t b i t o t e E x t e r n a l c l o c k XI N - XO U T o r XC I N - XC O U fS Y N E x t e r n a l c l o c k s e l e c t b i t XI N - XO U T XC I N - XC O U T b Notes 1: This is not available in the flash memory version. 2: When (CPMA 6, 7) = (0, 0), the internal system clock can be selected between f(XIN) or f(XIN)/2 by CCR7. The internal clock φ is the internal system clock divided by 2. CPU mode register B (address 000116) CPMB Slow memory wait select bits b1b0 0 0: No wait 0 1: One-time wait 1 0: Two-time wait 1 1: Three-time wait Slow memory wait mode select bits b3b2 0 0: Software wait 0 1: Not available 1 0: RDY wait 1 1: Software wait plus RDY input anytime wait Expanded data memory access bit 0: EDMA output disabled 1: EDMA output enabled HOLD function enable bit 0: HOLD function disabled 1: HOLD function enabled Resereved bit (“0” at read/write) Fix to “1”. b 1 0
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. 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 4 bytes of ROM are reserved for device testing and the rest is user area for storing programs. In the flash memory version, program and erase can be performed in the reserved area. Interrupt Vector Area The interrupt vector area contains reset and interrupt vectors. 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. Refer to page 74 for the memory map of memory expansion and microprocessor modes. Fig. 9 Memory map diagram 1 0 2 4 046F16 0A6F 16 R A M a r e a R A M s i z e b y t e s A d d r e s s X X X 000016 007016 FF0016 F F C A1 FFFC 16 FFFF 16 X X X X1 8 0 0 01 8 0 8 01 RAM ROM SIZE: 32768 bytes S F R a r e a N ot used I n t e r r u p t v e c t o r a r e a R e s e r v e d R O M a r e a b y t e s Zero page Special page R eserved ROM area 010016 100016 R eserved area (N ote 1) S F R a r e a (N ote 2) FFC 916 M 3 7 6 4 1 M 8 M F N o t e s1 : R e s e r v e d a r e a i n M 3 7 6 4 1 F 8 . S F R a r e a i n M F
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 10 Memory map of special function register (SFR) C P U m o d e r e g i s t e r A C P U A C P U m o d e r e g i s t e r B C P U B I n t e r r u p t r e q u e s t r e g i s t e r A I R E Q A I n t e r r u p t r e q u e s t r e g i s t e r B I R E Q B I n t e r r u p t r e q u e s t r e g i s t e r C I R E Q C I n t e r r u p t c o n t r o l r e g i s t e r A I C O N A I n t e r r u p t c o n t r o l r e g i s t e r B I C O N B I n t e r r u p t c o n t r o l r e g i s t e r C I C O N C P o r t P P P o r t P d i r e c t i o n r e g i s t e r P D P o r t P P P o r t P d i r e c t i o n r e g i s t e r P D P o r t P P P o r t P d i r e c t i o n r e g i s t e r P D P o r t P P P o r t P d i r e c t i o n r e g i s t e r P D P o r t c o n t r o l r e g i s t e r P T C I n t e r r u p t p o l a r i t y s e l e c t r e g i s t e r I P O L P o r t P p u l l u p c o n t r o l r e g i s t e r P U P U S B c o n t r o l r e g i s t e r U S B C P o r t P P P o r t P d i r e c t i o n r e g i s t e r P D P o r t P P P o r t P d i r e c t i o n r e g i s t e r P D P o r t P P P o r t P d i r e c t i o n r e g i s t e r P D P o r t P P P o r t P d i r e c t i o n r e g i s t e r P D P o r t P P P o r t P d i r e c t i o n r e g i s t e r P D R e s e r e v e d o t e C l o c k c o n t r o l r e g i s t e r C C R T i m e r X L T X L T i m e r X H T X H T i m e r Y L T Y L T i m e r Y H T Y H T i m e r T T i m e r T T i m e r T T i m e r X m o d e r e g i s t e r T X M T i m e r Y m o d e r e g i s t e r T Y M T i m e r m o d e r e g i s t e r T M S e r i a l I O s h i f t r e g i s t e r S I O S H T S e r i a l I O c o n t r o l r e g i s t e r S I O C O N S e r i a l I O c o n t r o l r e g i s t e r S I O C O N S p e c i a l c o u n t s o u r c e g e n e r a t o r S C S G S p e c i a l c o u n t s o u r c e g e n e r a t o r S C S G S p e c i a l c o u n t s o u r c e m o d e r e g i s t e r S C S G M U A R T m o d e r e g i s t e r U M O D U A R T b a u d r a t e g e n e r a t o r U B R G U A R T s t a t u s r e g i s t e r U S T S U A R T c o n t r o l r e g i s t e r U C O N U A R T t r a n s m i t r e c e i v e b u f f e r r e g i s t e r U T R B U A R T t r a n s m i t r e c e i v e b u f f e r r e g i s t e r U T R B U A R T R T S c o n t r o l r e g i s t e r U R T S C R e s e r e v e d o t e 000916 C 1 D 1 001316 001416 001516 C 1 001D 16 002116 002516 002716 002816 002916 C 1 002D 16 002E16 003016 003416 003716 U A R T m o d e r e g i s t e r U M O D U A R T b a u d r a t e g e n e r a t o r U B R G U A R T s t a t u s r e g i s t e r U S T S U A R T c o n t r o l r e g i s t e r U C O N U A R T t r a n s m i t r e c e i v e b u f f e r r e g i s t e r U T R B U A R T t r a n s m i t r e c e i v e b u f f e r r e g i s t e r U T R B U A R T R T S c o n t r o l r e g i s t e r U R T S C D M A C i n d e x a n d s t a t u s r e g i s t e r D M A I S D M A C c h a n n e l x m o d e r e g i s t e r D M A x D M A C c h a n n e l x m o d e r e g i s t e r D M A x D M A C c h a n n e l x s o u r c e r e g i s t e r L o w D M A x S L D M A C c h a n n e l x s o u r c e r e g i s t e r H i g h D M A x S H D M A C c h a n n e l x d e s t i n a t i o n r e g i s t e r L o w D M A x D L D M A C c h a n n e l x d e s t i n a t i o n r e g i s t e r H i g h D M A x D H D M A C c h a n n e l x t r a n s f e r c o u n t r e g i s t e r L o w D M A x C L D M A C c h a n n e l x t r a n s f e r c o u n t r e g i s t e r H i g h D M A x C H D a t a b u s b u f f e r r e g i s t e r D B B D a t a b u s b u f f e r s t a t u s r e g i s t e r D B B S D a t a b u s b u f f e r c o n t r o l r e g i s t e r D B B C R e s e r e v e d o t e D a t a b u s b u f f e r r e g i s t e r D B B D a t a b u s b u f f e r s t a t u s r e g i s t e r D B B S D a t a b u s b u f f e r c o n t r o l r e g i s t e r D B B C R e s e r e v e d o t e U S B a d d r e s s r e g i s t e r U S B A U S B p o w e r m a n a g e m e n t r e g i s t e r U S B P M U S B i n t e r r u p t s t a t u s r e g i s t e r U S B I S U S B i n t e r r u p t s t a t u s r e g i s t e r U S B I S U S B i n t e r r u p t e n a b l e r e g i s t e r U S B I E U S B i n t e r r u p t e n a b l e r e g i s t e r U S B I E U S B f r a m e n u m b e r r e g i s t e r L o w U S B S O F L U S B f r a m e n u m b e r r e g i s t e r H i g h U S B S O F H U S B e n d p o i n t i n d e x r e g i s t e r U S B I N D E X U S B e n d p o i n t x I N c o n t r o l r e g i s t e r I N C S R U S B e n d p o i n t x O U T c o n t r o l r e g i s t e r O U T C S R U S B e n d p o i n t x I N m a x p a c k e t s i z e r e g i s t e r I N M A X P U S B e n d p o i n t x O U T m a x p a c k e t s i z e r e g i s t e r O U T M A X P U S B e n d p o i n t x O U T w r i t e c o u n t r e g i s t e r L o w W R T C N T L U S B e n d p o i n t x O U T w r i t e c o u n t r e g i s t e r H i g h W R T C N T H U S B e n d p o i n t F I F O m o d e r e g i s t e r U S B F I F O M R U S B e n d p o i n t F I F O U S B F I F O U S B e n d p o i n t F I F O U S B F I F O U S B e n d p o i n t F I F O U S B F I F O U S B e n d p o i n t F I F O U S B F I F O U S B e n d p o i n t F I F O U S B F I F O R e s e r e v e d o t e R e s e r e v e d o t e R e s e r e v e d o t e R e s e r e v e d o t e R e s e r e v e d o t e F l a s h m e m o r y c o n t r o l r e g i s t e r F M C R o t e R e s e r e v e d o t e F r e q u e n c y s y n t h e s i z e r c o n t r o l r e g i s t e r F S C F r e q u e n c y s y n t h e s i z e r m u l t i p l y r e g i s t e r F S M F r e q u e n c y s y n t h e s i z e r m u l t i p l y r e g i s t e r F S M F r e q u e n c y s y n t h e s i z e r d i v i d e r e g i s t e r F S D 003816 C 1 3A1 D 1 004116 004C 16 004D 16 005316 005416 005916 C 1 005D 16 005F16 006016 006116 006516 006616 006916 006A16 006C 16 D 1 006F16 F F C 6 R O M c o d e p r o t e c t c o n t r o l r e g i s t e r R O M C P o t e Notes 1: Do not write any data to this addresses, because these areas are reserved. 2: This area is reserved in the mask ROM version. 3: This area is on the ROM in the mask ROM version.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. I/O PORTS Direction Registers The I/O ports P0–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 be- comes 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 float- ing. If a pin set to input is written to, only the port output latch is written to and the pin remains floating. Slew Rate Control By setting bits 0 to 5 of the port control register (address 001016) to “1”, slew rate control is enabled. VIHL or CMOS level can be used as a port P2 input level; CMOS or TTL level can be used as an input level of master CPU bus interface. Pull-up Control By setting the port P2 pull-up control register (address 001216), pull- up of each pin of port P2 can be controlled with a program. However, the contents of port P2 pull-up control register do not affect ports programmed as the output ports but as the input ports. Fig. 11 Structure of port control and port P2 pull-up control registers Port control register (address 001016) PTC Port P0 to P3 slew rate control bit (Note 1) 0: Disabled 1: Enabled Port P4 slew rate control bit (Note 1) 0: Disabled 1: Enabled Port P5 slew rate control bit (Note 1) 0: Disabled 1: Enabled Port P6 slew rate control bit (Note 1) 0: Disabled 1: Enabled Port P7 slew rate control bit (Note 1) 0: Disabled 1: Enabled Port P8 slew rate control bit (Note 1) 0: Disabled 1: Enabled Port P2 input level select bit 0: Reduced VIHL level input (Note 2) 1: CMOS level input Master CPU bus input level select bit 0: CMOS level input 1: TTLlevel input Notes 1: The slew rate function can reduce di/dt by modifying an internal buffer structure. 2: The characteristics of VIHL level is basically the same as that of TTL level. But, its switching center point is a little higher than TTL’s. Refer to section “Recommended operating conditions”. b0b7 Port P2 pull-up control register (address 001216) PUP2 b0b7 Port P20 pull-up control bit 0: Disabled 1: Enabled Port P2 1 pull-up control bit 0: Disabled 1: Enabled Port P2 2 pull-up control bit 0: Disabled 1: Enabled Port P2 3 pull-up control bit 0: Disabled 1: Enabled Port P2 4 pull-up control bit 0: Disabled 1: Enabled Port P2 5 pull-up control bit 0: Disabled 1: Enabled Port P2 6 pull-up control bit 0: Disabled 1: Enabled Port P2 7 pull-up control bit 0: Disabled 1: Enabled
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. Table 6 List of I/O port function Name Port P0 Port P1 Port P2 Input/Output Input/Output, individual bits I/O format CMOS input level CMOS 3-state output Non-port function Lower address output Higher address output Data bus I/O Related SFRs CPU mode register A Port control register Ref. No. (1) P00/AB0– P07/AB7 P10/AB8– P17/AB15 P20/DB0– P27/DB7 P60/DQ0– P67/DQ7 Pin (2)CPU mode register A Port control register Port P2 pull-up control register CPU mode register A CPU mode register B Port control register CPU mode register A CPU mode register B Port control register Timer X mode register Timer Y mode register Interrupt polarity select register CPU mode register A Port control register Clock control register Timer 123 mode register Data bus buffer control register 0 Port control register Control signal I/O CMOS input level/VIHL input level CMOS 3-state output Port P3 (1) (3) (4) (5) CMOS input level CMOS 3-state output 0/RDY – P37/RD P40/EDMA, Port P4 P41/INT0, P42/INT1, P43/CNTR 0, P44/CNTR 1 Control signal I/O External interrupt 0/XCIN, P51/TOUT / XCOUT CMOS input level CMOS 3-state output (6) (7) Timer 1, Timer 2 output pin Sub-clock generat- ing input pin P52/OBF0, P53/IBF0, P54/S0, P55/A0, P56/R(E), P57/W(R/W) Port P5 CMOS input level CMOS 3-state output CMOS input level/TTL input level in Master CPU bus inferface function (8) (9) (10) CMOS input level/TTL input level CMOS 3-state output CMOS input level CMOS 3-state output CMOS input level CMOS 3-state output CMOS input level/TTL input level in Master CPU bus inferface function CMOS input level CMOS 3-state output (11)Data bus buffer control register 0 Port control register USB control register Port control register Data bus buffer control register 1 Port control register CPU mode register B P70/SOF, Port P6 Port P7 P71/HOLD, P72/S1, P73/IBF1/ HLDA, P74/OBF1 (12) (13) (14) (15) (16) Master CPU bus interface I/O pin Master CPU bus interface I/O pin USB function output pin Control signal I/O Master CPU bus interface I/O pin (17) (18) (19) (20) (21) (22) (23) (24) UART1, 2 control registers Serial I/O control register 1 Serial I/O control register 2 Port control register Serial I/O I/O pin UART2 I/O pin UART1 I/O pin 0/UTXD 2/ SRDY, P81/URXD 2/ SCLK, P82/CTS2/ SRXD, P83/RTS2/ STXD, P84/UTXD 1, P85/URXD 1, P86/CTS1, P87/RTS1 Port P8 Notes 1: For details of the ports functions in modes other than single-chip mode, and how to use double-function ports as function I/O ports, refer to the applicable sections. 2: 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 rush current will flow from VCC to VSS through the input-stage gate.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 12 Port block diagram (1) P o r t s P P P D a t a b u s D i r e c t i o n r e g i s t e r Port latch P o r t P D a t a b u s Direction register Port latch Expanded data memory access bit E D M A s i g n a l (5) Ports P43, P44 D a t a b u s D i r e c t i o n r e g i s t e r P o r t l a t c h T i m e r c o u n t e n a b l e d Pulse output mode selected Timers X, Y output C N T R 0, C N T R 1 i n p u t P o r t P Data bus Direction register Port latch P p u l l u p Key interrupt input P o r t s P 41, P D a t a b u s Direction register Port latch S u b c l o c k XC I N - XC O U s t o p b i t INT0, INT1 interrupt input (6) Port P50 D a t a b u s Direction register Port latch XC I N i n p u t
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 13 Port block diagram (2) SOF signal (7) Port P51 Data bus Direction register Port latch TOUT output control bit Timer 1, 2 output IBF0 output enable bit Data bus Direction register Port latch IBF0 output (9) Port P53 (11) Port P6 Write to Master CPU bus interface Read from Master CPU bus interface Data bus Direction register Port latch DBBOUT 0 DBBS 0 DBBOUT 1 DBBS 1 DBBIN 0 DBBIN 1 (8) Port P52 Data bus Direction register Port latch OBF 0 output (10) Ports P54 to P57 Data bus Direction register Port latch Master CPU bus interface enable bit Master CPU bus functions input ✻ (12) Port P70 Data bus Direction register Port latch USB SOF port select bit ✻ : Ports P54 to P57 functions Pin name P54 P55 P56 P57 Functions S R(E) W(R/W) Read from Master CPU bus interface Write to Master CPU bus interface OBF 0 output enable bit XCOUT output XCOUT oscillation drive disable bit Sub-clock (XCIN-XCOUT ) stop bit
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 14 Port block diagram (3) H O L D S1 H L D A P o r t P D a t a b u s D i r e c t i o n r e g i s t e r P o r t l a t c h H O L D f u n c t i o n e n a b l e b i t H O L D f u n c t i o n e n a b l e b i t P o r t P I B F 1 o u t p u t e n a b l e b i t Data bus buffer function select bit H O L D f u n c t i o n e n a b l e b i t Direction register P o r t l a t c h I B F1 o u t p u t Data bus (17) Port P80 D i r e c t i o n r e g i s t e r P o r t l a t c hData bus S R D Y o u t p u t s e l e c t b i t U A R T T r a n s m i t e n a b l e b i t S R D Y o u t p u t S P I m o d e s e l e c t b i t SPI mode select bit C o n t r o l f o r S P I c o m p a t i b l e m o d e U A R T U T X D o u t p u t Data bus buffer function select bit P o r t P Data bus D i r e c t i o n r e g i s t e r P o r t l a t c h Data bus buffer function select bit D a t a b u s b u f f e r f u n c t i o n s e l e c t b i t P o r t P Data bus D i r e c t i o n r e g i s t e r Port latch O B o u t p u t e n a b l e b i t O B F1 o u t p u t (18) Port P81 Data bus Direction register Port latch (Serial I/O) Internal synchronous clock select bits Serial I/O port select bit (UART2) Receive enable bit U A R T R e c e i v e e n a b l e b i t (Serial I/O) Internal synchronous clock select bits (UART2) Receive enable bit (UART2) URXD2 input Serial I/O clock input Serial I/O clock output
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 15 Port block diagram (4) P o r t P D a t a b u s D i r e c t i o n r e g i s t e r P o r t l a t c h S e r i a l I O S R X D i n p u t e n a b l e b i t U A R T C T S f u n c t i o n e n a b l e b i t P o r t l a t c h U A R T C T S f u n c t i o n e n a b l e b i t (UART2) CTS2 input S e r i a l I O S R X D i n p u t P o r t P D a t a b u s P o r t l a t c h Direction register U A R T T r a n s m i t e n a b l e b i t U A R T U T X D o u t p u t P o r t P D a t a b u s Direction register U A R T C T S f u n c t i o n e n a b l e b i t P o r t l a t c h U A R T C T i n p u t P o r t P D a t a b u s D i r e c t i o n r e g i s t e r U A R T R T S f u n c t i o n e n a b l e b i t P o r t l a t c h Transmit completed signal Serial I/O port select bit S T X D o u t p u t c h a n n e l c o n t r o l b i t S e r i a l I O S T X D o u t p u t U A R T R T i n p u t P o r t P Data bus Direction register Port latch (UART1) Receive enable bit (UART1) URXD1 input P o r t P D a t a b u s Direction register (UART1) RTS function enable bit Port latch U A R T R T o u t p u t
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. INTERRUPTS There are twenty-four interrupt sources: five externals, eighteen internals, and one software. Interrupt Control Each interrupt except the BRK instruction interrupt has both an Inter- rupt Request Bit and an Interrupt Enable Bit, and is controlled by the Interrupt Disable Flag (I). 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 Re- quest Bits can be cleared by software, but cannot be set by software. Additionally, an active edge of INT 1 and INT2 can be selected by using the interrupt edge select register (address 001116); an active edge of CNTR0 can be done by using the timer X mode register (address 002716); an active edge of CNTR1 can be done by using the timer Y mode register (address 002816). The BRK instruction interrupt and reset cannot be disabled with any flag or bit. The I Flag disables all interrupts except the BRK instruc- tion interrupt and reset. If several interrupts requests occur at the same time, the interrupt with the highest priority is accepted first. Interrupt Operation When an interrupt request occurs, the following operations are auto- matically performed: 1. The processing being executed is stopped. 2. The contents of the program counter and processor status reg- ister are automatically pushed onto the stack. 3. The Interrupt Disable Flag is set and the corresponding in- terrupt request bit is cleared. 4. The interrupt jump destination address is read from the vector table into the program counter. I Notes When setting the followings, the interrupt request bit may be set to “1”.
- When setting external interrupt active edge Related register: Interrupt polarity select register (address 001116) Timer X mode register (address 002716) Timer Y mode register (address 002816) When not requiring for the interrupt occurrence synchronized with these setting, take the following sequence. ➀ Set the corresponding Interrupt Enable Bit to “0” (disabled). ➁ Set the Interrupt Edge Select Bit (Active Edge Switch Bit). ➂ Set the corresponding Interrupt Request Bit to “0” after 1 or more instructions have been executed. ➃ Set the corresponding Interrupt Enable Bit to “1” (enabled). Fig. 16 Interrupt control I n t e r r u p t r e q u e s t b i t I n t e r r u p t e n a b l e b i t I n t e r r u p t d i s a b l e f l a g ( I ) BRK instruction Reset Interrupt request
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. Interrupt Source Reset (Note 3) USB function USB SOF INT INT1 DMAC0 DMAC1 UART1 receive buffer full UART1 transmit UART1 summing error UART2 receive buffer full UART2 transmit UART2 summing error Timer X Timer Y Timer 1 Timer 2 Timer 3 CNTR CNTR 1 Serial I/O Input buffer full Output buffer empty Key input (Key- on wake-up) BRK instruction Priority Vector Addresses (Note 1) High FFFB FFF9 16 FFF7 16 FFF5 16 FFF3 16 FFF116 FFEF 16 FFED 16 FFEB 16 FFE9 16 FFE7 16 FFE5 16 FFE3 16 FFE1 16 FFDF 16 FFDD 16 FFDB 16 FFD9 16 FFD7 16 FFD5 16 FFD3 16 FFD1 16 FFCF 16 FFCD 16 FFCB 16 Interrupt Request Generating Conditions At reset (Note 2) At reception of SOF packet At detection of either rising or falling edge of INT 0 intput At detection of either rising or falling edge of INT1 input At completion of DMAC0 transfer At completion of DMAC1 transfer At completion of UART1 reception At completion of UART1 transmission At detection of UART1 summing error At completion of UART2 reception At completion of UART2 transmission At detection of UART2 summing error At timer X underflow At timer Y underflow At timer 1 underflow At timer 2 underflow At timer 3 underflow At detection of either rising or falling edge of CNTR 0 input At detection of either rising or falling edge of CNTR 1 input At completion of serial I/O transmission/re- ception At writing to input data bus buffer At reading from output data bus buffer At falling of port P2 input logical level AND At BRK instruction execution Remarks Non-maskable External interrupt (active edge selectable) External interrupt (active edge selectable) Low FFFA FFF8 16 FFF6 16 FFF4 16 FFF2 16 FFF0 16 FFEE 16 FFEC 16 FFEA 16 FFE8 16 FFE6 16 FFE4 16 FFE2 16 FFE0 16 FFDE 16 FFDC 16 FFDA 16 FFD8 16 FFD6 16 FFD4 16 FFD2 16 FFD0 16 FFCE 16 FFCC 16 FFCA 16 Notes 1: Vector addresses contain interrupt jump destination addresses. 2: USB function interrupt occurs owing to an interrupt request of the endpoint x (x = 0 to 4) IN, endpoint x OUT, overrun/underrun, USB reset or suspend/ resume. 3: Reset functions in the same way as an interrupt with the highest priority. Table 7 Interrupt vector addresses and priority External interrupt (active edge selectable) External interrupt (active edge selectable) External interrupt (falling valid) Non-maskable software interrupt
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 17 Structure of interrupt-related registers I n t e r r u p t r e q u e s t r e g i s t e r A ( a d d r e s s 0 0 0 21 I R E Q A U S B f u n c t i o n i n t e r r u p t r e q u e s t b i t U S B S O F i n t e r r u p t r e q u e s t b i t I N i n t e r r u p t r e q u e s t b i t I N i n t e r r u p t r e q u e s t b i t D M A C i n t e r r u p t r e q u e s t b i t D M A C i n t e r r u p t r e q u e s t b i t U A R T r e c e i v e b u f f e r f u l l i n t e r r u p t r e q u e s t b i t U A R T t r a n s m i t i n t e r r u p t r e q u e s t b i t b7 b0 I n t e r r u p t p o l a r i t y s e l e c t r e g i s t e r ( a d d r e s s I P O L I N T0 i n t e r r u p t e d g e s e l e c t b i t I N i n t e r r u p t e d g e s e l e c t b i t R e s e r v e d b i t s a t r e a d w r i t e 0 : F a l l i n g e d g e a c t i v e R i s i n g e d g e a c t i v e b 7 b 0 0 : Interrupts disabled 1 : Interrupts enabled 0 : N o i n t e r r u p t r e q u e s t i s s u e d I n t e r r u p t r e q u e s t i s s u e d Interrupt request register B address (address 000316) IREQB UART 1 summ ing error interrupt request bit UART2 receive buffer full interrupt request bit UART2 transmit interrupt request bit UART2 summing error interrupt request bit Timer X interrupt request bit Timer Y interrupt request bit Timer 1 interrupt request bit Timer 2 interrupt request bit b7 b 0 0 : N o interrupt request issued 1 : Interrupt request issued Interrupt control register A (address 000516) ICONA USB function interrupt enable bit USB SOF interrupt enable bit INT 0 interrupt enable bit INT1 interrupt enable bit DMAC0 interrupt enable bit DMAC1 interrupt enable bit UART1 receive buffer full interrupt enable bit UART1 transmit interrupt enable bit b7 b 0 I n t e r r u p t r e q u e s t r e g i s t e r C ( a d d r e s s 0 0 0 41 I R E Q C T i m e r 3 i n t e r r u p t r e q u e s t b i t C N T R 0 i n t e r r u p t r e q u e s t b i t C N T R 1 i n t e r r u p t r e q u e s t b i t S e r i a l I O i n t e r r u p t r e q u e s t b i t I n p u t b u f f e r f u l l i n t e r r u p t r e q u e s t b i t O u t p u t b u f f e r e m p t y i n t e r r u p t r e q u e s t b i t K e y i n p u t i n t e r r u p t r e q u e s t b i t R e s e r v e d b i t a t r e a d w r i t e b 7 b 0 0 : N o i n t e r r u p t r e q u e s t i s s u e d I n t e r r u p t r e q u e s t i s s u e d I n t e r r u p t c o n t r o l r e g i s t e r B ( a d d r e s s 0 0 0 61 I C O N B UART 1 summ ing error interrupt enable bit UART2 receive buffer full interrupt enable bit UART2 transmit interrupt enable bit UART2 summing error interrupt enable bit Timer X interrupt enable bit Timer Y interrupt enable bit Timer 1 interrupt enable bit Timer 2 interrupt enable bit b 7 b 0 0 : I n t e r r u p t s d i s a b l e d I n t e r r u p t s e n a b l e d Interrupt control register C (address 000716) IREQC Timer 3 interrupt enable bit CNTR 0 interrupt enable bit CNTR 1 interrupt enable bit Serial I/O interrupt enable bit Input buffer full interrupt enable bit Output buffer empty interrupt enable bit Key input interrupt enable bit Reserved bit (“0” at read/write) b7 b0 0 : Interrupts disabled 1 : Interrupts enabled 000000
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. Key Input Interrupt (Key-on Wake-Up) A key input interrupt request is generated by applying “L” level to any pin of port P2 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 of using a key input interrupt is shown in Figure 18, where an inter- rupt request is generated by pressing one of the keys consisted as an active-low key matrix which inputs to ports P2 0–P24. Fig. 18 Connection example when using key input interrupt and port P2 block diagram ✻✻ ✻ P o r t P 27 l a t c h P o r t P 27 d i r e c t i o n r e g i s t e r P 27 o u t p u t P o r t P 2 p u l l - u p c o n t r o l r e g i s t e r B i t Port PXx “L” level output K e y i n p u t i n t e r r u p t r e q u e s t F a l l i n g e d g e d e t e c t o r P26 output P 25 o u t p u t P24 input P 23 i n p u t P 22 i n p u t P 21 i n p u t P 20 i n p u t ✻✻ ✻ P o r t P 26 l a t c h Port P26 direction register = “1” P o r t P 2 p u l l - u p c o n t r o l r e g i s t e r B i t F a l l i n g e d g e d e t e c t o r ✻✻ ✻ P o r t P 25 l a t c h Port P25 direction register = “1” P o r t P 2 p u l l - u p c o n t r o l r e g i s t e r B i t F a l l i n g e d g e d e t e c t o r ✻✻ ✻ P o r t P 24 l a t c h P o r t P 24 d i r e c t i o n r e g i s t e r P o r t P 2 p u l l - u p c o n t r o l r e g i s t e r B i t F a l l i n g e d g e d e t e c t o r ✻ P o r t P 23 l a t c h P o r t P 23 d i r e c t i o n r e g i s t e r Port P2 pull-up control register Bit 3 = “0” F a l l i n g e d g e d e t e c t o r ✻ Port P22 latch Port P22 direction register = “0” Port P2 pull-up control register Bit 2 = “0” F a l l i n g e d g e d e t e c t o r ✻ Port P21 latch P o r t P 21 d i r e c t i o n r e g i s t e r P o r t P 2 p u l l - u p c o n t r o l r e g i s t e r B i t Falling edge detector ✻ P o r t P 20 l a t c h P o r t P 2 p u l l - u p c o n t r o l r e g i s t e r B i t F a l l i n g e d g e d e t e c t o r P o r t P 20 d i r e c t i o n r e g i s t e r Port P2 Input reading circuit ✻ P-channel transistor for pull-up ✻✻ CMOS output buffer
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. TIMERS The 7641 group has five timers: timer X, timer Y , timer 1, timer 2, and timer 3. Timer X and timer Y are 16-bit timers, and timer 1, timer 2, and timer 3 are 8-bit timers. All timers are down count timers. When the timer reaches “00 16” or “000016”, an underflow 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”. Read and write operation on 16-bit timer must be performed for both high and low-order bytes. When reading a 16-bit timer, read the high-order byte first. When writing to a 16-bit timer, write the low-order byte first. The 16-bit timer cannot perform the correct operation when reading during the write operation, or when writing during the read operation. Fig. 19 Timer block diagram P44/CNTR 1 P43/CNTR 0 Q T SCSGCLK Q T S P51/TOUT /XCOUT Timer X (low) (8) Timer X (high) (8) Timer X (low) latch (8)Timer X (high) latch (8) φ / 8 φ / 16 φ / 32 φ / 64 Timer X internal clock select bit Timer X count source select bits Timer X operating mode bits “00” “01” Timer X count stop bit “11” “10” “0” “1” 4 direction register CNTR 0 active edge switch bit CNTR 0 active edge switch bit P43 latch Pulse output mode Pulse output mode Q “0” “1” Falling edge detection Rising edge detection Pulse width HL continuously measurement mode Pulse width HL continuously measurement, Period measurement modes Timer X interrupt request CNTR 0 interrupt request Timer X write control bit φ / 8 φ / 16 φ / 32 φ / 64 “00” “01” “11” CNTR 1 active edge switch bit “10” “0” “1” Timer mode, TY OUT output enabled Timer Y operating mode bits Timer Y count stop bit Timer Y (low) (8) Timer Y (high) (8) Timer Y (low) latch (8)Timer Y (low) high (8) Timer Y write control bit Q Timer mode, TY OUT output enabled CNTR 1 active edge switch bit “0” “1” Timer Y operating mode bits “00” “01” “10” “11” Timer Y interrupt request CNTR 1 interrupt request Timer 1 interrupt request Timer 2 interrupt request Timer 3 interrupt request Timer 1 count source select bit “0” “1” φ / 8 f(XCIN) / 2 Timer 1 count stop bit Timer 1 latch (8) Timer 1 (8) Timers 1, 2 write control bit Timers 1, 2 write control bit “0” “1” Timer 2 count source select bit Timer 2 latch (8) Timer 2 (8) φ TOUT output control bit “0” “1” TOUT output active edge switch bit TOUT output control bit TOUT source select bit Q T Q Q T Q Q T Q Q T Q TOUT output control bit “0” “1”TOUT output active edge switch bit φ / 8 Timer 3 count source select bit Timer 3 latch (8) Timer 3 (8) “0” “1”
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Som e parametric limits are subject to change. Fig. 20 Structure of timer X mode register Timer X Timer X is a 16-bit timer that can be selected in one of four modes. The timer X’s internal clock and count source can be selected and a write control is possible by using the timer X mode register. In all modes the count operation can halt by setting the Timer X Count Stop Bit to “1”. Additionally, each timer underflow sets the Interrupt Request Bit to “1”. (1) Timer Mode The timer counts the SCSGCLK (Special Count Source Genera- tor) or one of the internal clock φ divided by 8, 16, 32, 64. (2) Pulse Output Mode Each time the timer underflows, a signal output from the CNTR0 pin is inverted. Except for this, the operation in pulse output mode is the same as in timer mode. When the CNTR
0 Active Edge Switch Bit is “0”, the CNTR0 pin
starts pulses output beginning at “H ”; when this bit is “1”, the CNTR 0 pin starts pulses output beginning at “L”. When using a timer in this mode, set the port P43 direction regis- ter to output mode. (3) Event Counter Mode The timer counts signals input through the CNTR0 pin. Except for this, the operation in event counter mode is the same as in timer mode. When the CNTR
0 Active Edge Switch Bit is “0”, the rising edge is
counted; when this bit is “1”, the falling edge is counted. When using a timer in this mode, set the port P43 direction regis- ter to input mode. (4) Pulse Width Measurement Mode When the CNTR 0 Active Edge Switch Bit is “0”, the timer counts while the input signal of CNTR0 pin is at “H ”; when it is “1”, the timer counts while the input signal of CNTR0 pin is at “L”. The timer counts the SCSGCLK or one of the internal clock φ di- vided by 8, 16, 32, 64 as its count source. When using a timer in this mode, set the port P4 3 direction regis- ter to input mode. I Notes G Timer X Write Control If the Timer X Write Control Bit is “1”, when the value is written in the address of timer X, the value is loaded only in the latch. The value in the latch is loaded in timer X after timer X underflows. If the Timer X Write Control Bit is “0”, when the value is written in the address of timer X, the value is loaded in the timer X and the latch at the same time. When the value is to be written in latch only, unexpected value may be set in the high-order timer if the writing in high-order latch and the underflow of timer X are performed at the same timing. G CNTR
0 Interrupt Active Edge Selection
The CNTR 0 interrupt active edge depends on the selection of CNTR 0 Active Edge Switch Bit. T i m e r X m o d e r e g i s t e r a d d r e s s T X M T i m e r X w r i t e c o n t r o l b i t W r i t e v a l u e i n l a t c h a n d c o u n t e r W r i t e v a l u e i n l a t c h o n l y T i m e r X c o u n t s o u r c e s e l e c t b i t s b b φ φ φ φ T i m e r X i n t e r n a l c l o c k s e l e c t b i t φ n n S C S G C L K S p e c i a l C o u n t S o u r c e G e n e r a t o r T i m e r X o p e r a t i n g m o d e b i t s b b T i m e r m o d e P u l s e o u t p u t m o d e E v e n t c o u n t e r m o d e P u l s e w i d t h m e a s u r e m e n t m o d e C N T R 0 a c t i v e e d g e s w i t c h b i t C o u n t a t r i s i n g e d g e i n e v e n t c o u n t e r m o d e S t a r t f r o m H o u t p u t i n p u l s e o u t p u t m o d e M e a s u r e H p u l s e w i d t h i n p u l s e w i d t h m e a s u r e m e n t m o d e F a l l i n g e d g e a c t i v e f o r i n t e r r u p t C o u n t a t f a l l i n g e d g e i n e v e n t c o u n t e r m o d e S t a r t f r o m L o u t p u t i n p u l s e o u t p u t m o d e M e a s u r e L p u l s e w i d t h i n p u l s e w i d t h m e a s u r e m e n t m o d e R i s i n g e d g e a c t i v e f o r i n t e r r u p t T i m e r X c o u n t s t o p b i t C o u n t s t a r t C o u n t s t o p b
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Som e parametric limits are subject to change. Timer Y Timer Y is a 16-bit timer that can be selected in one of four modes. (1) Timer Mode The timer counts one of the internal clock φ divided by 8, 16, 32, 64. G TYOUT Output Function In the timer mode, a signal of which polarity is inverted each time the timer underflows is output from the CNTR 1 pin. This is enabled by setting the Timer Y Output Control Bit to “1”. When the CNTR 1 Active Edge Switch Bit is “0”, the CNTR1 pin starts pulses output beginning at “H ”; when this bit is “1”, the CNTR 1 pin starts pulses output beginning at “L”. When using a timer in this mode, set the port P44 direction regis- ter to output mode. (2) Period Measurement Mode CNTR 1 interrupt request is generated at a rising/falling edge of CNTR 1 pin input signal. Simultaneously, the value in timer Y latch is reloaded in timer Y and timer Y continues counting down. Ex- cept for the aforementioned operation, the operation in period measurement mode is the same as in timer mode. (The TY OUT output function is not usable.) The timer value just before the reloading at rising/falling of CNTR pin input signal is retained until the timer Y is read once after the reload. The rising/falling timing of CNTR 1 pin input signal is found by CNTR 1 interrupt. When the CNTR 1 Active Edge Switch Bit is “0”, the falling edge is detected; when this bit is “1”, the rising edge is detected. When using a timer in this mode, set the port P44 direction regis- ter to input mode. (3) Event Counter Mode The timer counts signals input through the CNTR1 pin. Except for this, the operation in event counter mode is the same as in timer mode. (The TY OUT output function is not usable.) When the CNTR 1 Active Edge Switch Bit is “0”, the rising edge is counted; when this bit is “1”, the falling edge is counted. When using a timer in this mode, set the port P44 direction regis- ter to input mode. (4) Pulse Width HL Continuously Measurement Mode CNTR 1 interrupt request is generated at both rising and falling edges of CNTR1 pin input signal. Except for this, the operation in pulse width HL continuously measurement mode is the same as in period measurement mode. When using a timer in this mode, set the port P4 4 direction regis- ter to input mode. Fig. 21 Structure of timer Y mode register I Notes G Timer Y Write Control If the Timer Y Write Control Bit is “1”, when the value is written in the address of timer Y , the value is loaded only in the latch. The value in the latch is loaded in timer Y after timer Y underflows. If the Timer Y Write Control Bit is “0”, when the value is written in the address of timer Y, the value is loaded in the timer Y and the latch at the same time. When the value is to be written in latch only, unexpected value may be set in the high-order timer if the writing in high-order latch and the underflow of timer Y are performed at the same timing. G CNTR
1 Interrupt Active Edge Selection
The CNTR 1 interrupt active edge depends on the selection of CNTR 1 Active Edge Switch Bit. However, in pulse width HL continuously measurement mode, CNTR 1 interrupt request is generated at both rising and falling edges of CNTR 1 pin input signal regardless of the setting of CNTR 1 Active Edge Switch Bit. T i m e r Y m o d e r e g i s t e r a d d r e s s T Y M T i m e r Y w r i t e c o n t r o l b i t W r i t e v a l u e i n l a t c h a n d c o u n t e r W r i t e v a l u e i n l a t c h o n l y T i m e r Y o u t p u t c o n t r o l b i t T YO U T o u t p u t d i s a b l e d T YO U T o u t p u t e n a b l e d T i m e r Y c o u n t s o u r c e s e l e c t b i t s b b φ φ φ φ T i m e r Y o p e r a t i n g m o d e b i t s b b T i m e r m o d e P e r i o d m e a s u r e m e n t m o d e E v e n t c o u n t e r m o d e P u l s e w i d t h H L c o n t i n u o u s l y m e a s u r e m e n t m o d e C N T R 1 a c t i v e e d g e s w i t c h b i t C o u n t a t r i s i n g e d g e i n e v e n t c o u n t e r m o d e M e a s u r e t h e f a l l i n g e d g e t o f a l l i n g e d g e p e r i o d i n p e r i o d m e a s u r e m e n t m o d e F a l l i n g e d g e a c t i v e f o r i n t e r r u p t S t a r t f r o m H o u t p u t f o r T YO U T s i g n a l C o u n t a t f a l l i n g e d g e i n e v e n t c o u n t e r m o d e M e a s u r e t h e r i s i n g e d g e t o r i s i n g e d g e p e r i o d i n p e r i o d m e a s u r e m e n t m o d e R i s i n g e d g e a c t i v e f o r i n t e r r u p t S t a r t f r o m L o u t p u t f o r T YO U T s i g n a l T i m e r Y c o u n t s t o p b i t C o u n t s t a r t C o u n t s t o p b
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Som e parametric limits are subject to change. Timer 1, Timer 2, Timer 3 Timer 1, timer 2, and timer 3 are 8-bit timers. The count source for each timer can be selected by timer 123 mode register. G Timers 1, 2 Write Control When the Timers 1, 2 Write Control Bit is “1” and the values are written in the address of timers 1 and 2, the values are loaded only in their latches. The values in the latches are loaded in timers 1 and 2 after timers 1 and 2 underflow. When the Timers 1, 2 Write Control Bit is “0” and the values are written in the address of timers 1 and 2, the values are loaded in the timers 1 and 2 and their latches at the same time. G Timers 1, 2 Output Control A signal of which polarity is inverted each time the timer selected by the T OUT Factor Select Bit underflows is output from the TOUT pin. This is enabled by setting the TOUT Output Control Bit to “1”. When the TOUT Output Active Edge Switch Bit is “0”, the TOUT pin starts pulses output beginning at “H ”; when this bit is “1”, the TOUT pin starts pulses output beginning at “L”. When using a timer in this mode, set the port P51 direction regis- ter to output mode. I Notes G Timer 1 to Timer 3 Switching of the count sources of timers 1 to 3 does not affect the values of reload latches. However, that may make count operation started. Therefore, write values again in the order of timers 1, 2 and then timer 3 after their count sources have been switched. G Timers 1, 2 Write Control When the value is to be written in latch only, unexpected value may be set in the timer if the writing in the latch and the timer un- derflow are performed at the same timing. Fig. 22 Structure of timer 123 mode register T i m e r m o d e r e g i s t e r a d d r e s s T M TO U T f a c t o r s e l e c t b i t T i m e r o u t p u t T i m e r o u t p u t T i m e r c o u n t s t o p b i t C o u n t s t a r t C o u n t s t o p T i m e r c o u n t s o u r c e s e l e c t b i t φ f XC I N ) T i m e r c o u n t s o u r c e s e l e c t b i t T i m e r o u t p u t φ T i m e r c o u n t s o u r c e s e l e c t b i t T i m e r o u t p u t φ TO U T o u t p u t a c t i v e e d g e s w i t c h b i t S t a r t a t H o u t p u t S t a r t a t L o u t p u t TO U T o u t p u t c o n t r o l b i t TO U T o u t p u t d i s a b l e d TO U T o u t p u t e n a b l e d Ti m e r s w r i t e c o n t r o l b i t W r i t e v a l u e i n l a t c h a n d c o u n t e r W r i t e v a l u e i n l a t c h o n l y b
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. SERIAL I/O The serial I/O can be used only for clock synchronous serial I/O. The transmitter and the receiver must use the same clock. If the internal clock is used, transfer is started by a write signal to the serial I/O shift register. [Serial I/O Control Register 1 (SIOCON1)] 002B [Serial I/O Control Register 2 (SIOCON2)] 002C16 Each of the serial I/O control registers 1 and 2 contains eight bits which control various serial I/O functions. Fig. 23 Structure of serial I/O control registers 1, 2 S e r i a l I O c o n t r o l r e g i s t e r a d d r e s s S I O C O N I n t e r n a l s y n c h r o n o u s c l o c k s e l e c t b i t s o t e b b b I n t e r n a l c l o c k d i v i d e d b y I n t e r n a l c l o c k d i v i d e d b y I n t e r n a l c l o c k d i v i d e d b y I n t e r n a l c l o c k d i v i d e d b y I n t e r n a l c l o c k d i v i d e d b y I n t e r n a l c l o c k d i v i d e d b y I n t e r n a l c l o c k d i v i d e d b y I n t e r n a l c l o c k d i v i d e d b y S e r i a l I O p o r t s e l e c t b i t I O p o r t S T X D S C L K s i g n a l o u t p u t S R D Y o u t p u t s e l e c t b i t I O p o r t S R D Y s i g n a l o u t p u t T r a n s f e r d i r e c t i o n s e l e c t b i t L S B f i r s t M S B f i r s t S y n c h r o n o u s c l o c k s e l e c t b i t E x t e r n a l c l o c k I n t e r n a l c l o c k ST X D o u t p u t c h a n n e l c o n t r o l b i t C M O S o u t p u t N c h a n n e l o p e n d r a i n o u t p u t Notes 1: The source of serial I/O internal synchronous clock can be selected by bit 1 of serial I/O control register 2. 2 : To set the slave mode, also set bit 4 of serial I/O control register 1 to “1”. b S e r i a l I O c o n t r o l r e g i s t e r a d d r e s s C 1 S I O C O N SPI mode select bit 0: Normal serial I/O mode 1: SPI compatible mode (Note 2) Serial I/O internal clock select bit 0: φ 1: SCSGCLK SRXD input enable bit 0: SRXD input disabed 1: SRXD input enabed Clock polarity select bit (CPoL) 0: SCLK starting at “L” 1: SCLK starting at “H” Clock phase select bit (CPha) 0: Serial transfer starting at falling edge of SRDY 1: Serial transfer starting afer a half cycle of SCLK passed at falling edge of SRDY Reserved bits (“0” at read/write) b 000
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 24 Block diagram of serial I/O SCSGCLK P81/URXD 2/SCLK P83/RTS2/STXD P 82/ C T S2/ S R X D P 80/ U T X D 2/ S R D Y D a t a b u s I n t e r n a l s y n c h r o n o u s c l o c k s e l e c t i o n b i t s φ Serial I/O internal clock select bit“ 1 ” “ 0 ” “0” “1” S e r i a l I / O i n t e r r u p t r e q u e s t S y n c h r o n i z a t i o n c i r c u i t S y n c h r o n o u s c l o c k s e l e c t b i t S R D Y o u t p u t s e l e c t b i t E x t e r n a l c l o c kP80 latch “ 1 ” “0” Serial I/O counter (3) Serial I/O shift register (8) SPI mode select bit P81 latch “ 0 ” “1” Serial I/O port select bit P83 latch “0” “ 1 ” Serial I/O port select bit“ 1 ” “ 0 ” S R X D i n p u t e n a b l e b i t D i v i d e r
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Serial I/O Normal Operation The serial I/O counter is set to “7” by writing operation to the serial I/O shift register (address 002A16). When the SRDY Output Select bit is “1”, the SRDY pin goes “L” after that writing. On the negative edge of the transfer clock the SRDY pin returns “H ” and the data of the first bit is transmitted from the STXD pin. The remaining data are done from the STXD pin bit by bit on each falling edge of the transfer clock. Additionally, the data is latched from the SRXD pin on each rising edge of the transfer clock and then the contents of the serial I/O shift register are shifted by one bit. When the internal system clock is selected as the transfer clock, the followings occur at counting eight transfer clocks:
- The serial I/O counter reaches “0”
- The transfer clock halts at “H ”
- The serial I/O interrupt request bit is set to “1”
- The STXD pin goes a high-impedance state after an 8-bit transfer is completed. When the external clock is selected as the transfer clock, the fol- lowings occur at counting eight transfer clocks:
- The serial I/O counter reaches “0”
- The serial I/O interrupt request bit is set to “1” In this case, the transfer clock needs to be controlled by the exter- nal source because the transfer clock does not halt. Additionally, the STXD pin does not go a high-impedance state after an 8-bit transfer is completed. Figure 25 shows serial I/O timing. Fig. 25 Serial I/O timing D 1D 0 D 2 D 3 D 4 D 5 D 6 D 7 First LastSTXD/SRXD Synchronizing clock SCLK (CPoL = 1, CPha =1 ) SCLK (CPoL = 0, CPha = 1) SCLK (CPoL = 1, CPha = 0) SCLK (CPoL = 0, CPha = 0) G Normal mode timing (LSB first) Transfer clock Synchronizing clock Serial I/O shift register write signal SRDY signal Serial I/O output STXD Serial I/O input SRXD (Note) Interrupt request bit is set to “1”. Note: When the internal clock is selected as the transfer clock, the STXD pin goes to a high-impedance state after transfer completion. G SPI compatible mode timing SRDY signal
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. SPI Compatible Mode Operation Setting the SPI Mode Select Bit (bit 0 of SIOCON2) puts the serial I/O in SPI compatible mode. The Synchronous Clock Select Bit (bit 6 of SIOCON1) determines whether the serial I/O is an SPI master or slave. When the external clock is selected (“0”), the se- rial I/O is in slave mode; When the internal clock is selected (“1”), the serial I/O is in master mode. In SPI compatible mode the SRXD pin functions as a MISO (Mas- ter In/Slave Out) pin and the STXD pin functions as a MOSI (Master Out/Slave In) pin. In slave mode the transmit data is output from the MISO pin and the receive data is input from the MISO pin. The SRD pin func- tions as the chip-select signal input pin from an external. In master mode the transmit data is output from the MOSI pin and the receive data is input from the MISO pin. The SRD pin func- tions as the chip-select signal output pin to an external. G Slave Mode Operation In slave mode of SPI compatible mode 4 types of clock polarity and clock phase can be usable by bits 3 and 4 of serial I/O control register 2. If the SRDY pin is held “H ”, the shift clock is inhibited, the serial I/ O counter is set to “7”. If the SRDY pin is held “L”, then the shift clock will start. Make sure during transfer to maintain the SRDY input at “L” and not to write data to the serial I/O counter. Figure 25 shows the serial I/O timing.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. UART1, UART2 The UART consists of two channels: UART1 and UART2. Each has a dedicated timer provided to generate transfer clocks and op- erates independently. Both UART1 and UART2 have the same functions. Twelve serial data transfer formats can be selected, and the trans- fer formats used by a transmitter and receiver must be identical. The transmit and receive shift registers each have a buffer, but the two buffers have the same address in a memory. Since the shift register cannot be written to or read from directly, transmit data is written to the transmit buffer register, and receive data is read from the receive buffer register. The transmit buffer register can also hold the next data to be transmitted, and the receive buffer register can hold a character while the next character is being received. The transfer speed (baud rate) is expression as follows: Transfer speed (baud rate) = fi / {(n + 1) ✕ 16 } n: The contents of UARTx (x = 1, 2) baud rate generator fi: Using UART clock prescaling select bits, select any one of φ, φ/ 8, φ/32, φ/256, SCSGCLK, SCSGCLK/8, SCSGCLK/32 and SCSGCLK/256 O E R PER FER 003416 003C 16 Receive buffer register 1 Receive buffer register 2 Receive shift register 1 Receive shift register 2 Address 0030 Address 003816 U A R T x m o d e r e g i s t e r UARTx control register A d d r e s s 0 0 3 31 A d d r e s s R e c e i v e b u f f e r f u l l f l a g ( R B F ) R e c e i v e b u f f e r f u l l i n t e r r u p t r e q u e s t U x R B F R e c e i v e s u m m i n g e r r o r i n t e r r u p t r e q u e s t U x E S SPdetector UART character length select bits 7 bits 8 b i t s 9 bits S T d e t e c t o r P 85/ U R X D 1 P 81/ U R X D 2/ S C L K P 84/ U T X D 1 P 80/ U T X D 2/ S R D Y S C S G C L K P r e s c a l e r 1 / 2 5 6 Baud rate generator S T / S P / P A g e n e r a t o r Clock control circuit 1 / 1 6 A d d r e s s e s 0 0 3 51 A d d r e s s e s D 1 P 86/ C T S1 P 82/ C T S2/ S R X D RTS control registerP87/RTS1 P83/RTS2/STXD Frequency division ratio 1/(n+1) A d d r e s s e s 0 0 3 6 A d d r e s s e s A d d r e s s e s 0 0 3 11 A d d r e s s e s Character length select bit T r a n s m i t s h i f t r e g i s t e r 1 T r a n s m i t s h i f t r e g i s t e r T r a n s m i t b u f f e r r e g i s t e r 1 T r a n s m i t b u f f e r r e g i s t e r T r a n s m i t c o m p l e f l a g T C M Transmit interrupt source select bit Transmit interrupt request (UxTX) T r a n s m i t b u f f e r e m p t y f l a g T B E )UART status register Data bus Data bus φ UART clock prescaling select bits U A R T c l o c k s e l e c t b i t 003416 003C 16 A d d r e s s e s 0 0 3 51 A d d r e s s e s D 1 Address 003216 Address 003A16 Fig. 26 UARTx (x = 1, 2) block diagram
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. CTS (Clear-to-Send) Function As a transmitter, the UART can be configured to recognize the Clear-to-Send (CTSx) input as a handshaking signal. This is en- abled by setting the CTS Function Enable Bit (bit 5 of UxCON) to “1”. If CTS function is enabled, even when transmission is enabled and the UARTx transmit buffer register is filled with the data, the transmission never starts; but it will start when inputting “L” to the CTSx pin. Figures 27 and 28 show the UARTx transmit timings. U T X D o u t p u t ( P 84/ U T X D 1, P 80/ U T X D 2/ S R D Y ) D 0 D 1 SPS T D 2 D 3 D 4 D 5 D 6 D 7 P ST S PD 0 D 1 D 2 D 3 D 4 D 5 D 6 D 7 P C T S x p i n P 86/ C T S1, P 82/ C T S2/ S R X D T r a n s f e r c l o c k T r a n m i t e n a b l e b i t T r a n s m i t b u f f e r e m p t y f l a g T r a n s m i t c o m p l e t e f l a g Data set into UARTx transmit buffer register 1 Data transferring from UARTx transmit buffer register 1 to Transmit shift register 1 Halt due to CTS = “H ” Halt due to Tranmit enable bit = “0” T h i s t i m i n g a p p l y i n g t o t h e c o n d i t i o n s C h a r a c t e r l e n g t h b i t s P a r i t y e n a b l e d s t o p b i t UART Receive Operation Reception is enabled when the Receive Enable Bit is “1”. Detec- tion of the start bit makes transfer clocks generated and the data reception starts in the LSB first. When using 9-bit character length, read the received data from the UARTx receive buffer register 2 (high-order byte) first before the UARTx receive buffer register 1 (low-order byte). Reception requires the following setup: (1) Define a baud rate by setting a value n (n = 0 to 255) into UARTx baud rate generator (addresses 0031 16, 003916). (2) Set the Receive Initialization Bit (bit 3 of UxCON) to “1”. (3) Configure the data format and clock selection by setting the UARTx mode register. (4) Set the RTS Function Enable Bit (bit 5 of UxCON) if RTS func- tion will be used. (5) Set the Receive Enable Bit (bit 1 of UxCON) to “1”. Fig. 27 UARTx transmit timing (CTS function enabled) UART Transmit Operation Transmission starts when the Transmit Enable Bit is “1” and the Transmit Buffer Empty Flag is “0”. Additionally, when CTS function enabled, the CTSx pin must be “L” to be started. The data in which Start Bit and Stop Bit or Parity Bit are also added is transmitted from the low-order byte sequentially. When using 9-bit character length, set the data into the UARTx transmit buffer register 2 (high-order byte) first before the UARTx transmit buffer register 1 (low-order byte). Once the transmission starts, the Transmit Enable Bit, the Trans- mit Buffer Empty Flag and the CTSx pin state (when this is enabled) could not be checked until the transmission in progress has ended. Transmission requires the following setup: (1) Define a baud rate by setting a value n (n = 0 to 255) into UARTx baud rate generator (addresses 0031 16, 003916). (2) Set the Transmit Initialization Bit (bit 2 of UxCON) to “1”. This will set the UARTx status register to “0316”. (3) Select the interrupt source with the Transmit Interrupt Source Select Bit (bit 4 of UxCON). (4) Configure the data format and clock selection by setting the UARTx mode register. (5) Set the CTS Function Enable Bit (bit 5 of UxCON) if CTS func- tion will be used. (6) Set the Transmit Enable Bit (bit 0 of UxCON) to “1”. If updating a value of UARTx baud rate generator while the data is being transmitted, be sure to disable the transmission before up- dating. If the former data remains in the UARTx transmit buffer registers 1 and 2 at retransmission, an undefined data might be output.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. UTXD output (P84/UTXD 1, P80/UTXD 2/SRDY) D 0 D 1 SPST D 2 D 3 D 4 D 5 D 6 D 7 P SP T r a n s f e r c l o c k T r a n m i t e n a b l e b i t T r a n s m i t b u f f e r e m p t y f l a g T r a n s m i t c o m p l e t e f l a g D 0 D 1 D 2 D 3 D 4 D 5 D 6 D 7ST P D 0 D 1ST D a t a s e t i n t o U A R T x t r a n s m i t b u f f e r r e g i s t e r Data transferring from UARTx transmit buffer register 1 to Transmit shift register 1 This timing applies to the conditions:
- Character length = 8 bits
- Parity enabled
- 1 stop bit RTS (Request-to-Send) Function As a receiver, the UART can be configured to generate the Re- quest-to-Send (RTSx) handshaking signal. This is enabled by setting the RTS Function Enable Bit (bit 6 of UxCON) to “1”. When reception is enabled, that is the Receive Enable Bit is “1”, the RTSx pin goes “L” to inform a transmitter that reception is pos- sible. The RTSx pin goes “H” at reception starting and does “L” at receiving of the last bit. The delay time from the reception of the last stop bit to the asser- tion of RTSx is selectable using the RTS Assertion Delay Count Select Bits. BRGx (x = 1, 2) count source D 0URXD (P8 5/URXD 1, P81/URXD 2/SCLK) ST SPD 1 D 7 RTSx pin (P87/RTS1, P83/RTS2/STXD) Receive enable bit Receive buffer empty flag Transfer clock Transfer clock generated at falling edge of start bit and receive started Receive data latched Data transferring from UARTx receive register 1 to Receive buffer register 1 (Note) Note:When no RTS assertion delay, the RTSx pin goes “L”. The RTS assertion delay counts are selected by bits 4 to 7 of UARTx RTS control register. This timing applies to the conditions:
- Character length = 8 bits
- Parity enabled
- 1 stop bit Fig. 28 UARTx transmit timing (CTS function disbled) When the Receive Enable Bit is set to “0” or the Receive initializa- tion bit is set to “1”, the RTSx pin goes “H ”. Even when the Receive Enable Bit is set to “1”, the RTSx pin goes “H ” if detecting an invalid start bit. Figure 29 shows the UARTx receive timing. Fig. 29 UARTx transmit timing (RTS function enabled)
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. UART Address Mode The UART address mode is intended for use to communicate be- tween the specified MCUs in a multi-MCU environment. The UART address mode can be used in either an 8-bit or 9-bit char- acter length. An address is identified by the MSB of the incoming data being “1”. The bit is “0” for non-address data. When the MSB of the incoming data is “0” in the UART address mode, the Receive Buffer Full Flag is set to “1”, but the Receive Buffer Full Interrupt Request Bit is not set to “1”. When the MSB of the incoming data is “1”, normal receive operation is performed. In the UART address mode an overrun error is not detected for re- ception of the 2nd and onward bytes. An occurrence of framing error or parity error sets the Summing Error Interrupt Request Bit to “1” and the data is not received independent of its MSB con- tents. Usage of UART address mode is explained as follows: (1) Set the UART Address Mode Enable Bit to “1”. (2) Sends the address data of a slave MCU first from a host MCU to all slave MCUs. The MSB of address data must be “1” and the remaining 7 bits specify the address. (3) The all slave MCUs automatically check for the received data whether its stop bit is valid or not, and whether the parity error occurs or not (when the parity enabled). If these errors occur, the Framing Error Flag or Parity Error Flag and the Summing Error Flag are set to “1”. Then, the Summing Error Interrupt Request Bit is also set to “1”. (4) When received data has no error, the all slave MCUs must judge whether the address of the received address data matches with their own addresses by a program. After the MSB being “1” is received, the UART Address Mode Enable Bit is automatically set to “0” (disabled). (5) The UART Address Mode Enable Bit of the slave MCUs which have be judged that the address does not match with them must be set to “1” (enabled) again by a program to disable re- ception of the following data. (6) Transmit the data of which MSB is “0” from the host MCU. The slave MCUs disabling the UART address mode receive the data, and their Receive Buffer Full Flags and the Receive Buffer Full Interrupt Request Bits are set to “1”. For the other slave MCUs enabling the UART address mode, their Receive Buffer Full Flag are set to “1”, but their Receive Buffer Full In- terrupt Request Bits are not set to “1”. (7) An overrun error cannot be detected after the first data has been received in UART Address Mode. Accordingly, even if the slave MCUs does not read the received data and the next data has been received, an overrun error does not occur. Thus, a communication between a host MCU and the specified MCU can be realized. [UARTx (x = 1, 2) Mode Register (UxMOD)] 0030 16, 003816 The UART x mode register consists of 8 bits which set a transfer data format and an used clock. [UARTx (x = 1, 2) Baud Rate Generator (UxBRG)] 0031 16, 003916 The UARTx baud rate generator determines the baud rate for transfer. The baud rate generator divides the frequency of the count source by 1/(n + 1), where n is the value written to the baud rate genera- tor. The reset cannot affect the contents of baud rate generator. [UARTx (x = 1, 2) Status Register (UxSTS)] 0032 16, 003A16 The read-only UARTx status register consists of seven flags (bits 0 to 6) which indicate the UART operating status and various er- rors. When the UART address mode is enabled , the setting and clear- ing conditions of each flag differ from the following explanations. These differences are explained in section “UART Address Mode ”.
- Transmit complete flag (TCM) In the case where no data is contained in the transmit buffer reg- ister, the Transmit Complete Flag (TCM) is set to “1” when the last bit in the transmit shift register is transmitted. The TCM flag is also set to “1” at reset or initialization by setting the Transmit Initialization Bit (bit 2 of UxCON). It is set to “0” when transmission starts, and it is kept during the transmission.
- Transmit buffer empty flag (TBE) The Transmit Buffer Empty Flag (TBE) is set to “1” when the con- tents of the transmit buffer register are loaded into the transmit shift register. The TBE flag is also set “1” at the hardware reset or initialization by setting the Transmit Initialization Bit. It is set to “0” when a write operation is performed to the low-order byte of the transmit buffer register.
- Receive buffer full flag (RBF) The Receive Buffer Full Flag (RBF) is set to “1” when the last stop bit of the data is received. The RBF flag is set to “0” when the low- order byte of the receive buffer register is read, at the hardware reset or initialization by setting the Transmit Initialization Bit.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. G Receive Errors If there is an error, it is detected at the same time that data is transferred from the receive shift register to the receive buffer reg- ister, and the Receive Buffer Full Flag is set to “1”. The all error flags PER, FER, OER and SER are cleared to “0” when the UARTx status register is read, at the hardware reset or initializa- tion by setting the Transmit Initialization Bit. The Summing Error Flag (SER) is set to “1” when any one of the PER, FER and OER is set to “1”. The Parity Error Flag (PER) is set to “1” when the sum total of 1s of received data and the parity does not correspond with the se- lection with the Parity Select Bit (PMD). It is enabled only if the Parity Enable Bit (bit 5 of UxMOD) is set to “1”. The Framing Error Flag (FER) is set to “1” when the number of stop bit of the received data does not correspond with the selec- tion with the Stop Bit Length Select Bit (STB). The Overrun Flag Flag (OER) is set to “1” if the previous data in the low-order byte of the receive buffer register 1 (addresses 0034 16, 003C16) is not read before the current receive operation is completed. It is also set “1” if any one of error flags is “1” for the previous data and the current receive operation is completed. Be sure to read UARTx status register to clear the error flags before the next reception has been completed. [UARTx (x = 1, 2) Control Register (UxCON)] 0033 16, 003B16 The UARTx control register consists of eight control bits for the UARTx function. This register can enable the CTS, RTS and UART address mode. If the Transmit Enable Bit (TEN) is set to “0” (disabled) while a data is being transmitted, the transmitting operation will stop after the data has been transmitted. If the Receive Enable Bit (REN) is set to “0” (diabled) while a data is being received, the receiving operation will stop after the data has been received. When setting the Transmit Initialization Bit (TIN) to “1”, the TEN bit is set to “0” and the UARTx status register will be set to “03 16” af- ter the data has been transmitted. To retransmit, set the TEN to “1” and set a data to the transmit buffer register again. The TIN bit will be cleared to “0” one cycle later after the TIN bit has been set to “1”. Setting the Receive Initialization Bit (RIN) to “1” sets all of the REN, RBF and the receive error flags (PER, FER, OER, SER) to “0”. The RIN bit will be cleared to “0” one cycle later after the RIN bit has been set to “1”. When CTS or RTS function is disabled, pins CTS 1 and CTS2 or RTS 1 and RTS2 can be used as ordinary I/O ports, correspond- ingly. [UARTx Transmit/Receive Buffer Registers 1, 2 (UxTRB1/ UxTRB2)] 003416, 003516, 003C16, 003D16 The transmit buffer register and the receive buffer register are lo- cated at the same address. The transmit buffer register is write-only and the receive buffer register is read-only. If a charac- ter bit length is 7 bits, the MSB of received data is invalid. If a character bit length is 7 or 8 bits, the received contents of UxTRB2 are also invalid. If a character bit length is 9 bits, the received high-order 7 bits of UxTRB2 are “0”. [UARTx (x = 1, 2) RTS Control Register (UxRTS)] 003616, 003E 16 The delay time from the reception of the last stop bit to the asser- tion of RTSx is selectable using the RTS Assertion Delay Count Select Bits. If the stop bit is detected before RTS assertion delay time has expired, the RTSx pin is kept “H ”. The RTS assertion de- lay count starts after the last data reception is completed. Setting the RIN bit to “1” resets the UxRTS. After setting the RIN bit to “1”, set this UxRTS.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 30 Structure of UART related registers U A R T x m o d e r e g i s t e r a d d r e s s e s U x M O D U A R T c l o c k s e l e c t b i t C L K φ S C S G C L K U A R T c l o c k p r e s c a l i n g s e l e c t b i t s P S b b U A R T c l o c k d i v i d e d b y U A R T c l o c k d i v i d e d b y U A R T c l o c k d i v i d e d b y U A R T c l o c k d i v i d e d b y S t o p b i t l e n g t h s e l e c t b i t S T B s t o p b i t s t o p b i t s P a r i t y s e l e c t b i t P M D E v e n p a r i t y O d d p a r i t y P a r i t y e n a b l e b i t P E N P a r i t y c h e c k i n g d i s a b l e d P a r i t y c h e c k i n g e n a b l e d U A R T ch a r a c t e r l e n g t h s e l e c t b i t b b b i t s b i t s b i t s N o t a v a i l a b l e b U A R T x c o n t r o l r e g i s t e r a d d r e s s e s U x C O N Transmit enable bit (TEN) 0: Transmit disabled 1: Transmit enabled Receive enable bit (REN) 0: Receive disabled 1: Receive enabled Transmit initialization bit (TIN) 0: No action. 1: Initializing Receive initialization bit (RIN) 0: No action. 1: Initializing Transmit interrupt source select bit (TIS) 0: Interrupt when transmit buffer has emptied 1: Interrupt when transmit shift operation is completed CTS function enable bit (CTS_SEL) 0: CTS function disabled 1: CTS function enabled RTS function enable bit (RTS_SEL) 0: RTS function disabled 1: RTS function enabled UART address mode enable bit (AME) 0: Address mode disabled 1: Address mode enabled b U A R T x s t a t u s r e g i s t e r a d d r e s s e s U x S T S T r a n s m i t c o m p l e t e f l a g T C M T r a n s m i t s h i f t i n p r o g r e s s T r a n s m i t s h i f t c o m p l e t e d T r a n s m i t b u f f e r e m p t y f l a g T B E B u f f e r f u l l B u f f e r e m p t y R e c e i v e b u f f e r f u l l f l a g R B F B u f f e r e m p t y B u f f e r f u l l P a r i t y e r r o r f l a g P E R N o e r r o r P a r i t y e r r o r F r a m i n g e r r o r f l a g F E R N o e r r o r F r a m i n g e r r o r O v e r r u n e r r o r f l a g O E R N o e r r o r O v e r r u n e r r o r S u m m i n g e r r o r f l a g S E R F E R U O E R U S E R F E R U O E R U S E R R e s e r v e d b i t s a t r e a d w r i t e b0b7 U A R T x R T S c o n t r o l r e g i s t e r a d d r e s s e s U x R T S C Reserved bits (“0” at read/write) RTS assertion delay count select bits b7 b6 b5 b4 0 0 0 0 : No delay; Assertion immediately 0 0 0 1 : 8-bit term assertion at “H ” 0 0 1 0 : 16-bit term assertion at “H ” 0 0 1 1 : 24-bit term assertion at “H ” 0 1 0 0 : 32-bit term assertion at “H ” 0 1 0 1 : 40-bit term assertion at “H ” 0 1 1 0 : 48-bit term assertion at “H ” 0 1 1 1 : 56-bit term assertion at “H ” 1 0 0 0 : 64-bit term assertion at “H ” 1 0 0 1 : 72-bit term assertion at “H ” 1 0 1 0 : 80-bit term assertion at “H ” 1 0 1 1 : 88-bit term assertion at “H ” 1 1 0 0 : 96-bit term assertion at “H ” 1 1 0 1 : 104-bit term assertion at “H ” 1 1 1 0 : 112-bit term assertion at “H ” 1 1 1 1 : 120-bit term assertion at “H ” b0b7 0000
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 31 DMACx (x = 0, 1) block diagram DMAC The 7641 group is equipped with 2 channels of DMAC (direct memory access controller) which enable high speed data transfer from a memory to a memory without use of the CPU. The DMAC initiates the data transfer with an interrupt factor speci- fied by the DMAC channel x (x = 0, 1) hardware transfer request source bit (DxCEN), or with a software trigger. The DxTMS [DMA Channel x (x = 0, 1) Transfer Mode Selection Bit] selects one of two transfer modes; cycle steal mode or burst transfer mode. In the cycle steal mode, the DMAC transfers one byte of data for each request. In the burst transfer mode, the DMAC transfers the number of bytes data specified by the transfer count register for each request. The count register is a 16-bit counter; the maximum number of data is 65,536 bytes per one re- quest. Figure 31 shows the DMA control block diagram and Figure 32 shows the structure of DMAC related registers. [DMAC Index and Status Register] DMAIS The DMAC Index and Status Register consists of various control bits for the DMAC and its status flags. The DMA Channel Index Bit (DCI) selects which channel ( 0 or 1) will be accessed, since the mode registers, source registers, des- tination registers and transfer count register of both DMAC channels share the same SFR addresses, respectively. [DMAC Channel x (x = 0, 1) Mode Registers 1, 2] DMAxM1, DMAxM2 The 16 bits of DMAC Channel x Mode Registers 1 and 2 control each operation of DMAC channels 0 and 1. When the DMAC Channel x (x = 0, 1) Write Bit (DxDWC) is “0”, data is simultaneously written into each latch and register of the Source Registers, Destination Register, and Transfer Count Reg- isters. When this bit is “1”, data is written only into their latches. When data is read from each register, it must be read from the higher bytes first, then the lower bytes. When writing data, write to the lower bytes first, then the higher bytes. I n t e r r u p U A R T r e c e i v e U A R T t r a n s m i t S e r i a l I O I N T0, T i m e r Y C N T R 1 S i g n a O B E0, I B d a t a E P e n d p o i n t r e c e i v e t r a n s m i t E P e n d p o i n t r e c e i v e t r a n s m i t E P e n d p o i n t r e c e i v e t r a n s m i t E P O U T F I F O d a t a e x i s t i n g I n t e r r u p U A R T r e c e i v e U A R T t r a n s m i t S e r i a l I O I N T1, T i m e r T i m e r X C N T R 0 S i g n a O B E1, I B d a t a E P e n d p o i n t r e c e i v e t r a n s m i t E P e n d p o i n t r e c e i v e t r a n s m i t E P e n d p o i n t r e c e i v e t r a n s m i t E P O U T F I F O d a t a e x i s t i n g Case of DMAC channel 0 Case of DMAC channel 1 D M A C c h a n n e l X Channel X timing generator Channel X transfer source register Channel X transfer destination registerCh a n n e l X t r a n s f e r c o u n t r e g i s t e r I n t e r r u p t g e n e r a t o r D M A C x i n t e r r u p t r e q u e s t Address bus D x C E N D x C R R D x U M I E D x S W T D x H R S D x H R S D x H R S D x H R S DxSRCE DxSRID DxRLD D R L D D DxDRCE DxDRID DxRLD DRLDD I n t e r r u p t d i s a b l e f l a g I f l a g T e m p o r a r y r e g i s t e rI n d e x s t a t u s r e g i s t e r D x U F D x D A U E M o d e r e g i s t e r D x T M SD T S C Mode 2 register Ch a n n e l X t r a n s f e r s o u r c e l a t c h Channel X transfer destination latch Channel X transfer count latch D x D W CD x D W CD x D W C Data bus D a t a b u s D x U F D x S F I 50 1 50 1
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. D M A C in d e x a n d s t a t u s r e g i s t e r a d d r e s s D M A I S D M A C c h a n n e l c o u n t r e g i s t e r u n d e r f l o w f l a g D U F N o u n d e r f l o w U n d e r f l o w g e n e r a t e d D M A C c h a n n e l s u s p e n d f l a g D S F I N o t s u s p e n d e d S u s p e n d e d D M A C c h a n n e l c o u n t r e g i s t e r u n d e r f l o w f l a g D U F N o u n d e r f l o w U n d e r f l o w g e n e r a t e d D M A C c h a n n e l s u s p e n d f l a g D S F I N o t s u s p e n d e d S u s p e n d e d D M A C t r a n s f e r s u s p e n d c o n t r o l b i t D T S C S u s p e n d i n g o n l y b u r s t t r a n s f e r s d u r i n g i n t e r r u p t p r o c e s s S u s p e n d i n g b o t h b u r s t a n d c y c l e s t e a l t r a n s f e r s d u r i n g i n t e r r u p t p r o c e s s D M A C r e g i s t e r r e l o a d d i s a b l e b i t D R L D D E n a b l i n g r e l o a d o f s o u r c e a n d d e s t i n a t i o n r e g i s t e r s o f b o t h c h a n n e l s D i s a b l i n g r e l o a d o f s o u r c e a n d d e s t i n a t i o n r e g i s t e r s o f b o t h c h a n n e l s R e s e r v e d b i t a t r e a d w r i t e C h a n n e l i n d e x b i t D C I C h a n n e l a c c e s s i b l e C h a n n e l a c c e s s i b l e DMAC channel x mode register 1 (address 004016) DMAxM1 D M A C c h a n n e l x s o u r c e r e g i s t e r i n c r e m e n t d e c r e m e n t s e l e c t i o n b i t D x S R I D I n c r e m e n t a f t e r t r a n s f e r D e c r e m e n t a f t e r t r a n s f e r D M A C c h a n n e l x s o u r c e r e g i s t e r i n c r e m e n t d e c r e m e n t e n a b l e b i t D x S R C E I n c r e m e n t D e c r e m e n t d i s a b l e d N o c h a n g e a f t e r t r a n s f e r I n c r e m e n t D e c r e m e n t e n a b l e d D M A C c h a n n e l x d e s t i n a t i o n r e g i s t e r i n c r e m e n t d e c r e m e n t s e l e c t i o n b i t D x D R I D I n c r e m e n t a f t e r t r a n s f e r D e c r e m e n t a f t e r t r a n s f e r D M A C c h a n n e l x d e s t i n a t i o n r e g i s t e r i n c r e m e n t d e c r e m e n t e n a b l e b i t D x D R C E I n c r e m e n t D e c r e m e n t d i s a b l e d N o c h a n g e a f t e r t r a n s f e r I n c r e m e n t D e c r e m e n t e n a b l e d D M A C c h a n n e l x d a t a w r i t e c o n t r o l b i t D x D W C W r i t i n g d a t a i n r e l o a d l a t c h e s a n d r e g i s t e r s W r i t i n g d a t a i n r e l o a d l a t c h e s o n l y D M A C c h a n n e l x d i s a b l e a f t e r c o u n t r e g i s t e r u n d e r f l o w e n a b l e b i t D x D A U E C h a n n e l x e n a b l e d a f t e r c o u n t r e g i s t e r u n d e r f l o w B i t i s a l w a y s r e a d a s C h a n n e l x d i s a b l e d a f t e r c o u n t r e g i s t e r u n d e r f l o w D M A C c h a n n e l x r e g i s t e r r e l o a d b i t D x R L D N o t r e l o a d e d B i t i s a l w a y s r e a d a s S o u r c e d e s t i n a t i o n a n d t r a n s f e r c o u n t r e g i s t e r s c o n t e n t s o f c h a n n e l x t o b e r e l o a d e d D M A C c h a n n e l x t r a n s f e r m o d e s e l e c t i o n b i t D x T M S C y c l e s t e a l t r a n s f e r m o d e B u r s t t r a n s f e r m o d e D M A C c h a n n e l h a r d w a r e t r a n s f e r r e q u e s t s o u r c e b i t s D H R b b b b N o t u s e d U A R T r e c e i v e i n t e r r u p t U A R T t r a n s m i t i n t e r r u p t T i m e r Y i n t e r r u p t I N i n t e r r u p t U S B e n d p o i n t I N P K T R D Y s i g n a l f a l l i n g e d g e a c t i v e U S B e n d p o i n t I N P K T R D Y s i g n a l f a l l i n g e d g e a c t i v e U S B e n d p o i n t I N P K T R D Y s i g n a l f a l l i n g e d g e a c t i v e U S B e n d p o i n t O U T P K T R D Y s i g n a l r i s i n g e d g e a c t i v e U S B e n d p o i n t O U T F I F O N O T E M P T Y s i g n a l r i s i n g e d g e a c t i v e U S B e n d p o i n t O U T P K T R D Y s i g n a l r i s i n g e d g e a c t i v e U S B e n d p o i n t O U T P K T R D Y s i g n a l r i s i n g e d g e a c t i v e M a s t e r C P U b u s i n t e r f a c e O B s i g n a l r i s i n g e d g e a c t i v e M a s t e r C P U b u s i n t e r f a c e I B s i g n a l d a t a r i s i n g e d g e a c t i v e S e r i a l I O t r a s m i t r e c e i v e i n t e r r u p t C N T R 1 i n t e r r u p t D M A C c h a n n e l s o f t w a r e t r a n s f e r t r i g g e r D S W T N o a c t i o n B i t i s a l w a y s r e a d a s R e q u e s t o f c h a n n e l t r a n s f e r b y w r i t i n g o t e D M A C c h a n n e l U S B a n d m a s t e r C P U b u s i n t e r f a c e e n a b l e b i t D U M I E D i s a b l e d E n a b l e d D M A C c h a n n e l t r a n s f e r i n i t i a t i o n s o u r c e c a p t u r e r e g i s t e r r e s e t b i t D C R R N o a c t i o n B i t i s a l w a y s r e a d a s R e s e t o f c h a n n e l c a p t u r e r e g i s t e r b y w r i t i n g o t e D M A C c h a n n e l e n a b l e b i t D C E N C h a n n e l d i s a b l e d C h a n n e l e n a b l e d o t e D M A C c h a n n e l m o d e r e g i s t e r a d d r e s s D M A M DMAC channel 1 hardware transfer request source bits (D1HR) b3b2b1b0 0 0 0 0: Not used 0 0 0 1: UART2 receive interrupt 0 0 1 0: UART2 transmit interrupt 0 0 1 1: Timer X interrupt 0 1 0 0: INT 1 interrupt 0 1 0 1: USB endpoint 1 IN_PKT_RDY signal (falling edge active) 0 1 1 0: USB endpoint 2 IN_PKT_RDY signal (falling edge active) 0 1 1 1: USB endpoint 4 IN_PKT_RDY signal (falling edge active) 1 0 0 0: USB endpoint 1 OUT_PKT_RDY signal (rising edge active) 1 0 0 1: USB endpoint 1 OUT_FIFO_NOT_EMPTY signal (rising edge active) 1 0 1 0: USB endpoint 2 OUT_PKT_RDY signal (rising edge active) 1 0 1 1: USB endpoint 4 OUT_PKT_RDY signal (rising edge active) 1 1 0 0: Master CPU bus interface OBE1 signal (rising edge active) 1 1 0 1: Master CPU bus interface IBF1 signal, data (rising edge active) 1 1 1 0: Timer 1 trasmit/receive interrupt 1 1 1 1: CNTR 0 interrupt DMAC channel 1 software transfer trigger (D1SWT) 0: No action (Bit is always read as “0”) 1: Request of channel 0 transfer by writing “1” (Note 1) DMAC channel 1 USB and master CPU bus interface enable bit (D1UMIE) 0: Disabled 1: Enabled DMAC channel 1 transfer initiation source capture register reset bit (D1CRR) 0: No action (Bit is always read as “0”) 1: Reset of channel 1 capture register by writing “1” (Note 1) DMAC channel 1 enable bit (D1CEN) 0: Channel 0 disabled 1: Channel 0 enabled (Note 2) D M A C c h a n n e l m o d e r e g i s t e r a d d r e s s D M A M b 7 b0b b0b7b0b7 N o t e s T h i s b i t i s a u t o m a t i c a l l y c l e a r e d t o a f t e r w r i t i n g W h e n s e t t i n g t h i s b i t t o s i m u l t a n e o u s l y s e t t h e D M A C c h a n n e l x t r a n s f e r i n i t i a t i o n s o u r c e c a p t u r e r e g i s t e r r e s e t b i t b i t o f D M A x M t o Fig. 32 Structure of DMACx related register
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. (1) Cycle Steal Transfer Mode When the DMAC Channel x (x = 0, 1) Transfer Mode Selection Bit (DxTMS) is set to “0”, the respective DMAC Channel x operates in the cycle steal transfer mode. When a request of the specified transfer factor is generated, the selected channel transfers one byte of data from the address indi- cated by the Source Register into the address indicated by the Destination Register. There are two kinds of DMA transfer triggers supported: hardware transfer factor and software trigger. Hardware transfer factors can be selected by the DMACx (x = 0, 1) Hardware Transfer Request Factor Bit (DxHR). To only use the Interrupt Request Bit, the inter- rupt can be disabled by setting its Interrupt Enable Bit of Interrupt Control Register to “0”. The DMA transfer request as a software trigger can be generated by setting the DMA Channel x (x = 0, 1) Software Transfer Trigger Bit (DxSWT) to “1”. The Source Registers and Transfer Destination Registers can be either decreased or increased by 1 after transfer completion by setting bits 0 to 3 in the DMAC Channel x (x = 0, 1) Mode Regis- ter. When the Transfer Count Register underflows, the Source Registers and Destination Registers are reloaded from their latches if the DMAC Register Reload Disable Bit (DRLDD) is “0”. The Transfer Count Register value is reloaded after an underflow regardless of DRLDD setting. At the same time, the DMAC Inter- rupt Request Bit and the DMA Channel x (x = 0, 1) Count Register Underflow Flag are set to “1”. The DMAC Channel x Disable After Count Register Underflow En- able Bit (DxDAUE) is “1”, the DMAC Channel x Enable Bit (DxCEN) goes to “0” at an under flows of Transfer Count Register. By setting the DMAC Channel x (x = 0, 1) Register Reload Bit (DxRLD) to “1”, the Source Registers, Destination Registers, and Transfer Count Registers can be updated to the values in their re- spective latches. When one signal among USB endpoint signals is selected as the hardware transfer request factor, and DMAC Channel x (x = 0, 1) USB and Master CPU Bus Interface Enable Bit (DxUMIE) is “1”; transfer between the USB FIFO and the master CPU bus interface input/output buffer can be performed effectively. This transfer function is only valid in the cycle steal mode. To validate this func- tion, the DMAC Channel x (x = 0, 1) USB and the Master CPU Bus Interface Enable Bit (bit 5 of DxTR) must be set to “1”. The follow- ing shows an example of a transfer using this function. Packet Transfer from USB FIFO to Master CPU Bus Interface Buffer When the USB OUT_PKT_RDY is selected as the hardware trans- fer request factor; if the USB OUT_PKT_RDY is “1” and the master CPU bus interface output buffer is empty, the transfer re- quest is generated and the transfer is initiated. The OUT_PKT_RDY retains “1” and a transfer request is generated each time the output buffer empties until all the data in the corre- sponding endpoint FIFO has been transferred. The transfer ends when the last byte in the USB receive packet is transferred and the OUT_PKT_RDY flag goes to “0” (in the case of AUTO_CLR bit = “1”). Byte Transfer from USB FIFO to Master CPU Bus Interface Buffer When the USB Endpoint 1 OUT_FIFO_NOT_EMPTY is selected as a hardware transfer request factor, if there is data in the USB Endpoint 1 FIFO and the master CPU bus interface output buffer is empty; a transfer request is generated and the transfer is initi- ated. The transfer is performed by unit of one byte. Transfer from Master CPU Bus Interface Buffer to USB FIFO When the USB Endpoint X (X = 1 to 4) IN_PKT_RDY (IN_PKT_RDY = “0”) is selected as a hardware transfer request factor, if there is data in the master CPU bus interface output buffer and the data in the USB FIFO is within the specified packet size, a transfer request is generated. The DMA transfer is terminated when a command (A0 = “1”) is in- put to the master CPU bus interface input buffer. The timing chart for a cycle steal transfer caused by a hardware- related transfer request and a software trigger are shown in Figure 33 and 34, respectively.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. φ O U T S Y N C O U T R D WR A 5 A D L18 5 DMA data A D L2 A D L2, M A d e s t i n a t i o n a d d D M A s o u r c e a d d C 2AD L1, 00PC + 1P CP C 3 P C L D A z z STA $zz D M A t r a n s f e r STA $zz (last 2 cycles) D a t a D M AO U T P o r t P 33) A d d r e s s D a t a T r a n s f e r r e q u e s t s o u r c e L a c t i v e T r a n s f e r r e q u e s t s o u r c e s a m p l i n g R e s e t o f t r a n s f e r r e q u e s t s o u r c e s a m p l i n g N e x t i n s t r u c t i o n Op code 3D a t a D M A d a t a Fig. 33 Timing chart for cycle steal transfer caused by hardware-related transfer request 3C 18 41 90 42, 00PC + 2PC + 1PC PC + 3 PC + 4 L D M PC + 6PC + 5 φ O U T SYNC OUT R D W R D M AO U T P o r t P 33) Address Data T r a n s f e r r e q u e s t s o u r c e L a c t i v e T r a n s f e r r e q u e s t s o u r c e s a m p l i n g R e s e t o f t r a n s f e r r e q u e s t s o u r c e s a m p l i n g N e x t i n s t r u c t i o n 1 cycle instruction c y c l e i n s t r u c t i o n 1 cycle instruction D M A t r a n s f e r D M A d a t a D M A d e s t i n a t i o n a d d D M A s o u r c e a d d O p c o d e
2 D M A
d a t aO p code 3 O p c o d e
4 Op code 6
Fig. 34 Timing chart for cycle steal transfer caused by software trigger transfer request
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. (2) Burst Transfer Mode When the DMAC Channel x Transfer Mode Selection Bit (DxTMS) is set to “1”, the respective DMAC channel operates in the burst transfer mode. In the burst transfer mode, the DMAC continually transfers the number of bytes of data specified by the Transfer Count Register for one transfer request. Other than this, the burst transfer mode operation is the same as the cycle steal mode operation. Priority The DMAC places a higher priority on Channel-0 transfer requests than on Channel-1 transfer requests. If a Channel-0 transfer request occurs during a Channel-1 burst transfer operation, the DMAC completes the next transfer source and destination read/write operation first, and then starts the Channel-0 transfer operation. As soon as the Channel-0 transfer is completed, the DMAC resumes the Channel-1 transfer operation. When an interrupt request occurs during any DMA operation, the transfer operation is suspended and the interrupt process routine is initiated. During the interrupt operation, the DMAC automatically sets the corresponding DMAC Channel x (x = 0, 1) Flag to “1”. As soon as the CPU completes the interrupt operation, the DMAC clears the flag to “0” and resumes the original operation from the point where it was suspended. The suspended transfer due to the interrupt can also be resumed during its interrupt process routine by writing “1” to the DMAC Channel x (x = 0,1) Enable Bit (DxCEN). The timing charts for a burst transfer caused by a hardware-re- lated transfer request are shown in Figure 35. Fig. 35 Timing chart for burst transfer caused by hardware-related transfer request A5 AD L18 5 PC + 2AD L1, 00PC + 1PC P C L D A z z S T A z z F i r s t c y c l e STA $zz (Second cycle) φ O U T SYNC OUT R D WR D M AO U T P o r t P 33) Address D a t a T r a n s f e r r e q u e s t s o u r c e L a c t i v e T r a n s f e r r e q u e s t s o u r c e s a m p l i n g R e s e t o f t r a n s f e r r e q u e s t s o u r c e s a m p l i n g DMA transfer Data D M A d e s t i n a - t i o n a d d D M A s o u r c e a d d D M A d e s t i n a - t i o n a d d D M A s o u r c e a d d D M A d a t a D M A d a t a D M A d a t a DMA data 2 A D L2
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. USB FUNCTION The 7641 Group MCU is equipped with a USB Function Control Unit (USB FCU). This USB FCU allows the MCU to communicate with a host PC using a minimum amount of the MCU power. This built-in USB FCU complies with USB Standard Specification Ver- sion 1.1 that supports four transfer types: Control Transfer, Isochronous Transfer, Interrupt Transfer, and Bulk Transfer. This built-in USB FCU performs the data transfer error detection and transfer retry operation by hardware. The default transfer mode of the USB FCU is bulk transfer mode at reset. The user must set the USB FCU for the required transfer mode by software. The USB FCU has five endpoints (Endpoint 0 to Endpoint 4). The EPINDEX bit selects one of these five endpoints for the USB FCU to use. Each endpoint has IN (transmit) FIFO and OUT (receive) FIFO. To use the USB FCU, the USB enable bit (USBC7) must be set to “1”. There are two USB related interrupts supported for this MCU: USB Function Interrupt and USB SOF Interrupt. Figure 36 shows the USB FCU (USB Function Control Unit) block diagram. The USB FCU consists of the SIE (Serial Interface En- gine) performing the USB data transfer, GFI (Generic Function Interface) performing USB protocol handing, SIU (Serial Engine Interface Unit) performing a received address and endpoint de- coding, MCI (Microcontroller Interface) handling the MCU interface or performing address decoding and synchronization of control signals, and the USB transceiver. Microcontroller Interface Unit (MCI) S e r i a l E n g i n e I n t e r f a c e U n i t S I U Generic Function Interface (GFI) F I F O s Serial Interface Engine (SIE) T r a n s c e i v e r U S B D + U S B D - CPU Fig. 36 USB FCU (USB Function Control Unit) block
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. USB Transmission Endpoint 0 to Endpoint 4 have IN (transmit) FIFOs individually. Each endpoint’s FIFO is configured in following way: Endpoint 0: 16-byte Endpoint 1: Mode 0: 512-byte Mode 1: 1024-byte Mode 2: 0-byte Mode 3: 2048-byte Mode 4: 768-byte Mode 5: 880-byte Endpoint 2: Mode 0: 32-byte Mode 1: 128-byte Endpoint 3: 16-byte Endpoint 4: 16-byte When Endpoint 1 or Endpoint 2 is used for data transmit, the IN FIFO size can be selected. Endpoint 1 and Endpoint 2 have pro- grammable IN-FIFOs size; 6 modes for Endpoint 1, and 2 modes for Endpoint 2. Each mode can be selected by the USB endpoint FIFO mode selection register (address 005F 16). When writing data to the USB Endpoint-x FIFO (addresses 006016 to 006416) in the SFR area, the internal write pointer for the IN FIFO is automatically increased by 1. When the AUTO_SET bit is “1” and if the stored data reaches to the max. packet value set in USB Endpoint x IN max. packet size register (address 005B16), the USB FCU sets the IN_PKT_RDY bit to “1”. When the AUTO_SET bit is “0”, the IN_PKT_RDY bit will not be automati- cally set to “1”; it must be set to “1” by software. (The AUTO_SET bit function is not applicable to Endpoint 0.) The USB FCU transmits the data when it receives the next IN to- ken. The IN_PKT_RDY bit automatically goes to “0” when the data transfer is complete. G Isochronous transfer Endpoints 1 to 4 can be used in isochronous transfer mode. When using isochronous transfer mode, the ISO/TOGGLE_INIT bit must be set to “1”. When ISO_UPDATE = “1” and the corresponding endpoint’s ISO/TOGGLE_INIT bit = “1”, the USB FCU delays the rise of the IN_PKT_RDY bit until the next SOF signal transmis- sion. In this way, the USB FCU can synchronize a transmit data to the SOF signal. G Interrupt transfer mode Endpoints 1 to 4 can be used in interrupt transfer mode. During a regular interrupt transfer, an interrupt transaction is similar to the bulk transfer. Therefore, there is no special setting required. When IN-endpoint is used for a rate feedback interrupt transfer, INTPT bit of the IN_CSR register must be set to “1”. Once the INTPT bit is set, data toggling occurs every time a data packet is transmitted to the host, regardless of the handshake packet availability or type. The following steps show how to configure the IN-endpoint for the rate feedback interrupt transfer. 1. Set a value which is larger than 1/2 of the USB Endpoint-x FIFO size to the USB Endpoint x IN max. package size register. 2. Set INTPT bit to “1”. 3. Flush the old data in the FIFO. 4. Load interrupt status information and set IN_PKT_RDY bit to “1”. 5. Repeat steps 3 and 4. In a real application, the function-side always has transfer data when the function sends an endpoint in a rate feedback interrupt. Accordingly, the USB FCU never returns a NAK against the host IN token for the rate feedback interrupt. The USB FCU always transmits data in the FIFO in response to an IN token, regardless of IN_PKT_RDY. When MAXP size ≤ (a half of IN FIFO size), the IN FIFO can store two packets (called double buffer). At this time, the IN FIFO sta- tus can be checked by monitoring the IN_PKT_RDY bit and the TX_NOT_EPT flag. The TX_NOT_EPT flag is a read-only flag which shows the FIFO state. When IN_PKY_RDY = 0 and TX_NOT_EPT = 0, IN FIFO is empty. When IN_PKY_RDY = 0 and TX_NOT_EPT = 1, IN FIFO has one packet. In double buffer mode, as long as the IN FIFO is not filled with double packets, IN_PKT_RDY will not be set to “1”, even if it is set to “1” by software, but TX_NOT_EPT flag will be set to “1”. In single buffer mode, if MAXP > (a half of IN FIFO), this condition never occurs. When IN_PKT_RDY = “1” and TX_NOT_EPT = “1”, IN FIFO holds two packets in double buffer mode and one packet in single packet mode. In single packet mode, when the IN_PKT_RDY bit is set to “1” by software, the TX_NOT_EPT flag is set to “1” as well. During double buffer mode, if you want to load two packets se- quentially, you must set the IN_PKT_RDY bit to “1” each time a packet is loaded.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. USB Reception Endpoint 0 to Endpoint 4 have OUT (receive) FIFOs individually. Each endpoint’s FIFO is configured in following way: Endpoint 0: 16-byte Endpoint 1: Mode 0: 800-byte Mode 1: 1024-byte Mode 2: 2048-byte Mode 3: 0-byte Mode 4: 1280-byte Mode 5: 1168-byte Endpoint 2: Mode 0: 32-byte Mode 1: 128-byte Endpoint 3: 16-byte Endpoint 4: 16-byte When Endpoint 1 or Endpoint 2 is used for data receive, the OUT FIFO size can be selected. Endpoint 1 and Endpoint 2 have pro- grammable IN-FIFOs size; 6 modes for Endpoint 1, and 2 modes for Endpoint 2. Each mode can be selected by the USB endpoint FIFO mode selection register (address 005F 16). Data transmitted from the host-PC is stored in Endpoint x FIFO (0060 16 to 006416). Every time the data is stored in the FIFO, the internal OUT FIFO write pointer is increased by 1. When one com- plete data packet is stored, the OUT_PKT_RDY flag is set to “1” and the number of received data packets is stored in USB End- point x OUT write count registers (Low and High). When the AUTO_CLR bit is “1” and the received data is read out from the OUT FIFO, the OUT_PKT_RDY flag is cleared to “0”. When the AUTO_CLR bit is “1”, the OUT_PKT_RDY flag will not be cleared automatically by the FIFO read; it must be cleared by software. (The AUTO-CLR bit function is not applicable in Endpoint 0.) When MAXP size ≤ (a half of OUT FIFO size), the OUT_FIFO can receive 2 packets (double buffer). At this time, the OUT_ FIFO sta- tus can be checked by the OUT_PKT_RDY flag. When the FIFO holds two packets and one packet is read from the FIFO, the OUT_PKT_RDY flag is not cleared even if it is set to “0”. (The flag returns from “0” to “1” in one φ cycle after the read-out). During double buffer mode, the USB Endpoint x OUT write count regis- ters (Low and High) holds the number of previously received packets. This count register is updated after reading out one of packets in the OUT FIFO and clearing the OUT_PKT_RDY flag to “0”. When Endpoint 1 OUT is used and its MAXP size ≤ (one third of OUT FIFO size), this can be used as triple buffer. However, before the third EOF packet has been received, be sure to read the first packet data and clear the OUT_PKT_RDY flag. If the third packet data has been received before the first packet data is read, an overrun error occurs and the third packet data is destroyed. TOGGLE Initialization In order to initialize the data toggle sequence bit of the endpoint, in other words, resetting the next data packet to DATA0; set the ISO/TOGGLE_INT bit to “1” and then clear back to “0”.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. USB Interrupts The USB FCU has two interrupts, USB Function Interrupt and USB SOF (Start Of Frame) Interrupt. G USB Function Interrupt (USBF-INT) The USBF-INT is usable for the USB data flow control and power management. The USBF-INT request occurs at data transmit/re- ceive completion, overrun/underrun, reset, or receiving suspend/ resume signal. To enable this interrupt, the USB function interrupt enable bit in the interrupt control register A (address 0005 16) and the respective bit in the USB interrupt enable registers 1 and 2 (addresses 0005416 and 0005516) must be set to “1”. When set- ting bit 7 in USB interrupt enable register 2 to “1”, the suspend interrupt and the resume interrupt are enabled. Endpoint x (x = 0 to 4) IN interrupt request occurs when the USB Endpoint x IN interrupt status flag (INTST 0, 2, 4, 6, 8) of USB in- terrupt status registers 1 and 2 (addresses 005216 and 005316) is “1”. The USB Endpoint x IN interrupt status flag is set to “1” when the respective endpoint IN_PKT_RDY bit is “1”. Endpoint x (x = 0 to 4) OUT interrupt request occurs when the USB endpoint x OUT interrupt status flag (INTST3, 5, 7, 9) in USB interrupt status registers 1 and 2 is set to “1”. The USB Endpoint x OUT interrupt status flag is set to “1” when the respective endpoint OUT_PKT_RDY flag is “1”. The overrun/underrun interrupt request occurs when the USB overrun/underrun interrupt status flag (INTST12) in USB interrupt status register 2 is set to “1”. This flag is set to “1” when the FIFO data overruns or underruns in isochronous transfer mode. The USB reset interrupt request occurs when the USB reset inter- rupt status flag (INTST13) in USB interrupt status register 2 is set to “1”. This flag is set when the SE0 is detected on the D+/D- line for at least 2.5 µs. When this situation happens, all USB internal registers (addresses 0050 16 to 005E16), except this flag, are ini- tialized to the default state at reset. The USB reset interrupt is always enabled. The suspend/resume interrupt request occurs when either the USB resume signal interrupt status flag (INTST14) or the USB suspend signal interrupt status flag (INTST15) in USB interrupt status register 2 is set to “1”. The bits in both interrupt status registers 1 and 2 can be cleared by writing “1” to each bit. G USB SOF interrupt The USB SOF interrupt is usable in isochronous transfers. This in- terrupt request occurs when an SOF packet is received. To enable a USB SOF interrupt, set the USB SOF interrupt enable bit of in- terrupt control register A to “1”. Suspend/Resume Functions If no bus activity is detected on the D+/D- line for at least 3 ms, the USB suspend signal detect flag (SUSPEND) of the USB power control register (address 0051 16) and the USB suspend signal in- terrupt status flag of USB interrupt status register 2 are set to “1” and the suspend interrupt request occurs. The following procedure must be executed after pushing the internal registers (A, X, Y ) to memories during the suspend interrupt process routine. (1) Clear all bits of USB interrupt status register 1 (address 0052 16) and USB interrupt status register 2 (address 005316) to “0”. (2) Set the USB clock enable bit to “0”. (After disabling the USB clock, do not write to any of the USB internal registers (ad- dresses 0050 16 to 006416), except for the USB control register (address 001316), clock control register (address 001F16), and frequency synthesizer control register (address 006C16). (3) Set the frequency synthesizer enable bit to “0”. (4) Set the USB line driver current control bit to “1”. (Always keep the USB line driver current control bit set to “0” during USB function operations. When operating at Vcc = 3.3 V, this bit does not need to be set.) (5) Keep total drive current at 500 µA or less. (6) Disable the timer 1 interrupt. (7) Disable the timer 2 interrupt. (Disable all the other external in- terrupts.) (8) Set the timer 1 interrupt request bit to “0”. (9) Set the timer 2 interrupt request bit to “0”. (10) Set the interrupt disable flag (I) to “0”. (11) Execute the STP instruction. At this point, the MCU will be in stop mode (suspend mode). Be- fore executing the STP instruction, make sure to set the USB function interrupt request bit (bit 0 at address 0002 16) to “0” and the USB function interrupt enable bit (bit 0 at address 000516) to “1”.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. The USB suspend detect signal flag goes to “0” when the USB re- sume signal detect flag (RESUME) is set to “1”. During suspend mode, if the clock operation is started up with a process (remote wake-up) other than the resume interrupt process (for example; reset or timer), make sure to clear the USB suspend detect signal flag to “0” when you set the USB remote wake-up bit to “1”. When the USB FCU is in suspend mode and detects a non-idle signal on the D+/D- line, the USB resume detect flag and the USB resume signal interrupt status flag both go to “1” and a resume interrupt request occurs. At this point, pull the internal registers (A, X, Y) in this interrupt process routine. Take the following procedure in the USB resume interrupt process. (1) Set the USB line driver current control bit to “0”. (When operat- ing at Vcc = 3.3 V, this bit does not need to be set.) (2) Set the frequency synthesizer enable bit to “1” and set a 2 ms to 5 ms wait. (3) Check the frequency synthesizer lock status bit. If “0”, it must be checked again after a 0.1 ms wait. (4) Enable the USB clock. Fig. 37 Structure of USB control register U S B c o n t r o l r e g i s t e r a d d r e s s U S B C R e s e r v e d b i t a t r e a d w r i t e U S B d e f a u l t s t a t e s e l e c t i o n b i t U S B C I n d e f a u l t s t a t e a f t e r p o w e r o n r e s e t I n d e f a u l t s t a t e a f t e r U S B r e s e t s i g n a l r e c e i v e d U S B a r t i f i c i a l S O F e n a b l e b i t U S B C A r t i f i c i a l S O F d i s a b l e d A r t i f i c i a l S O F e n a b l e d U S B l i n e d r i v e r c u r r e n t c o n t r o l b i t U S B C H i g h c u r r e n t m o d e L o w c u r r e n t m o d e U S B l i n e d r i v e r s u p p l y e n a b l e b i t U S B C o t e L i n e d r i v e r d i s a b l e d L i n e d r i v e r e n a b l e d U S B c l o c k e n a b l e b i t U S B C M H z c l o c k t o t h e U S B b l o c k d i s a b l e d M H z c l o c k t o t h e U S B b l o c k e n a b l e d U S B S O F p o r t s e l e c t b i t U S B C S O F o u t p u t d i s a b l e d S O F o u t p u t e n a b l e d U S B E n a b l e B i t U S B C U S B b l o c k d i s a b l e d o t e U S B b l o c k e n a b l e d N o t e s W h e n u s i n g t h e M C U i n V c c V s e t t h i s b i t t o a n d d i s a b l e t h e b u i l t i n D C D C c o n v e r t e r S e t t i n g t h i s b i t t o c a u s e s t h e c o n t e n t s o f a l l U S B r e g i s t e r s t o h a v e t h e v a l u e s a t r e s e t b Set the USB resume signal interrupt status flag to “0” after the wake-up sequence process. The USB resume detect flag goes to “0” at the same time. When the clock operation is started up with a remote wake-up, set the USB remote wake-up bit to “1” after the wake-up sequence process. (keep it set to “1” for a minimum of 10 ms and maximum of 15 ms). By doing this, the MCU will send a resume signal to the host CPU and let it know that the suspend state has been released. After that, set the USB remote wake-up bit and the USB suspend detection flag to “0”, because the USB suspend detection flag is not automatically cleared to “0” with a remote wake-up. [USB Control Register] USBC When using the USB function, the USB enable bit must be set to “1”. The USB line driver supply bit must be set to “0” (DC-DC con- verter is disabled) when operating at Vcc = 3.3V. In this condition, the setting of the USB line driver current control bit has no effect on USB operations. When the USB artificial SOF enable bit is set to “1”, the MCU judges that a SOF packet is received within 250 ns from a frame starting if an SOF packet is destroyed owing to some cause.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. [USB Address Register] USBA The USB address register maintains the USB function control unit address assigned by the host computer. When receiving the SET_ADDRESS, keep it in this register. The values of this register are “0” when the device is not yet configured. The values of this register are also set to “0” when the USB block is disabled (bit 7 of USB control register is set to “0”). In addition, no matter what value is written to this register, it will have no effect on the set value. [USB Power Management Register] USBPM The USB power management register is used for power manage- ment in the USB FCU. This register needs to be set only when using the remote wake-up to resume the MCU from suspend mode. USB address register (address 005016) USBA Programmable function address (FUNAD0 to 6)) This register maintains the 7-bit USB function control unit address assigned by the host CPU. Reserved bit (“0” at read/write) b U S B p o w e r m a n a g e m e n t r e g i s t e r a d d r e s s U S B P M U S B s u s p e n d d e t e c t i o n f l a g S U S P E N D R e a d o n l y N o U S B s u s p e n d d e t e c t e d U S B s u s p e n d d e t e c t e d U S B r e s u m e d e t e c t i o n f l a g R E S U M E R e a d o n l y N o U S B r e s u m e s i g n a d e t e c t e d U S B r e s u m e s i g n a l d e t e c t e d U S B r e m o t e w a k e u p b i t W A K E U P E n d o f r e m o t e r e s u m e s i g n a l T r a n s m i t t i n g o f r e m o t e r e s u m e s i g n a l o n l y w h e n S U S P E N D R e s e r v e d b i t a t r e a d w r i t e b 00000 Fig. 38 Structure of USB address register Fig. 39 Structure of USB power management register
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. [USB Interrupt Status Registers 1 and 2] USBIS1, USBIS2 The USB interrupt status registers are used to indicate the condi- tion that caused a USB function interrupt to be generated. Each status flag and bit can be cleared to “0” by writing “1” to the corre- sponding bit. Make sure to write to/read from the USB interrupt status register 1 first and then USB interrupt status register 2. When an IN token is received during an isochronous transfer, and U S B i n t e r r u p t s t a t u s r e g i s t e r a d d r e s s U S B I S U S B e n d p o i n t i n t e r r u p t s t a t u s f l a g I N T S T E x c e p t t h e f o l l o w i n g c o n d i t i o n s S e t a t a n y o n e o f t h e f o l l o w i n g c o n d i t i o n s A p a c k e t d a t a o f e n d p o i n t i s s u c c e s s f u l l y r e c e i v e d A p a c k e t d a t a o f e n d p o i n t i s s u c c e s s f u l l y s e n t D A T A E N D b i t o f e n d p o i n t i s c l e a r e d t o F O R C E S T A L L b i t o f e n d p o i n t i s s e t t o S E T U P E N D b i t o f e n d p o i n t i s s e t t o R e s e r v e d b i t a t r e a d w r i t e U S B e n d p o i n t I N i n t e r r u p t s t a t u s f l a g I N T S T E x c e p t t h e f o l l o w i n g c o n d i t i o n s S e t a t w h i c h o f t h e f o l l o w i n g c o n d i t i o n s A p a c k e t d a t a o f e n d p o i n t i s s u c c e s s f u l l y s e n t U N D E R R U N b i t o f e n d p o i n t i s s e t t o U S B e n d p o i n t O U T i n t e r r u p t s t a t u s f l a g I N T S T E x c e p t t h e f o l l o w i n g c o n d i t i o n s S e t a t a n y o n e o f t h e f o l l o w i n g c o n d i t i o n s A p a c k e t d a t a o f e n d p o i n t i s s u c c e s s f u l l y r e c e i v e d O V E R R U N b i t o f e n d p o i n t i s s e t t o F O R C E S T A L L b i t o f e n d p o i n t i s s e t t o U S B e n d p o i n t I N i n t e r r u p t s t a t u s f l a g I N T S T E x c e p t t h e f o l l o w i n g c o n d i t i o n s S e t a t w h i c h o f t h e f o l l o w i n g c o n d i t i o n s A p a c k e t d a t a o f e n d p o i n t i s s u c c e s s f u l l y s e n t U N D E R R U N b i t o f e n d p o i n t i s s e t t o U S B e n d p o i n t O U T i n t e r r u p t s t a t u s f l a g I N T S T E x c e p t t h e f o l l o w i n g c o n d i t i o n s S e t a t a n y o n e o f t h e f o l l o w i n g c o n d i t i o n s A p a c k e t d a t a o f e n d p o i n t i s s u c c e s s f u l l y r e c e i v e d O V E R R U N b i t o f e n d p o i n t i s s e t t o F O R C E S T A L L b i t o f e n d p o i n t i s s e t t o U S B e n d p o i n t I N i n t e r r u p t s t a t u s f l a g I N T S T E x c e p t t h e f o l l o w i n g c o n d i t i o n s S e t a t w h i c h o f t h e f o l l o w i n g c o n d i t i o n s A p a c k e t d a t a o f e n d p o i n t i s s u c c e s s f u l l y s e n t U N D E R R U N b i t o f e n d p o i n t i s s e t t o U S B e n d p o i n t O U T i n t e r r u p t s t a t u s f l a g I N T S T E x c e p t t h e f o l l o w i n g c o n d i t i o n s S e t a t a n y o n e o f t h e f o l l o w i n g c o n d i t i o n s A p a c k e t d a t a o f e n d p o i n t i s s u c c e s s f u l l y r e c e i v e d O V E R R U N b i t o f e n d p o i n t i s s e t t o F O R C E S T A L L b i t o f e n d p o i n t i s s e t t o b0b7 the IN FIFO is empty, an underrun error occurs and INTST12 and IN_CSR2 are set to “1”. When an OUT token is received and the OUT FIFO is full, an overrun error occurs and INTST12 and OUT_CSR2 are set to “1”. Underruns and overruns are not de- tected by the CPU in bulk transfers and normal interrupt transfers, however in this case, the MCU will send a NAK signal to the host CPU. Fig. 40 Structure of USB interrupt status register 1
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 41 Structure of USB interrupt status register 2 U S B i n t e r r u p t s t a t u s r e g i s t e r a d d r e s s U S B I S USB endpoint 4 IN interrupt status flag (INTST8) 0: Except the following conditions 1: Set at which of the following conditions:
- A packet data of endpoint 4 is successfully sent
- UNDER_RUN bit of endpoint 4 is set to “1”. USB endpoint 4 OUT interrupt status flag (INTST9) 0: Except the following conditions 1: Set at any one of the following conditions:
- A packet data of endpoint 4 is successfully received
- OVER_RUN bit of endpoint 4 is set to “1”
- FORCE_STALL bit of endpoint 4 is set to “1”. Reserved bit (“0” at read/write) USB overrun/underrun interrupt status flag (INTST12) 0: Except the following condition 1: Set at an occurrence of overrun/underrun (for isochronous data transfer) USB reset interrupt status flag (INTST13) 0: Except the following condition 1: Set at receiving of USB reset signal USB resume signal interrupt status flag (INTST14) 0: Except the following condition 1: Set at receiving of resume signal USB suspend signal interrupt status flag (INTST15) 0: Except the following condition 1: Set at receiving of suspend signal b
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. [USB Interrupt Enable Registers 1 and 2] USBIE1, USBIE2 The USB interrupt enable registers are used to enable the USB USB interrupt enable register 1 (address 005416) USBIE1 USB endpoint 0 interrupt enable bit (INTEN0) 0: Disabled 1: Enabled Reserved bit (“0” at read/write) USB endpoint 1 IN interrupt enable bit (INTEN2) 0: Disabled 1: Enabled USB endpoint 1 OUT interrupt enable bit (INTEN3) 0: Disabled 1: Enabled USB endpoint 2 IN interrupt enable bit (INTEN4) 0: Disabled 1: Enabled USB endpoint 2 OUT interrupt enable bit (INTEN5) 0: Disabled 1: Enabled USB endpoint 3 IN interrupt enable bit (INTEN6) 0: Disabled 1: Enabled USB endpoint 3 OUT interrupt enable bit (INTEN7) 0: Disabled 1: Enabled b0b USB interrupt enable register 2 (address 005516) USBIE2 U S B e n d p o i n t I N i n t e r r u p t e n a b l e b i t I N T E N D i s a b l e d E n a b l e d U S B e n d p o i n t O U T i n t e r r u p t e n a b l e b i t I N T E N D i s a b l e d E n a b l e d R e s e r v e d b i t a t r e a d w r i t e U S B o v e r r u n u n d e r r u n i n t e r r u p t e n a b l e b i t I N T E N D i s a b l e d E n a b l e d R e s e r v e d b i t a t r e a d w r i t e R e s e r v e d b i t a t r e a d w r i t e U S B s u s p e n d r e s u m e i n t e r r u p t e n a b l e b i t I N T E N D i s a b l e d E n a b l e d b 0001 function interrupt. Upon reset, all USB interrupts except the USB suspend and USB resume interrupts are enabled. Fig. 42 Structure of USB interrupt enable register 1 Fig. 43 Structure of USB interrupt enable register 2
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. [USB Frame Number Registers Low and High ] USBSOFL, USBFOFH These 11-bit registers contain the frame number of the SOF token received from the host computer. These are read-only registers. [USB Endpoint Index Register] USBINDEX This register specifies the accessible endpoint. It serves as an in- dex to endpoint-specific USB Endpoint x IN Control Register, USB Endpoint x OUT Control Register, USB Endpoint x IN Max. Packet Size Register, USB Endpoint x OUT Max. Packet Size Register, USB Endpoint x OUT Write Count Register, and USB FIFO Mode Selection Register (x = 0 to 4). USB frame number register Low (address 005616) USBSOFL Low-order 8 bits of SOF token High-order 3 bits of SOF token Reserved bit (“0” at read) USB frame number register High (address 005716) USBSOFH b b U S B e n d p o i n t i n d e x r e g i s t e r a d d r e s s U S B I N D E X Endpoint index bit (EPINDEX) b2b1b0 0 0 0: Endpoint 0 0 0 1: Endpoint 1 0 1 0: Endpoint 2 0 1 1: Endpoint 3 1 0 0: Endpoint 4 1 0 1: Not used 1 1 0: Not used 1 1 1: Not used Reserved bit (“0” at read/write) AUTO_FLUSH bit (AUTO_FL) 0: Auto FIFO flush disabled 1: Auto FIFO flush enabled ISO_UPDATE bit (ISO_UPD) 0: ISO_UPDATE disabled 1: ISO_UPDATE enabled b0b 000 Fig. 44 Structure of USB frame number registers Fig. 45 Structure of USB frame number registers
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. [USB Endpoint 0 IN Control Register ] IN_CSR This register contains the control and status information of the endpoint 0. This USB FCU sets the OUT_PKT_RDY flag to “1” upon having received a data packet in the OUT FIFO. When read- ing its one data packet from the OUT FIFO, be sure to set this flag to “0”. After a SETUP token is received, the MCU is in the “decode wait state” until the OUT_PKT_RDY flag is cleared. If the OUT_PKT_RDY flag is not cleared (indicating that the host re- quest has not been successfully decoded), the USB FCU keep returning a NAK to the host for all IN/OUT tokens. Set the IN_PKT_RDY bit to “1” after the data packet has been written to the IN FIFO. If this bit is set to “1” even though nothing has been written to the IN FIFO, a “0” length data (NULL packet) is sent to the host. The SEND_STALL bit is for sending a STALL to the host if an unsupported request is received by the USB FCU. This bit must be set to “1” (which instructs the FCU USB to send a STALL signal) whenever an unsupported device request is re- ceived from the host. The setup process is as follows: (1) Set SEND_STALL bit to “1” (2) Set DATA_END bit to “1” (3) Set OUT_PKT_RDY flag to “0”. Note that if “0” is written to the SEND_STALL bit before the CLEAR_FEATURE (endpoint STALL) request has been received, the next STALL will not be generated. The DATA_END bit informs the USB FCU of the completion of the process indicated in the SETUP packet. Set this bit to “1” when the process requested in the SETUP packet is completed. (Con- trol Read Transfer: set this bit after writing all of the requested data to the FIFO; Control Write Transfer: set this bit to “1” after reading all of the requested data from the FIFO.) When this bit is “1”, the host request is ignored and a STALL is returned. After the status phase process is completed, the USB FCU automatically clears it to “0”. U S B e n d p o i n t I N c o n t r o l r e g i s t e r a d d r e s s I N C S R OUT_PKT_RDY flag (IN0CSR0) 0: Except the following condition (Cleared to “0” by writing “1” into SERVICED_OUT_PKT_RDY bit) 1: End of a data packet reception IN_PKT_RDY bit (IN0CSR1) 0: End of a data packet transmission 1: Write “1” at completion of writing a data packet into IN FIFO. SEND_STALL bit (IN0CSR2) 0: Except the following condition 1: Transmitting STALL handshake signal DATA_END bit (IN0CSR3) 0: Except the following condition (Cleared to “0” after completion of status phase) 1: Write “1” at completion of writing or reading the last data packet to/from FIFO. FORCE_STALL flag (IN0CSR4) 0: Except the following condition 1: Protocol error detected SETUP_END flag (IN0CSR5) (Note ) 0: Except the following condition (Cleared to “0” by writing “1” into SERVICED_SETUP_END bit) 1: Control transfer ends before the specific length of data is transferred during the data phase. SERVICED_OUT_PKT_RDY bit (IN0CSR6) Writing “1” to this bit clears OUT_PKT_RDY flag to “0”. SERVICED_SETUP_END bit (IN0CSR7) Writing “1” to this bit clears SETUP_END flag to “0”. b N o t I f t h i s b i t i s s e t t o s t o p a c c e s s i n g t h e F I F O t o s e r v e t h e p r e v i o u s s e t u p t r a n s a c t i o n Fig. 46 Structure of USB endpoint 0 IN control register
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. [USB Endpoint x (x = 1 to 4) IN Control Register] IN_CSR This register contains the control and status information of the re- spective IN Endpoints 1 to 4. Set the IN_PKT_RDY bit to “1” after the data packet has been written to the IN FIFO. This bit is cleared to “0” when the data transfer is completed. In a bulk IN transfer, this bit is cleared when an ACK signal is received from the host. If an ACK signal is not re- ceived, this bit (and the TX_NOT_EMPTY bit) remains as “1”. This same data packet is sent after the next IN token is received. The FLUSH bit is for flushing the data in the IN FIFO. U S B e n d p o i n t x I N c o n t r o l r e g i s t e r a d d r e s s I N C S R I N T P K T R D Y b i t I N X C S R E n d o f a d a t a p a c k e t t r a n s m i s s i o n o t e W r i t e a t c o m p l e t i o n o f w r i t i n g a d a t a p a c k e t i n t o I N F I F O o t e U N D E R R U N f l a g I N X C S R I n i s o c h r o n o u s d a t a t r a n s f e r N o F I F O u n d e r r u n o t e F I F O u n d e r r u n o c c u r r e d o t e U S B o v e r r u n u n d e r r u n i n t e r r u p t s t a t u s f l a g i s s e t t o S E N D S T A L L b i t I N X C S R o t e E x c e p t t h e f o l l o w i n g c o n d i t i o n T r a n s m i t t i n g S T A L L h a n d s h a k e s i g n a l I S O T O G G L E I N I T b i t I N X C S R o t e E x c e p t t h e f o l l o w i n g c o n d i t i o n I n i t i a l i z i n g t o e n d p o i n t u s e d f o r i s o c h r o n o u s t r a n s f e r I n i t i a l i z i n g t h e d a t a t o g g l e s e q u e n c e b i t I N T P T b i t I N X C S R o t e E x c e p t t h e f o l l o w i n g c o n d i t i o n I n i t i a l i z i n g t o e n d p o i n t u s e d f o r i n t e r r u p t t r a n s f e r r a t e f e e d b a c k T X N O T E P T f l a g I N X C S R o t e E m p t y i n I N F I F O F u l l i n I N F I F O F L U S H b i t I N X C S R E x c e p t t h e f o l l o w i n g c o n d i t i o n o t e F l u s h F I F O o t e A U T O S E T b i t I N X C S R o t e A U T O S E T d i s a b l e d A U T O S E T e n a b l e d b0b7 Notes 1: This bit is automatically set to “1” or cleared to “0”. 2: The user must program to “1” or “0”. 3: When AUTO_SET bit is “0”, the user must set to “1”. When AUTO_SET bit is “1”, this bit is automatically set to “1”. Fig. 47 Structure of USB endpoint x (x = 1 to 4) IN control register
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. [USB Endpoint x (x = 1 to 4) OUT Control Register] OUT_CSR This register contains the information and status of the respective OUT endpoints 1 to 4. In the endpoint 0, all bits are reserved and cannot be used (they will all be read out as “0”). The USB FCU sets the OUT_PKT_RDY flag to “1” after a data packet has been received into the OUT FIFO. After reading the data packet in the OUT FIFO, clear this flag to “0”. However, if there is still data in the OUT FIFO, the flag cannot be cleared even by writing “0” by soft- ware. U S B e n d p o i n t x O U T c o n t r o l r e g i s t e r a d d r e s s O U T C S R INT_PKT_RDY bit (OUTXCSR0) 0: Except the following condition (Note 3) 1: End of a data packet reception (Note 2) OVER RUN flag (OUTXCSR1) (In isochronous data transfer) 0: No FIFO overrun (Note 2) 1: FIFO overrun occurred (Note 1) SEND_STALL bit (OUTXCSR2) (Note 2) 0: Except the following condition 1: Transmitting STALL handshake signal ISO/TOGGLE bit (OUTXCSR3) (Note 2) 0: Except the following condition 1: Initializing to endpoint used for isochronous transfer; Enabling reception of DATA0 and DATA1 as PID (Initializing the toggle) FORCE_STALL flag (OUTXCSR4) 0: Except the following condition (Note 2) 1: Protocol error detected (Note 1) DATA_ERR flag (OUTXCSR5) 0: Except the following condition (Note 2) 1: CRC or bit stuffing error detected in transferring isochronous data (Note 1) FLUSH bit (OUTXCSR6) 0: Except the following condition (Note 1) 1: Flush FIFO. (Note 2) AUTO_CLR bit (OUTXCSR7) (Note 2) 0: AUTO_CLR disabled 1: AUTO_CLR enabled b0b7 Notes 1: This bit is automatically set to “1” or cleared to “0”. 2: The user must program to “1” or “0”. 3: When AUTO_CLR bit is “0”, the user must clear to “0”. When AUTO_CLR bit is “1”, this bit is automatically cleared to “0”. Fig. 48 Structure of USB endpoint x (x = 1 to 4) OUT control register
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. [USB Endpoint x (x = 0 to 4) IN Max. Packet Size Register] IN_MAXP This register specifies the maximum packet size (MAXP) of an endpoint x IN packet. The value set for endpoint 1 is the number of transmitted bytes divided by 8, and the value set for endpoints 0, 2, 3, and 4 is the actual number of transmitted bytes. The CPU can change these values using the SET_DESCRIPTOR com- mand. The initial value for endpoints 0, 2, 3 and 4 is 8, and the initial value for endpoint 1 is 1. [USB Endpoint x (x = 0 to 4) OUT Max. Packet Size Register] OUT_MAXP This register specifies the maximum packet size (MAXP) of an Endpoint x OUT packet. The value set for endpoint 1 is the num- ber of received bytes divided by 8, and the value set for endpoints 0, 2, 3, and 4 is the actual number of received bytes. The CPU can change these values using the SET_DESCRIPTOR com- mand. The initial value for endpoints 0, 2, 3, and 4 is 8, and the initial value for endpoint 1 is 1. When using the endpoint 0, both USB endpoint x IN max. packet size register (IN _MAXP) and USB end- point x OUT max. packet size register (OUT_MAXP) are set to the same value. Changing one register’s value effectively changes the value of the other register as well. T h e m a x i m u m p a c k e t s i z e M A X P o f e n d p o i n t x I N i s c o n t a i n e d M A X P n f o r e n d p o i n t s M A X P n f o r e n d p o i n t i s a w r i t t e n v a l u e i n t o t h i s r e g i s t e r USB endpoint x IN max. packet size register (address 005B16) IN_MAXP b0b The maximum packet size (MAXP) of endpoint x OUT is contained. MAXP = n for endpoints 0, 2, 3, 4 MAXP = n ✕ 8 for endpoint 1 “n” is a written value into this register. USB endpoint x OUT max. packet size register (address 005C16) OUT_MAXP b Fig. 49 Structure of USB endpoint x IN max. packet size register Fig. 50 Structure of USB endpoint x OUT max. packet size register
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. [USB endpoint x (x = 0 to 4) OUT Write Count Registers (Low and High)] WRT_CNTRL, WRT_CNTH These registers contain the number of bytes in the endpoint x OUT FIFO. These are read-only registers. These two registers must be read after the USB FCU has received a packet of data from the host. When reading these registers, the lower byte must be read first, then the higher byte. When the OUT FIF0 is in double buffer mode, the CPU first reads the received number of bytes of the former data packet. The next CPU read can obtain that of the new data packet. Fig. 51 Structure of USB endpoint x (x = 0 to 4) OUT write count registers L o w o r d e r b i t s o f t h e n u m b e r o f b y t e s i n e n d p o i n t x O U T F I F O U S B e n d p o i n t x O U T w r i t e c o u n t r e g i s t e r L o w a d d r e s s D 1 W R T C N T L b H i g h o r d e r b i t s o f t h e n u m b e r o f b y t e s i n e n d p o i n t x O U T F I F O N o t u s e d a t r e a d USB endpoint x OUT write count register High (address 005E16) WRT_CNTH b [USB Endpoint x (x = 0 to 4) FIFO Register] USBFIFOx These registers are the USB IN (transmit) and OUT (receive) FIFO data registers. Write data to the corresponding register, and read data from the corresponding register. When the maximum packet size is equal to or less than half the FIFO size, these registers function in double buffer mode and can hold two packets of data. When the IN_PKT_RDY bit is “0” and the TX_NOT_EMPTY bit is “1”, these bits indicate that one packet of data is stored in the IN FIFO. When the OUT FIFO is in double buffer mode, the OUT_PKT_RDY flag remains as “1” after the first packet of data is read out (it actually goes to “0” and returns to “1” after one φ cycle). En d p o i n t x I N O U T F I F O USB endpoint x FIFO register (addresses 006016, 006116, 006216, 006316, 006416,) USBFIFOx b0b Fig. 52 Structure of USB endpoint x (x = 0 to 4) FIFO register
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. [USB Endpoint FIFO Mode Selection Register] USBFIFOMR This register determines IN/OUT FIFO size mode for endpoint 1 or endpoint 2. This register is invalid when using endpoint 0, 3, or 4. U S B e n d p o i n t F I F O m o d e r e g i s t e r a d d r e s s U S B F I F O M R F I F O s i z e s e l e c t i o n b i t o t F o r e n d p o i n t b b b b X I N b y t e O U T b y t e X I N b y t e O U T b y t e X I N b y t e O U T b y t e X I N b y t e O U T b y t e X I N b y t e O U T b y t e X I N b y t e O U T b y t e F o r e n d p o i n t X X X I N b y t e O U T b y t e X X X I N b y t e O U T b y t e R e s e r v e d b i t a t r e a d w r i t e b0b 0000 N o t T h e v a l u e s e t i n t o x i s i n v a l i d Fig. 53 Structure of USB endpoint FIFO mode selection register
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 54 Interrupt request circuit of data bus buffer MASTER CPU BUS INTERFACE The 7641 group internally has a 2-byte bus interface which control signals from the host CPU side can operate (slave mode). This bus interface allows the 7641 group to be directly connected with a R/W type of CPU bus or a RD and WR separated type of CPU bus. Figure 56 shows the block diagram of master CPU bus interface function. The data bus buffer function I/O pins (P5 2 – P57, P6, P72–P7 4) also function as the normal I/O ports. When the Master CPU Bus Interface Enable bit of Data Bus Buffer Control Register (bit 6 of address 004A 16) is “0”, these pins become the normal I/O ports. When it is “1”, these pins become the master CPU bus interface function pins. Additionally, when using the master CPU bus interface function, set port P6 to input mode by setting “00 16” into its port direction register (address 001516). The selection of either the single data bus buffer mode, which uses 1 byte: data bus buffer 0 only, or the double data bus buffer mode, which uses 2 bytes: data bus buffer 0 and data bus buffer 1, is performed by the Data Bus Buffer Function Select Bit of Data Bus Buffer Control Register 1 (bit 7 of address 004E 16). Port P72 becomes S1 input pin in the double data bus buffer mode. When data is written from the host CPU side, an input buffer full interrupt occurs. When data is read from the host CPU, an output buffer empty interrupt occurs. The 7641 group shares two input buffer full interrupt requests and two output buffer empty interrupt requests as shown in Figure 54, respectively. The 7641 group can also operate the master CPU bus interface connecting with the Built-in DMAC. This could transfer a large amount of data fast. An input signal level of data bus buffer function input pins can be selected between a CMOS level and a TTL level. Set it using the Master CPU Bus Input Level Select Bit of Port Control Register (address 0010 16) I n p u t b u f f e r f u l l f l a g I B I n p u t b u f f e r f u l l f l a g I B Rising edge detection circuit One-shot pulse generating circuit O n e - s h o t p u l s e g e n e r a t i n g c i r c u i t Input buffer full interrupt request signal IBF Output buffer full flag 0 OBF O u t p u t b u f f e r f u l l f l a g O B One-shot pulse generating circuit O n e - s h o t p u l s e g e n e r a t i n g c i r c u i t Output buffer empty interrupt request signal OBE Interrupt request is set at this rising edge I n t e r r u p t r e q u e s t i s s e t a t t h i s r i s i n g e d g e I B F0 I B F1 I B F O B F0 B O B F1 B O B E O B E0 O B E1 Rising edge detection circuit Rising edge detection circuit R i s i n g e d g e d e t e c t i o n c i r c u i t
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 55 Structure of master CPU bus interface related registers Data bus buffer status register 0 (address 004916) DBBS0 O u t p u t b u f f e r f u l l f l a g O B F0) B u f f e r e m p t y B u f f e r f u l l I n p u t b u f f e r f u l l f l a g I B F0) B u f f e r e m p t y B u f f e r f u l l U s e r d e f i n a b l e f l a g U 2) T h i s f l a g c a n b e d e f i n e d b y u s e r f r e e l y f l a g A00) T h i s f l a g i n d i c a t e s t h e c o n d i t i o n o f s t a t u s w h e n t h e I B f l a g i s s e t U s e r d e f i n a b l e f l a g U 4– U 7) T h i s f l a g c a n b e d e f i n e d b y u s e r f r e e l y b Data bus buffer control register 0 (address 004A16) DBBC0 O B o u t p u t e n a b l e b i t P f u n c t i o n s a s I O p o r t P f u n c t i o n s a s O B o u t p u t p i n I B o u t p u t e n a b l e b i t P f u n c t i o n s a s p o r t I O p i n P f u n c t i o n s a s I B o u t p u t p i n I B i n t e r r u p t s e l e c t b i t O c c u r r e n c e d u e t o d a t a w r i t e o r c o m m a n d w r i t e O c c u r r e n c e d u e t o c o m m a n d w r i t e O u t p u t b u f f e r e m p t y i n t e r r u p t d i s a b l e b i t E n a b l e d D i s a b l e d I n p u t b u f f e r f u l l i n t e r r u p t d i s a b l e b i t E n a b l e d D i s a b l e d R e s e r v e d b i t a t r e a d w r i t e M a s t e r C P U b u s i n t e r f a c e e n a b l e b i t P t o P 57, P t o P f u n c t i o n a s I O p o r t s P t o P 57, P t o P f u n c t i o n a s m a s t e r C P U b u s i n t e r f a c e f u n c t i o n p i n s B u s i n t e r f a c e t y p e s e l e c t b i t R D W R s e p a r a t e t y p e b u s R W t y p e b u s b 0b7 Data bus buffer status register 1 (address 004D16) DBBS1 O u t p u t b u f f e r f u l l f l a g O B F1) B u f f e r e m p t y B u f f e r f u l l I n p u t b u f f e r f u l l f l a g I B F1) B u f f e r e m p t y B u f f e r f u l l U s e r d e f i n a b l e f l a g U 2) T h i s f l a g c a n b e d e f i n e d b y u s e r f r e e l y f l a g A01) T h i s f l a g i n d i c a t e s t h e c o n d i t i o n o f s t a t u s w h e n t h e I B f l a g i s s e t U s e r d e f i n a b l e f l a g U 4– U 7) T h i s f l a g c a n b e d e f i n e d b y u s e r f r e e l y b O B o u t p u t e n a b l e b i t P f u n c t i o n s a s I O p o r t P f u n c t i o n s a s O B o u t p u t p i n I B o u t p u t e n a b l e b i t P f u n c t i o n s a s p o r t I O p i n P f u n c t i o n s a s I B o u t p u t p i n I B i n t e r r u p t s e l e c t b i t O c c u r r e n c e d u e t o d a t a w r i t e o r c o m m a n d w r i t e O c c u r r e n c e d u e t o c o m m a n d w r i t e O u t p u t b u f f e r e m p t y i n t e r r u p t d i s a b l e b i t E n a b l e d D i s a b l e d I n p u t b u f f e r f u l l i n t e r r u p t d i s a b l e b i t E n a b l e d D i s a b l e d R e s e r v e d b i t a t r e a d w r i t e D a t a b u s b u f f e r f u n c t i o n s e l e c t b i t S i n g l e d a t a b u s b u f f e r m o d e P f u n c t i o n s a s I O p o r t D o u b l e d a t a b u s b u f f e r m o d e P f u n c t i o n s a s i n p u t p i n b 0b7 Data bus buffer control register 1 (address 004E16) DBBC1
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 56 Master CPU bus interface block diagram P 60/ D Q 0 RD WR D B B1 D B B S T S0 U 7 U 6 U 5 U 4 A00 U 2 IBF0 O B F0 U 7 U 6 U 5 U 4 A0
1 U 2 IBF1 O B F1
Data bus buffer control register 1 (address 004E16) Data bus buffer control register 0 (address 004A16) Output data bus buffer register 1 (address 004C16) I np u t d a t a b u s b u f f e r r e g i s t e r (address 004C16) I np u t d a t a b u s b u f f e r r e g i s t e r (address 004816) O u tp u t d a t a b u s b u f f e r r e g i s t e r ( a d d r e s s 0 0 4 81 S y s t e m b u s I n t e r n a l d a t a b u s
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. [Data Bus Buffer Status Register 0, 1 (DBBS0, DBBS1)] 004916, 004D16 The data bus buffer status registers 0, 1 consist of eight bits each. Bits 0, 1, and 3 are read-only bits and indicate the status of the data bus buffer. Bits 2, 4, 5, 6, and 7 are user definable flags which can be programed, and can be read/written. The host CPU can only read this register when the A 0 pin is set to “H ”.
- Bit 0: Output buffer full flag OBF0, OBF1 When writing data to the output data bus buffer, this flag is set to “1”. When reading the output data bus buffer from the host CPU, this flag is cleared to “0”.
- Bit 1: Input buffer full flag IBF0, IBF1 When writing data from the host CPU to the input data bus buffer, this flag is set to “1”. When reading the input data bus buffer from the slave CPU side, this flag is are cleared to “0”.
- Bit 3: A0 flag A 00, A01 When writing data from the host CPU to the input data bus buffer, the level of the A 0 pin is latched. [Input Data Bus Buffer Registers 0, 1 (DBBIN0, DBBIN 1)] 004816, 004C16 Data on the data bus is latched to DBBIN0 or DBBIN1 by writing request from the host CPU. Data of DBBINs can be read from the Data Bus Buffer Registers (address 004816 or 004C16) on the SFR area. [Output Data Bus Buffer Registers 0, 1 (DBBOUT 0, DBBOUT 1)] 004816, 004C16 When writing data to the Data Bus Buffer Registers (address 0048 16 or 004C16) on the SFR area, data is set to DBBOUT0 or DBBOUT 1. Data of DBBOUTs is output onto the data bus by per- forming the reading request from the host CPU when the A0 pin is set to “L”.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Status output signal. OBF 0 signal is output. Status output signal. IBF0 signal is output. Chip select input. This is used for selecting the data bus buffer, which is selected at “L” level. Address input. This is used for selecting DBBSTS and DBBOUT when the host CPU reads. This is used for distinguishing command from data when the host CPU writes. This is a timing signal for reading data from the data bus buffer to the host CPU. This is a timing signal for writing data to the data bus buffer by the host CPU. Chip select input. This is used for selecting the data bus buffer, which is selected at “L” level. Status output signal. IBF 1 signal is output. Status output signal. OBF 1 signal is output. P52/OBF 0 Table 8 Function description of control I/O pins of master CPU bus interface Pin Name OBF 0 output enable bit IBF0 output enable bit OBF 1 output enable bit Input/ Output Functions OBF 0 1 0 00 IBF1 output enable bit Output P53/IBF0 P54/S0 P55/A0 P56/R (E) P57/W (R/W) P72/S1 P73/IBF1/HLDA P74/OBF 1 IBF0 R (E) W (R/W) IBF1 OBF 1 Output Input Input Input Input Input Output Output
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 57 Special count source generator block diagram COUNT SOURCE GENERATOR The 7641 Group has a built-in special count source generator, SCSG. This generator consists of two 8-bit timers: SCSG1 and SCSG2. The output of the special count source generator can be used as a clock source for the timer X, serial I/O and two UARTs. SCSG Operation Timers SCSG1 and SCSG2 are both down count timers. When the count reaches “0”, an underflow occurs at the next count source rising edge and the contents of the corresponding timer latch are loaded to the timer. The division ratio of each SCSG-x timer is given by 1 / (n+1), where “n” is the value set to the SCSG-x timer. The output of Timer SCSG1 is ANDed with the original clock (φ) to make a count source for Timer SCSG2. The SCSG output is Clock SCSGCLK. The frequency is calculated as follows: SCSGCLK = φ ✕ {n1 / (n1+1)} ✕ {1 / (n2+1)} n1: value set to SCSG1 n2: value set to SCSG2 If the SCSG1 Count Stop Bit (SCSGM1) is set to “1”, or Timer SCSG1 is set to “0”, the SCSG1 count stops. When this happens, the count source for Timer SCSG2 becomes φ. Data Write Control When the SCSG1 Data Write Control Bit or SCSG2 Data Write Control Bit is set to “0”, and data is written to the SCSG-x timer; the data is written to the corresponding latch and timer at the same time. When that bit is set to “1”, the data is only written to the latch. SCSGCLK S C S G 1 c o u n t s t o p b i t S C S G C L K o u t p u t c o n t r o l b i t φ S C S G 1 T i m e r R e l o a d L a t c h SCSG1 Timer (8) SCSG1 data write control bit SCSG2 data write control bit SCSG2 Timer Reload Latch S C S G 2 T i m e r ( 8 ) S C S G C L K o u t p u t c o n t r o l b i t SCSGCLK output control bit S C S G 1 c o u n t s t o p b i t S C S G 1 c o u n t s t o p b i t
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 58 Structure of special count source generator mode register S p e c i a l c o u n t s o u r c e m o d e r e g i s t e r a d d r e s s S C S G M S C S G d a t a w r i t e c o n t r o l b i t W r i t i n g d a t a i n t o b o t h T i m e r l a t c h a n d T i m e r s i m u l t a n e o u s l y W r i t i n g d a t a i n t o o n l y T i m e r l a t c h S C S G c o u n t s t o p b i t C o u n t s t a r t C o u n t s t o p S C S G d a t a w r i t e c o n t r o l b i t W r i t i n g d a t a i n t o b o t h T i m e r l a t c h a n d T i m e r s i m u l t a n e o u s l y W r i t i n g d a t a i n t o o n l y T i m e r l a t c h S C S G C L K o u t p u t c o n t r o l b i t S C S G C L K o u t p u t d i s a b l e d S C S G a n d S C S G c o u n t s s t o p S C S G C L K o u t p u t e n a b l e d R e s e r v e d b i t s a t r e a d w r i t e b0b 000 0
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. FREQUENCY SYNTHESIZER (PLL) The frequency synthesizer generates the 48 MHz clock required by fUSB and fSYN , which are multiples of the external input refer- ence f(XIN). Figure 59 shows the block diagram for the frequency synthesizer circuit. The Frequency Synthesizer Input Bit selects either f(XIN) or f(XCIN) as an input clock fIN for the frequency synthesizer. The Frequency Synthesizer Multiply Register 2 (FSM2: address 006E 16) divides fIN to generate fPIN, where fPIN = fIN / 2(n + 1), n: value set to FSM2. When the value of Frequency Synthesizer Multiply Register 2 is set to 255, the division is not performed and fPIN will equal fIN. fVCO is generated according to the contents of Frequency Synthe- sizer Multiply Register 1 (FSM1: address 006D16), where fVCO = fPIN ✕ {2(n + 1)}, n: value set to FSM1. Set the value of FSM1 so that the value of fVCO is 48 MHz. fSYN is generated according to the contents of the Frequency Syn- thesizer Divide Register (FSD: address 006F16), where fSYN = fVCO / 2(m + 1), m: value set to FSD. When the value of the Frequency Synthesizer Divide Register is set to 255, the division is not performed and f SYN becomes invalid. [Frequency Synthesizer Control Register] FSC Setting the Frequency Synthesizer Enable Bit (FSE) to “1” enables the frequency synthesizer. When the Frequency Synthesizer Lock Status Bit (LS) is “1” in the frequency synthesizer enabled, this in- dicates that f SYN and fVCO have correct frequencies. I Notes Make sure to connect a low-pulse filter to the LPF pin when using the frequency synthesizer. In addition, please refer to “Program- ming Notes: Frequency Synthesizer” when recovering from a Hardware Reset. F S M 2 D a t a B u s FSM1 F S C P r e s c a l e r fIN fPIN fVCO fSYN fUSB ( a d d r e s s 0 0 6 E1 6) (address 006D 16)( a d d r e s s 0 0 6 C 1 6)( a d d r e s s 0 0 6 F1 F S D Frequency Multiplier Frequency Divider F r e q u e n c y s y n t h e s i z e r l o c k s t a t u s b i t Fig. 59 Frequency synthesizer block diagram
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 60 Structure of frequency synthesizer control register F r e q u e n c y s y n t h e s i z e r c o n t r o l r e g i s t e r a d d r e s s C 1 F S C Frequency synthesizer enable bit (FSE) 0: Disabled 1: Enabled Fix to “00”. Frequency synthesizer input bit (FIN) 0: f(X IN) 1: f(XCIN) Reserved bit (“0” at read/write) LPF current control (CHG1, CHG0) (Note) b6b5 0 0: Not available 0 1: Low current 1 0: Intermediate current (recommended) 1 1: High current Frequency synthesizer lock status bit 0: Unlocked 1: Locked 000 N o t B i t s a n d a r e s e t t o b i t b i t a t r e s e t W h e n u s i n g t h e f r e q u e n c y s y n t h e s i z e r w e r e c o m m e n d t o s e t t o b i t b i t a f t e r l o c k i n g t h e f r e q u e n c y s y n t h e s i z e r b
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. RESET CIRCUIT To reset the microcomputer, RESET pin should be held at an “L” level for 20 cycles or more of φ. Then the RESET pin is returned to an “H” level, and reset is released. They must be performed when the power source voltages are between 3.00 V and 3.60 V or 4.15 V and 5.25 V. After the reset is completed, the program starts from the address contained in address FFFA 16 (high-order byte) and address FFFB 16 (low-order byte). After oscillation has restarted, the timers 1 and 2 secures waiting time for the internal clock φ oscillation stabilized automatically by setting the timer 1 to “FF 16” and timer 2 to “0116”. The internal clock φ retains “H” level until Timer 2’s underflow and it cannot be supplied until the underflow. The pins state during reset are follows:
- When CNVss = “H” Ports P0, P1, P3 3 to P37 : Outputting Pins other than above mentioned ports : Inputting
- When CNVss = “L” All pins : Inputting. Fig. 62 Reset sequence Fig. 61 Reset circuit example (Note) 0.2VCC Poweron VCCRESET VCCRESET Power source voltage detection circuit Power source voltage Reset input voltage Note : Reset release voltage ; Vcc = 3.00 or 4.15 V RESET Internal reset Data φ Address SYNC XIN: 512 clock cycles ? ? ? ? FFFA FFFB AD H ,L ? ? ? ? AD L AD H Reset address from the vector table. Notes: The question marks (?) indicate an undefined state that depends on the previous state.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. X : Not fixed Notes 1: When using the endpoint 1, this contents are “0116”. (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (13) (14) (15) (16) (17) (18) (19) (20) (21) (22) (23) (24) (25) (26) (27) (28) (29) (30) (31) (32) (33) (34) (35) (36) (37) (38) (39) (40) (41) (42) (43) (44) (45) (46) (47) (48) (49) (50) (51) (52) (53) (54) (55) (56) (57) (58) (59) (60) (61) (62) (63) (64) (65) (66) (67) (68) (69) (70) (71) (72) (73) (74) (75) (76) (77) (78) (79) (80) (81) (82) (83) (84) (85) (86) (87) (88) (89) (90) (91) (92) (93) Register contents 003216 003316 003616 003816 003A16 003B16 003E16 003F16 004016 004116 004216 004316 004416 004516 004616 004716 004816 004916 004A16 004C 16 004D 16 004E16 005016 005116 005216 005316 005416 005516 005616 005716 005816 005916 005A16 005B16 005C 16 005D 16 005E16 005F16 006A16 006C 16 006D 16 006E16 006F16 FFC916 (PS) (PC H ) (PCL) Address 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 FF16 0016 0016 0016 0016 0016 0016 0016 0016 FF16 FF16 FF16 FF16 Address Register contents 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 FF16 FF16 FF16 FF16 FF16 FF16 0016 0016 0016 FF16 FF16 0016 0016 FFFB 16 contents FFFA 16 contents CPU mode register A (CPUA) CPU mode register B (CPUB) Interrupt request register A (IREQA) Interrupt request register B (IREQB) Interrupt request register C (IREQC) Interrupt control register A (ICONA) Interrupt control register B (ICONB) Interrupt control register C (ICONC) Port P0 (P0) Port P0 direction register (P0D) Port P1 (P1) Port P1 direction register (P1D) Port P2 (P2) Port P2 direction register (P2D) Port P3 (P3) Port P3 direction register (P3D) Port control register (PTC) Interrupt polarity select register (IPOL) Port P2 pull-up control register (PUP2) USB control register (USBC) Port P6 (P6) Port P6 direction register (P6D) Port P5 (P5) Port P5 direction register (P5D) Port P4 (P4) Port P4 direction register (P4D) Port P7 (P7) Port P7 direction register (P7D) Port P8 (P8) Port P8 direction register (P8D) Clock control register (CCR) Timer XL (TXL) Timer XH (TXH) Timer YL (TYL) Timer YH (TYH) Timer 1 (T1) Timer 2 (T2) Timer 3 (T3) Timer X mode register (TXM) Timer Y mode register (TYM) Timer 123 mode register (T123M) Serial I/O control register 1 (SIOCON1) Serial I/O control register 2 (SIOCON2) Special count source generator 1 (SCSG1) Special count source generator 2 (SCSG2) Special count source mode register (SCSGM) UART1 mode register (U1MOD) 000016 000116 000216 000316 000416 000516 000616 000716 000816 000916 000A16 000B16 000C 16 000D 16 000E16 000F16 001016 001116 001216 001316 001416 001516 001616 001716 001816 001916 001A16 001B16 001C 16 001D 16 001F16 002016 002116 002216 002316 002416 002516 002616 002716 002816 002916 002B16 002C 16 002D 16 002E16 002F16 003016 10 00 0 00UART1 status register (U1STS) UART1 control register (U1CON) UART1 RTS control register (U1RTSC) UART2 mode register (U2MOD) UART2 status register (U2STS) UART2 control register (U2CON) UART2 RTS control register (U2RTSC) DMAC index and status register (DMAIS) DMAC channel x mode register 1 (DMAx1) DMAC channel x mode register 2 (DMAx2) DMAC channel x source register Low (DMAxSL) DMAC channel x source register High (DMAxSH) DMAC channel x destination register Low (DMAxDL) DMAC channel x destination register High (DMAxDH) DMAC channel x transfer count register Low (DMAxCL) DMAC channel x transfer count register High (DMAxCH) Data bus buffer register 0 (DBB0) Data bus buffer status register 0 (DBBS0) Data bus buffer control register 0 (DBBC0) Data bus buffer register 1 (DBB1) Data bus buffer status register 1 (DBBS1) Data bus buffer control register 1 (DBBC1) USB address register (USBA) USB power management register (USBPM) USB interrupt status register 1 (USBIS1) USB interrupt status register 2 (USBIS2) USB interrupt enable register 1 (USBIE1) USB interrupt enable register 2 (USBIE2) USB frame number register Low (USBSOFL) USB frame number register High (USBSOFH) USB endpoint index register (USBINDEX) USB endpoint x IN control register (IN_CSR) USB endpoint x OUT control register (OUT_CSR) USB endpoint x IN max. packet size register (IN_MAXP) USB endpoint x OUT max. packet size register (OUT_MAXP) USB endpoint x OUT write count register Low (WRT_CNTL) USB endpoint x OUT write count register High (WRT_CNTH) USB endpoint FIFO mode register (USBFIFOMR) Flash memory control register (FMCR) Frequency synthesizer control register (FSC) Frequency synthesizer multiply register 1 (FSM1) Frequency synthesizer multiply register 2 (FSM2) Frequency synthesizer divide register (FSM2) ROM code protect control register (ROMCP) Processor status register Program counter 0 0 0 01 100 0 1 10 01 0 0 00 00 0 1 10 00 0 0 00 10 00 0 00 1 10 00 0 0 00 10 11 0 00 1 0 1 00 0000 0 1 00 0000 0 00 0 00 10 0 0 00 1 01 0 0 0 00 0 001 0 0 00 0 00 101 (Note 1) (Note 1) (Note 3) (Note 3) 3: The flash memory control register and the ROM code protect control register exists in the flash memory version only. 2: Since the initial values for other than above mentioned registers and RAM contents are indefinite at reset, they must be set. Fig. 63 Internal status at reset
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. CLOCK GENERATING CIRCUIT The 7641 group has two built-in oscillation circuits. An oscillation circuit can be formed by connecting a resonator between XIN and XOUT (XCIN and XCOUT ). Use the circuit constants in accordance with the resonator manufacturer’s recommended values. No exter- nal resistor is needed between XIN and XOUT since a feed-back resistor exists on-chip. However, an external feed-back resistor is needed between X CIN and XCOUT . When using an external clock, input the clocks to the XIN or XCIN pin and leave the XOUT or XCOUT pin open. Immediately after power on, only the XIN oscillation circuit starts oscillating, and XCIN and XCOUT pins function as I/O ports. Frequency Control The internal system clock can be selected among fSYN , f(XIN), f(XIN)/2, and f(XCIN). The internal clock φ is half the frequency of internal system clock. (1) fSYN clock This is made by the frequency synthesizer. f(XIN) or f(XCIN) can be selected as its input clock. See also section “FREQUENCY SYN- THESIZER”. (2) f(XIN) clock The frequency of internal system clock is the frequency of XIN pin. (3) f(XIN)/2 clock The frequency of internal system clock is half the frequency of XIN pin. (4) f(XCIN) clock The frequency of internal system clock is the frequency of XCIN pin. I Note If you switch the oscillation between XIN - XOUT and XCIN - XCOUT , stabilize both XIN and XCIN oscillations. The sufficient time is re- quired for the XCIN oscillation to stabilize, especially immediately after power on and at returning from the stop mode. Fig. 64 Ceramic resonator or quartz-crystal oscillator exter- nal circuit Fig. 65 External clock input circuit XCIN XCOUT XIN XOUT C IN C OUTC CIN C COUT Rf Rd VCC VSS XCIN XCOUT XIN XOUT Open Open External oscillation circuit External oscillation circuit VCC VSS
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. (5) Low power dissipation mode
- The low power dissipation operation can be realized by stopping the main clock XIN when using f(XCIN) as the internal system clock. To stop the main clock, set the Main Clock (XIN-XOUT ) Stop Bit of the CPU mode register A to “1”.
- The low power dissipation operation can be realized by disabling the reversed amplifier when inputting external clocks to the XIN pin or XCIN pin. To disable the reversed amplifier, set the XCOUT Oscillation Drive Disable Bit (CCR5) or XOUT Oscillation Drive Disable Bit (CCR6) of the clock control register to “1”. Oscillation Control (1) Stop mode If the STP instruction is executed, the internal clock φ stops at “H” level, and XIN and XCIN oscillators stop. Then the timer 1 is set to “FF16” and the internal clock φ divided by 8 is automatically se- lected as its count source. Additionally, the timer 2 is set to “0116” and the timer 1’s output is automatically selected as its count source. Set the Timer 1 and Timer 2 Interrupt Enable Bits to disabled (“0”) before executing the STP instruction. When using an external in- terrupt to release the stop mode, set the Interrupt Enable Bit to be used to enabled (“1”) and the Interrupt Disable Flag (I) to “0”. Oscillator restarts at reset or when an external interrupt including USB resume interrupts is received, but the internal clock φ re- mains at “H” until the timer 2 underflows. The internal clock φ is supplied for the first time when the timer 2 underflows. Therefore make sure not to set the Timer 1 Interrupt Request Bit and Timer
2 Interrupt Request Bit to “1” before the STP instruction stops the
oscillator. (2) Wait mode If the WIT instruction is executed, the internal clock φ stops at “H” level, but the oscillator does not stop. The internal clock φ restarts at reset or when an interrupt is received. Since the oscillator does not stop, normal operation can be started immediately after the in- ternal clock φ is restarted. Set the Interrupt Enable Bit to be used to release the wait mode to enabled (“1”) and the Interrupt Disable Flag (I) to “0”. Fig. 66 Structure of clock control register Clock control register (address 001F16) CCR R e s e r v e d b i t s a t r e a d w r i t e F i x t o XC O U T o s c i l l a t i o n d r i v e d i s a b l e b i t C C R XC O U T o s c i l l a t i o n d r i v e i s e n a b l e d W h e n XC I N o s c i l l a t i o n i s e n a b l e d XC O U T o s c i l l a t i o n d r i v e i s d i s a b l e d XO U T o s c i l l a t i o n d r i v e d i s a b l e b i t C C R XO U T o s c i l l a t i o n d r i v e i s e n a b l e d W h e n XI N o s c i l l a t i o n i s e n a b l e d XO U T o s c i l l a t i o n d r i v e i s d i s a b l e d XI N d i v i d e r s e l e c t b i t C C R V a l i d w h e n C P M A C P M A f XI N ) i s u s e d f o r t h e s y s t e m c l o c k f XI N ) i s u s e d f o r t h e s y s t e m c l o c k b 00000
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 67 Clock generating circuit block diagram W I T i n s t r u c t i o n In t e r n a l c l o c k φ S T P i n s t r u c t i o n I n t e r r u p t r e q u e s t I n t e r r u p t d i s a b l e f l a g l D R Q TP I N 1 D R Q TP I N 2 D R Q TPIN1 D R Q TP 2 + RQ S DQ T PIN1 DQ T P2+ O s c i l l a t o r c o u n t - d o w n t i m e r t o RQ S RQ S RQ S DQ T DQ T SQ R S QBRDelay Slow memory wait LPF L P F Frequency synthesizer Frequency synthesizer enable bit LPF P 2 p e r i p h e r a l P 1 p e r i p h e r a l S T P i n s t r u c t i o n STP instruction R E S E T S T P i n s t r u c t i o n P 2 L A T R S T B P 1 H A T R S T B P 2 p e r i p h e r a l P 1 p e r i p h e r a l P 2 o u t P 1 o u t P2LATRSTB P 1 H A T R S T B P 2 DQ T PIN2 P2+ M a i n c l o c k ( XI N - XO U T) s t o p b i t OSCSTP RESET XCOSCSTP X O S C S T P X D O S C S T P X O D X C D O S C S T P XCOD Sub-clock (XCIN-XCOUT ) stop bit Slow memory wait select bit Slow memory wait mode select bit RDY XI N XO U T Main clock (XIN-XOUT ) stop bit XOSCSTP XC I N S u b - c l o c k ( XCI N - XCO U s t o p b i t XCOUT Frequency synthesizer input bit fIN U S B 4 8 M H z c l o c k o u t p u t fSYN fE X T Internal system clock select bit f ( XI N ) f ( XCI N ) XIN drive select bit P1+, P2+ PIN1, PIN2 P1HATRSTB P2LATRSTB RESET XCOSCSTP External clock select bit
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. N o t e s Reset C P M A 4 → “ F S C → “ ”XI N c l o c k o s c i l l a t i n g , XC I N c l o c k s t o p p e d F r e q u e n c y s y n t h e s i z e r c l o c k s t o p p e d C P M A C F S C φ = f ( XI N / 4 ) 1 : Switch the mode by the allows shown between the mode blocks. (Do not switch between the modes directly without an allow.) 2 : In Stop mode, though the frequency synthesizer is not automatically disabled, the oscillator which sends clocks to the frequency synthesizer stops. Set the system clock and disable the frequency synthesizer before execution of the STP instruction. 3 : φ = f(XIN)/2 can be also used by setting the XIN divider select bit (CCR7) to “1”. Then this diagram also applies to that case. 4 : The frequency synthesizer’s input can be selected between XIN input and XCIN input regardless of the system clock. This diagram assumes the frequency synthesizer’s input to be the system clock. Enable the oscillator to be used for the frequency synthesizer’s input before enabling the frequency synthesizer. 5 : Select the XCIN input as the frequency synthesizer’s input by setting the frequency synthesizer input bit (FSC3) to “1” before stopping XIN oscillation. ( N o t e 3 ) XI N c l o c k o s c i l l a t i n g , XC I N c l o c k s t o p p e d F r e q u e n c y s y n t h e s i z e r c l o c k o s c i l l a t i n g C P M A C F S C φ = f(XIN/4) C P M A → “ ” XI N c l o c k o s c i l l a t i n g , XC I N c l o c k s t o p p e d F r e q u e n c y s y n t h e s i z e r c l o c k o s c i l l a t i n g C P M A C F S C φ = f(PLL)/2(Note 3) (Note 4)W A I T S T O P ( N o t e 2 ) W A I T F S C → “ ”XIN clock oscillating, XCIN clock oscillating, Frequency synthesizer clock stopped, CPMA = 1C, FSC = 60 φ = f ( X I N / 4 ) ( N o t e 3 ) XIN clock oscillating, XCIN clock oscillating, Frequency synthesizer clock oscillating, CPMA = 1C, FSC = 41 φ = f(X IN/4) C P M A → “ ” XIN clock oscillating, XCIN clock oscillating, Frequency synthesizer clock oscillating, CPMA = 5C, FSC = 41 φ = f(PLL)/2 (Note 3) (Note 4) (Note 2) W A I T STOP W A I T C P M A 7 → “ FSC0 N c l o c k o s c i l l a t i n g , XC I N c l o c k o s c i l l a t i n g F r e q u e n c y s y n t h e s i z e r c l o c k s t o p p e d C P M A C F S C φ = f(XCIN/2) XI N c l o c k o s c i l l a t i n g , XC I N c l o c k o s c i l l a t i n g F r e q u e n c y s y n t h e s i z e r c l o c k o s c i l l a t i n g C P M A C F S C φ = f(XCIN/2) CPMA6 N c l o c k o s c i l l a t i n g , XC I N c l o c k o s c i l l a t i n g F r e q u e n c y s y n t h e s i z e r c l o c k o s c i l l a t i n g C P M A D C F S C φ = f(PLL)/2 (Note 4) (Note 2) WAIT S T O P W A I T C P M A 5 → “ F S C 0 → “ ”XI N c l o c k s t o p p e d , XC I N c l o c k o s c i l l a t i n g F r e q u e n c y s y n t h e s i z e r c l o c k s t o p p e d C P M A B C F S C φ = f ( XCI N / 2 ) XI N c l o c k s t o p p e d , XC I N c l o c k o s c i l l a t i n g F r e q u e n c y s y n t h e s i z e r c l o c k o s c i l l a t i n g C P M A B C F S C φ = f(XCIN/2) C P M A 6 → “ ” XI N c l o c k s t o p p e d , XC I N c l o c k o s c i l l a t i n g F r e q u e n c y s y n t h e s i z e r c l o c k o s c i l l a t i n g C P M A F C F S C φ = f(PLL)/2( N o t e 2 ) WAIT S T O P W A I T (Note 5) (Note 4) Remarks : This diagram assumes that:
- Stack page is page 1
- In single-chip mode (Depending on the CPU mode register A)
- φ expresses the internal clock. Fig. 68 State transitions of clock
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. PROCESSOR MODE Single-chip mode, memory expansion mode, and microprocessor mode which is only in the mask ROM version can be selected by using the Processor Mode Bits of CPU mode register A (bits 0 and 1 of address 0000 16). In the memory expansion mode and micro- processor mode, a memory can be expanded externally via ports P0 to P3. In these modes, ports P0 to P3 lose their I/O port func- tions and become bus pins. The port direction registers corresponding to those ports become external memory areas. Fig. 69 Memory maps in processor modes other than single- chip mode (1) Single-chip mode Select this mode by resetting the MCU with CNVSS connected to VSS . (2) Memory expansion mode Select this mode by setting the Processor Mode Bits (b1, b0) to “01” in software with CNV SS connected to VSS . This mode enables external memory expansion while maintaining the validity of the in- ternal ROM. (3) Microprocessor mode Select this mode by resetting the MCU with CNVSS connected to VCC , or by setting the Processor Mode Bits (b1, b0) to “10” in soft- ware with CNVSS connected to VSS . In the microprocessor mode, the internal ROM is no longer valid and an external memory must be used. Do not set this mode in the flash memory version. Port Name Port P0 Port P1 Port P2 Port P3 Function Outputs low-order 8 bits of address. Outputs high-order 8 bits of address. Operates as I/O pins for data D 7 to D0 (including instruction code). P30 is the RDY input pin. P31 and P32 function only as output pins P33 is the DMAOUT output pin. P34 is the φOUT output pin. P35 is the SYNCOUT output pin. P36 is the WR output pin, and P37 is the RD out- put pin. P40 is the EDMA pin. Table 9 Port functions in memory expansion mode and microprocessor mode Port P4 800016 0 4 7 01 0 0 0 01 F F F F1 0 0 0 81 0 0 1 01 I n t e r n a l R A M SFR area 0 0 7 01 Internal ROM M 3 7 6 4 1 M 8 S F R a r e a M e m o r y e x p a n s i o n m o d eM i c r o p r o c e s s o r m o d e T h e s h a d e d a r e a s a r e e x t e r n a l a r e a s . I n t e r n a l R A M S F R a r e a SFR area 047016 0 0 0 01 F F F F1 0 0 0 81 0 0 1 01 0 0 7 01 800016
0 A 7 01
M e m o r y e x p a n s i o n m o d e T h e s h a d e d a r e a s a r e e x t e r n a l a r e a s . SFR area
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 70 Structure of CPU mode register A C P U m o d e r e g i s t e r A a d d r e s s C P M A Processor mode bits b1b0 0 0: Single-chip mode 0 1: Memory expansion mode 1 0: Microprocessor mode (Note 1) 1 1: Not available Stack page select bit 0: Page 0 1: Page 1 Fix to “1”. Sub-clock (X CIN-XCOUT ) stop bit 0: Oscillating 1: Stopped Main clock (X IN-XOUT ) stop bit 0: Oscillating 1: Stopped Internal system clock select bit (Note 2) 0: External clock (X IN-XOUT or XCIN-XCOUT ) 1: fSYN External clock select bit 0: XIN-XOUT 1: XCIN-XCOUT b N o t e T h i s i s n o t a v a i l a b l e i n t h e f l a s h m e m o r y v e r s i o n W h e n C P M A t h e i n t e r n a l s y s t e m c l o c k c a n b e s e l e c t e d b e t w e e n f XI N ) o r f XI N ) b y C C R T h e i n t e r n a l c l o c k φ i s t h e i n t e r n a l s y s t e m c l o c k d i v i d e d b y C P U m o d e r e g i s t e r B a d d r e s s C P M B S l o w m e m o r y w a i t s e l e c t b i t s b b N o w a i t O n e t i m e w a i t T w o t i m e w a i t T h r e e t i m e w a i t S l o w m e m o r y w a i t m o d e s e l e c t b i t s b b S o f t w a r e w a i t N o t a v a i l a b l e R D Y w a i t S o f t w a r e w a i t p l u s R D Y i n p u t a n y t i m e w a i t E x p a n d e d d a t a m e m o r y a c c e s s b i t E D M A o u t p u t d i s a b l e d E D M A o u t p u t e n a b l e d H O L D f u n c t i o n e n a b l e b i t H O L D f u n c t i o n d i s a b l e d H O L D f u n c t i o n e n a b l e d R e s e r e v e d b i t a t r e a d w r i t e F i x t o b0b 1 0 Fig. 71 Structure of CPU mode register B
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Slow Memory Wait The 7641 Group is equipped with the slow memory wait function (Software wait, RDY wait, and Extended RDY wait: software wait plus RDY input anytime wait) for easier interfacing with external devices that have long access times. The slow memory wait func- tion can be enabled in the memory expansion mode and microprocessor mode. The appropriate wait mode is selected by setting bits 0 to 3 of CPU mode register B (address 0001 16). This function can extend the read cycle or write cycle only for access to an external memory. However, this wait function cannot be en- abled for access to addresses 0008 16 to 000F16. (1) Software wait The software wait is selected by setting “00” to the Slow Memory Wait Mode Select Bits of CPU mode register B (address 000116). Read/write cycles (“L” width of RD pin/WR pin) can be extended by one to three φ cycles. The number of cycles to be extended can be selected with the Slow Memory Wait Select Bits. When the software wait function is selected, the RDY pin status becomes in- valid. (2) RDY wait RDY Wait is selected by setting “10” to the Slow Memory Wait Mode Select Bits of CPU mode register B (address 000116). When a fixed time of “L” is input to the RDY pin at the beginning of a read/write cycle (before φ cycle falls), the MCU goes to the RDY state. The read/write cycle can then be extended by one to three φ cycles. The number of φ cycles to be added can be selected by the Slow Memory Wait Bits. (3) Software wait + Extended RDY wait Extended RDY Wait is selected by setting “11” to the Slow Memory Wait Mode Select Bits of CPU mode register B (address 000116). The read/write cycle can be extended when a fixed time of “L” is input to the RDY pin at the beginning of a read/write cycle (before φ cycle falls). The RDY pin state is checked continually at each fall of φ cycle until the RDY pin goes to “H ”. When “H ” is in- put to the RDY pin, the wait is released within 1, 2, or 3 φ cycles (as selected with the Slow Memory Wait Bits). Fig. 72 Software wait timing diagram XIN φ O U T A D O U T RD W R C P M B 6 C P M B 1-cycle software waitNo wait CPMB = 02 16 2-cycle software wait C P M B 3-cycle software wait N o t T h i s d i a g r a m a s s u m e s φ XI N / Fig. 73 RDY wait timing diagram XIN φ OUT AD OUT RD WR CPMB = 0816 CPMB = 0916 CPMB = 0A 16 CPMB = 0B 16 RDY tsu 1-time RDY waitNo wait 2-time RDY wait 3-time RDY wait tsu tsu tsu tsu tsu Note: This diagram assumes φ = XIN/2.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 74 Extended RDY wait (software wait plus RDY input anytime wait) timing diagram XIN φOUT AD OUT RD WR CPMB = 0C 16 CPMB = 0D 16 CPMB = 0E 16 RDY tsu CPMB = 0F 16CPMB = 0E 16 1-cycle extended RDY waitNo wait 2-cycle extended RDY wait tsu tsu tsu tsu tsu tsu tsu tsu tsu tsu tsu tsu XIN φOUT AD OUT RD WR RDY 2-cycle extended RDY wait 3-cycle extended RDY wait tsu tsu tsu tsu tsu tsu tsutsu tsu tsu tsu tsutsu tsu tsu Note: This diagram assumes φ = XIN/2.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. HOLD Function The HOLD function is used for systems that consist of external cir- cuits that access MCU buses without use of the CPU (Central Processing Unit). The HOLD function is used to generate the tim- ing in which the MCU will relinquish the bus from the CPU to the external circuits. To use the HOLD function, set the HOLD function Enable Bit of CPU mode register B (address 0001 16) to “1”. This function can be used with both the HOLD pin and the HLDA pin. The HOLD signal is a signal from an external circuit requesting the MCU to relinquish use of the bus. When “L” level is input, the MCU goes to the HOLD state and remains so while the pin is at “L”. The oscillator does not stop oscillating during the HOLD state, there- fore allowing the internal peripheral functions to operate during this time. When the MCU relinquishes use of the bus, “L” level is output from the HLDA pin. The MCU makes ports P0 and P1 (address buses) and port P2 (data bus) tri-state outputs and holds port P3 7 (RD pin) and port P36 (WR pin) “H ” level. Port P34 (φ OUT pin) contin- ues to oscillate. This function is not valid when the MCU is using the IBF 1 function with the HLDA pin. Expanded Data Memory Access In Expanded Data Memory Access Mode, the MCU can access a data area larger than 64 Kbytes with the LDA ($zz), Y (indirect Y) instruction and the STA ($zz), Y (indirect Y) instruction. To use this mode, set the Expanded Data Memory Access Bit of CPU mode register B (address 0001 16) to “1”. In this case, port P4 0 (EDMA pin) goes “L” level during the read/write cycle of the LDA or STA instruction. The determination of which bank to access is done by using an I/ O port to represent expanded addresses exceeding address bus AB 15. For example, when accessing 4 banks, use two I/O ports to represent address buses AB16 and AB17. Fig. 75 Hold function timing diagram XI N R D R A D D R O U T D A T AI N O U T H O L D H L D A φ OUT tsu(HOLD-φ) th(φ-HOLD) t d (φ- H L D A L ) t d (φ- H L D A H N o t T h i s d i a g r a m a s s u m e s φ XI N /
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 76 STA ($ zz), Y instruction sequence when EDMA enabled φ S Y N C O U T R D W R Address D a t a P C 1PC PC + 2 O p c o d e E D M A B A L BAL, 00 B A L
0 AD L + Y,
AD L + Y, AD H + C A D L AD H I n v a l i dD a t a N e x t O p c o d e φ S Y N C O U T RD W R Address D a t a PC +1PC P C O p c o d e E D M A BAL B A L 0 B A L AD L + Y, AD H + C AD L A D H Invalid Data N ext Op code Fig. 77 LDA ($ zz), Y instruction sequence when EDMA enabled and T flag = “0” Fig. 78 LDA ($ zz), Y instruction sequence when EDMA enabled and T flag = “1” φ S Y N C O U T R D W R A d d r e s s D a t a P C C X, 00 Op code EDMA BAL B A L 0 B A L AD L + Y, AD H + C A D L AD H I n v a l i dD a t a N ext Op code PC + 2 I n v a l i dD a t a
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. Parameter Power source voltage Analog power source voltage Input voltage P0 0–P07, P10–P17, P20–P27, P30–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 Input voltage RESET, XIN, XCIN Input voltage CNV SS Mask ROM version Flash memory version Input voltage USB D+, USB D– Output voltage P0 0–P07, P10–P17, P20–P27, P30–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87, XOUT , XCOUT, LPF Output voltage USB D+, USB D– Power dissipation (Note) Operating temperature Storage temperature Symbol V CC AV CC VI VI VI VI VO VO Pd Topr Tstg
ELECTRICAL CHARACTERISTICS
–0.3 to 6.5 –0.3 to VCC +0.3 –0.3 to VCC +0.3 –0.3 to VCC +0.3 –0.3 to Vcc + 0.3 –0.3 to 6.5 –0.5 to 3.8 –0.3 to V CC +0.3 Unit V V V V V V V V All voltages are based on Vss. Output transistors are cut off. Ta = 25°C –0.5 to 3.8 750 –20 to 70 –40 to 125 V mW Note: The maximum power dissipation depends on the MCU’s power dissipation and the specific heat consumption of the package. Absolute Maximum Ratings Table 10 Absolute maximum ratings
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. Table 11 Recommended operating conditions (Vcc = 4.15 to 5.25 V, Vss = 0 V, Ta = –20 to 70°C, unless otherwise noted) Power source voltage Analog reference voltage Power source voltage Analog reference voltage “H” input voltage P0 0–P07, P10–P17, P20–P27, P30–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 “H” input voltage (Selecting VIHL level input) P20–P27 “H” input voltage (Selecting TTL level input for MBI input) P54–P57, P60–P67, P72 “H” input voltage RESET, X IN, XCIN, CNVss “H” input voltage USB D+, USB D– “L” input voltage P0 0–P07, P10–P17, P20–P27, P30–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 “L” input voltage (Selecting VIHL level input) P20–P27 “L” input voltage (Selecting TTL level input for MBI input) P54–P57, P60–P67, P72 “L” input voltage RESET, X IN, XCIN, CNVss “L” input voltage USB D+, USB D– “H” total peak output current P0 0–P07, P10–P17, P20–P27, (Note 1)P 3 0–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 “L” total peak output current P00–P07, P10–P17, P20–P27, (Note 1)P 3 0–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 “H” total average output current P00–P07, P10–P17, P20–P27, (Note 1)P 3 0–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 “L” total average output current P00–P07, P10–P17, P20–P27, (Note 1)P 3 0–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 “H” peak output current P0 0–P07, P10–P17, P20–P27, (Note 2)P 3 0–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 “L” peak output current P0 0–P07, P10–P17, P20–P27, (Note 2)P 3 0–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 “H” average output current P00–P07, P10–P17, P20–P27, (Note 3)P 3 0–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 “L” average output current P00–P07, P10–P17, P20–P27, (Note 3)P 3 0–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 Timer X input frequency (Note 4) Timer Y input frequency (Note 4) Main clock input frequency (Notes 4, 5) Sub-clock input frequency (Notes 4, 6) VCC AVcc VSS AV SS VIH VIH VIH VIH VIH VIL VIL VIL VIL VIL ΣIOH(peak) ΣIOL(peak) ΣIOH(avg) ΣIOL(avg) IOH(peak) IOL(peak) IOH(avg) IOL(avg) f(CNTR0) f(CNTR1) f(XIN) f(XCIN) Limits V V V V V Parameter Min. 4.15 4.15 0.8V CC 0.5VCC 2.0 Typ. 5.0 5.0 Max. 5.25 V CC Symbol Unit 0.8VCC 2.0 32.768 VCC VCC VCC VCC 3.8 0.2VCC 0.16VCC 0.8 0.2VCC 0.8 –80 –40 –10 –5.0 5.0 5.0 5.0 50/5.0 V V V V V V V V V mA mA mA mA mA mA mA mA MHz MHz MHz kHz/MHz Recommended Operating Conditions In Vcc = 5 V
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change.Notes 1: The total peak output current is the peak value of the peak currents flowing through all the applicable ports. The total average output current is the average value measured over 100 ms flowing through all the applicable ports. 2:The peak output current is the peak current flowing in each port. 3:The average output current is an average value measured over 100 ms. 4: The duty of oscillation frequency is 50 %. 5: Connect a ceramic resonator or a quartz-crystal oscillator between the XIN and XOUT pins. Its maximum oscillation frequency must be 24 MHz. However, make sure to set φ to 12 MHz or slower. More faster clocks are required as the f(XIN) when using the frequency synthesizer as possible. 6: Connect a ceramic resonator or a quartz-crystal oscillator between the XCIN and XCOUT pins. Its maximum oscillation frequency must be 50 kHz. Input an external clock having 5 MHz frequency (max.) from the XCIN pin.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. IOH = –10 mA“H” output voltage P00–P07, P10–P17, P20–P27, P30–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 “H” output voltage USB D+, USB D- Limits V Parameter Min. VCC –2.0 Typ. Max.Symbol UnitTest conditions VOH VOH Table 12 Electrical characteristics (1) (Vcc = 4.15 to 5.25 V, Vss = 0 V, Ta = –20 to 70°C, unless otherwise noted) In Vcc = 5 V USB+, and USB- pins pull-down via a resistor of 15 kΩ ± 5 % USB+ pin pull-up to Ext. Cap. pin via a resistor of 1.5 kΩ ± 5 % I OL = 10 mAVOL “L” output voltage P00–P07, P10–P17, P20–P27, P30–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 “L” output voltage USB D+, USB D- USB+, and USB- pins pull-down via a resistor of 15 kΩ ± 5 % USB+ pin pull-up to Ext. Cap. pin via a resistor of 1.5 kΩ ± 5 % V T+–VT- Hysteresis CNTR 0, CNTR1, INT0, INT1, RDY, HOLD, P20–P27 Hysteresis URXD1, URXD2 (SCLK), CTS2 (SRXD), SRDY, CTS 1 Hysteresis RESET “H” input current P00–P07, P10–P17, P20–P27, P30–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 “H” input current RESET, CNVSS “H” input current XIN “H” input current XCIN “L” input current P00–P07, P10–P17, P30–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 “L” input current RESET “L” input current CNV SS “L” input current XIN “L” input current XCIN “L” input current P20–P27 VT+–VT- VT+–VT- IIH IIH IIH IIH IIL IIL IIL IIL IIL IIL VI = VCC VI = VSS VI = VSS Pull-ups “off” V CC = 5.0 V, VI = VSS Pull-ups “on” When clock is stopped 2.8 –30 2.0 0.5 0.5 0.5 9.0 –9.0 –65 3.6 2.0 0.3 5.0 5.0 5.0 –5.0 –5.0 –20 –20 –5.0 –5.0 V V V V V V µA µA µA µA µA µA µA µA µA µA µA V OL –140
5.25 VVRAM
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. Power source current (Output transistor is isolated.) LimitsParameter Min. Typ. Max. Symbol UnitTest conditions ICC mA Table 13 Electrical characteristics (2) (Vcc = 4.15 to 5.25 V, Vss = 0 V, Ta = –20 to 70°C, unless otherwise noted) In Vcc = 5 V Normal mode (Note 1) f(XIN) = 24 MHz, φ = 12 MHz USB operating Frequency synthesizer ON Wait mode (Note 2) f(X IN) = 24 MHz, φ = 12 MHz USB enabled, USB clock stopped Frequency synthesizer ON Wait mode (Note 3) f(X CIN) = 32 kHz, φ = 16 kHz USB disabled Frequency synthesizer OFF USB transceiver DC-DC converter OFF Stop mode USB transceiver DC-DC converter ON Low current mode (USBC3 = “1”) Stop mode USB transceiver DC-DC converter OFF Ta = 25 °C Stop mode USB transceiver DC-DC converter OFF Ta = 70 °C 5.0 100 250 1.0 mA µA µA µA µA <Test conditions> Notes 1: Operating in single-chip mode Clock input from XIN pin (XOUT oscillator stopped) USB operating with USB transceiver DC-DC converter enabled Operating functions: Frequency synthesizer, CPU, two UARTs, DMAC, Timers and Count source generator Disabled functions: Master CPU bus interface and Serial I/O 2: Operating in single-chip mode with Wait mode Clock input from X IN pin (XOUT oscillator stopped) USB suspended due to USB clock stopped with USB transceiver DC-DC converter enabled Operating functions: Frequency synthesizer, Timers and Count source generator Disabled functions: CPU, two UARTs, DMAC, Master CPU bus interface and Serial I/O 3: Operating in single-chip mode with Wait mode X IN - XOUT oscillator stopped Clock input from XCIN pin (XCOUT oscillator stopped) USB stopped, USB clock stopped and USB transceiver DC-DC converter disabled Operating functions: Timers and Count source generator Disabled functions: Frequency synthesizer, CPU, two UARTs, DMAC, Master CPU bus interface and Serial I/O
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. Reset input “L” pulse width Main clock input cycle time (Note) Main clock input “H” pulse width Main clock input “L” pulse width Sub-clock input cycle time Sub-clock input “H” pulse width Sub-clock input “L” pulse width INT 0, INT1 input cycle time INT0, INT1 input “H” pulse width INT0, INT1 input “L” pulse width CNTR 0, CNTR1 input cycle time CNTR 0, CNTR1 input “H” pulse width CNTR 0, CNTR1 input “L” pulse width Timer TOUT delay time Timer CNTR0 delay time (Pulse output mode) Timer CNTR0 input cycle time (Event counter mode) Timer CNTR0 input “H” pulse width (Event counter mode) Timer CNTR0 input “L” pulse width (Event counter mode) Timer CNTR1 delay time (Pulse output mode) Timer CNTR1 input cycle time (Event counter mode) Timer CNTR1 input “H” pulse width (Event counter mode) Timer CNTR1 input “L” pulse width (Event counter mode) Serial I/O external clock input cycle time Serial I/O external clock input “H” pulse width Serial I/O external clock input “L” pulse width Serial I/O input setup time (external clock) Serial I/O input hold time (external clock) Serial I/O output delay time (external clock) Serial I/O SRDY valid time (external clock) Serial I/O internal clock output cycle time Serial I/O internal clock output “H” pulse width Serial I/O internal clock output “L” pulse width Serial I/O input setup time (internal clock) Serial I/O input hold time (internal clock) Serial I/O output delay time (internal clock) tW (RESET) tC (XIN) tWH (XIN) tWL (XIN) tC (XCIN) tWH (XCIN) tWL (XCIN) tC (INT) tWH (INT) tWL (INT) tC (CNTRI) tWH (CNTRI) tWL (CNTRI) td(φ -TOUT) td(φ -CNTR0) tC (CNTR E0) tWH (CNTR E0) tWL (CNTR E0) td(φ -CNTR1) tC (CNTR E1) tWH (CNTR E1) tWL (CNTR E1) tC (SCLK E) tWH (SCLK E) tWL (SCLK E) tsu(SRXD-SCLK E) th(SCLK E-SRXD) td(SCLK E-STXD) tv(SCLK E-SRDY) tc(SCLK I) tWH (SCLK I) tWL (SCLK I) tsu(SRXD-SCLK I) th(SCLK I-SRXD) td(SCLK I-STXD) Limits µs ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns Parameter Min. 41.66 0.4•tc(X IN) 0.4•tc(XIN) 200 0.4•tc(XCIN) 0.4•tc(XCIN) 200 200 200 0.4•tc(CNTR E0) 0.4•tc(CNTRE0) 200 0.4•tc(CNTRE1) 0.4•tc(CNTRE1) 400 190 180 166.66 0.5•tc(SCLK I) – 5 0.5•tc(SCLKI) – 5 T yp. Max.Symbol Unit Table 14 Timing requirements (Vcc = 4.15 to 5.25 V, Vss = 0 V, Ta = –20 to 70°C, unless otherwise noted) Note: Make sure not to exceed 12 MHz of φ, in other words, tc(φ) ≥ 83.33 ns). For example, set bit 7 of the clock control register (CCR) to “0” in the case of tc(XIN) < 41.66 ns. Timing Requirements In Vcc = 5 V
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. S0, S1 setup time for read S0, S1 setup time for write S0, S1 hold time for read S0, S1 hold time for write A0 setup time for read A0 setup time for write A0 hold time for read A0 hold time for write Read pulse width Write pulse width Data input setup time before write Data input hold time after write Data output enable time after read Data output disable time after read OBF output transmission time after read IBF output transmission time after write tsu(S-R) tsu(S-W) th(R-S) th(W-S) tsu(A-R) tsu(A-W) th(R-A) th(W-A) tw (R) tw (W) tsu(D-W) th(W-D) ta(R-D) tv(R-D) tv(R-OBF) td(W-IBF) Limits ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns Parameter Min. Typ. Max.Symbol Unit Table 15 Master CPU bus interface (MBI; RD, WR separate type) (Vcc = 4.15 to 5.25 V, Vss = 0 V, Ta = –20 to 70°C, unless otherwise noted) In Vcc = 5 V S0, S1 setup time S0, S1 hold time A0 setup time A0 hold time R/W setup time R/W hold time Enable pulse width Enable pulse interval Data input setup time before write Data input hold time after write Data output enable time after read Data output disable time after read OBF output transmission time after E inactive IBF output transmission time after E inactive tsu(S-E) th(E-S) tsu(A-E) th(E-A) tsu(RW-E) th(E-RW) tw (E) tw (E-E) tsu(D-E) th(E-D) ta(E-D) tv(E-D) tv(E-OBF) td(E-IBF) Limits ns ns ns ns ns ns ns ns ns ns ns ns ns ns Parameter Min. Typ. Max.Symbol Unit Table 16 Master CPU bus interface (MBI; R/W type) (Vcc = 4.15 to 5.25 V, Vss = 0 V, Ta = –20 to 70°C, unless otherwise noted) In Vcc = 5 V
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. φ clock cycle time φ clock “H” pulse width φ clock “L” pulse width AB 15–AB 8 delay time AB 15–AB 8 valid time AB 7–AB 0 delay time AB 7–AB 0 valid time WR delay time WR valid time RD delay time RD valid time SYNC OUT delay time SYNC OUT valid time DMA OUT delay time DMA OUT valid time RDY setup time RDY hold time HOLD setup time HOLD hold time HOLD “L” delay time HOLD “H” delay time Data bus setup time Data bus hold time Data bus delay time Data bus valid time (Note 1) EDMA delay time EDMA valid time WR pulse width RD pulse width AB 15–AB 8 valid time before WR AB 7–AB 0 valid time before WR AB 15–AB 8 valid time after WR AB 7–AB 0 valid time after WR AB 15–AB 8 valid time before RD AB 7–AB 0 valid time before RD AB 15–AB 8 valid time after RD AB 7–AB 0 valid time after RD RDY setup time before WR RDY hold time after WR RDY setup time before RD RDY hold time after RD Data bus setup time before RD Data bus hold time after RD Data bus delay time before WR Data bus valid time after WR (Note 1) EDMA delay time after WR EDMA valid time after RD USB output rise time, C L = 50 pF USB output fall time, CL = 50 pF tC (φ) tWH (φ) tWL (φ) td(φ -AH) tv(φ -AH) td(φ -AL) tv(φ -AL) td(φ -WR) tv(φ -WR) td(φ -RD) tv(φ -RD) td(φ -SYNC) tv(φ -SYNC) td(φ -DMA) tv(φ -DMA) tsu(RDY- φ) th(φ -RDY) tsu(HOLD- φ) th(φ -HOLD) td(φ -HLDAL) td(φ -HLDAH) tsu(DB- φ) th(φ -DB) td(φ -DB) tV(φ -DB) td(φ -EDMA) tv(φ -EDMA) tWL (WR) (Note 2) tWL (RD) (Note 2) td(AH-WR) td(AL-WR) tv(WR-AH) tv(WR-AL) td(AH-RD) td(AL-RD) tv(RD-AH) tv(RD-AL) tsu(RDY-WR) th(WR-RDY) tsu(RDY-RD) th(RD-RDY) tsu(DB-RD) th(RD-DB) td(WR-DB) tv(WR-DB) tv(WR-EDMA) tv(RD-EDMA) tr(D+), tr(D-) tf(D+), tf(D-) Limits ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns Parameter Min. 83.33 0.5•tc(φ) – 5 0.5•tc(φ) – 5 0.5•tc(φ) – 5 0.5•tc(φ) – 5 0.5•tc(φ) – 28 0.5•tc(φ) – 30 0.5•tc(φ) – 28 0.5•tc(φ) – 30 T yp. Max.Symbol Unit Table 17 Timing requirements and switching characteristics in memory expansion and microprocessor modes (Vcc = 4.15 to 5.25 V, Vss = 0 V, Ta = –20 to 70°C, unless otherwise noted) In Vcc = 5 V
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change.Notes 1: Test conditions: IOHL = ± 5mA, CL = 50 pF 2: twL (RD) = ((n + 0.5) • tc(PHI)) – 5 ns (n = wait number) twL (WR) = ((n + 0.5) • tc(PHI)) – 5 ns (n = wait number) For example, two software waits, PHI = 12 MHz operating t wL (RD) = 2.5 • tc(PHI) – 5 ns = 203.33 ns Table 18 Recommended operating conditions (Vcc = 3.0 to 3.6 V, Vss = 0 V, Ta = –20 to 70°C, unless otherwise noted) Power source voltage Analog reference voltage Power source voltage Analog reference voltage “H” input voltage P0 0–P07, P10–P17, P20–P27, P30–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 “H” input voltage (Selecting VIHL level input) P20–P27 “H” input voltage RESET, X IN, XCIN, CNVss “H” input voltage USB D+, USB D– “L” input voltage P0 0–P07, P10–P17, P20–P27, P30–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 “L” input voltage (Selecting VIHL level input) P20–P27 “L” input voltage RESET, X IN, XCIN, CNVss “L” input voltage USB D+, USB D– “H” total peak output current P0 0–P07, P10–P17, P20–P27, (Note 1)P 3 0–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 “L” total peak output current P00–P07, P10–P17, P20–P27, (Note 1)P 3 0–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 “H” total average output current P00–P07, P10–P17, P20–P27, (Note 1)P 3 0–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 “L” total average output current P00–P07, P10–P17, P20–P27, (Note 1)P 3 0–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 “H” peak output current P0 0–P07, P10–P17, P20–P27, (Note 2)P 3 0–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 “L” peak output current P0 0–P07, P10–P17, P20–P27, (Note 2)P 3 0–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 “H” average output current P00–P07, P10–P17, P20–P27, (Note 3)P 3 0–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 “L” average output current P00–P07, P10–P17, P20–P27, (Note 3)P 3 0–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 Timer X input frequency (Note 4) Timer Y input frequency (Note 4) Main clock input frequency (Notes 4, 5) Sub-clock input frequency (Notes 4, 6) VCC AVcc VSS AV SS VIH VIH VIH VIH VIL VIL VIL VIL ΣIOH(peak) ΣIOL(peak) ΣIOH(avg) ΣIOL(avg) IOH(peak) IOL(peak) IOH(avg) IOL(avg) f(CNTR0) f(CNTR1) f(XIN) f(XCIN) Limits V V V V V Parameter Min. 3.0 3.0 0.8V CC 0.5VCC 0.8VCC 2.0 Typ. 3.3 3.3 Max. 3.6 V CC Symbol Unit 32.768 VCC VCC VCC 0.2VCC Recommended Operating Conditions In Vcc = 3 V 0.16VCC 0.2VCC 0.8 –80 –40 –10 –5.0 5.0 5.0 5.0 50/5.0 V V V V V V V mA mA mA mA mA mA mA mA MHz MHz MHz kHz/MHz
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change.Notes 1: The total peak output current is the peak value of the peak currents flowing through all the applicable ports. The total average output current is the average value measured over 100 ms flowing through all the applicable ports. 2:The peak output current is the peak current flowing in each port. 3:The average output current is an average value measured over 100 ms. 4: The duty of oscillation frequency is 50 %. 5: Connect a ceramic resonator or a quartz-crystal oscillator between the XIN and XOUT pins. Its maximum oscillation frequency must be 24 MHz. However, make sure to set φ to 6 MHz or slower. More faster clocks are required as the f(XIN) when using the frequency synthesizer as possible. 6: Connect a ceramic resonator or a quartz-crystal oscillator between the XCIN and XCOUT pins. Its maximum oscillation frequency must be 50 kHz. Input an external clock having 5 MHz (max.) frequency from the XCIN pin.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. Table 19 Electrical characteristics (1) (Vcc = 3.0 to 3.6 V, Vss = 0 V, Ta = –20 to 70°C, unless otherwise noted) In Vcc = 3 V IOH = –1 mA“H” output voltage P00–P07, P10–P17, P20–P27, P30–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 “H” output voltage USB D+, USB D- Limits V Parameter Min. VCC –1.0 Typ. Max.Symbol UnitTest conditions VOH VOH USB+, and USB- pins pull-down via a resistor of 15 kΩ ± 5 % USB+ pin pull-up to Ext. Cap. pin via a resistor of 1.5 kΩ ± 5 % I OL = 1 mAVOL “L” output voltage P00–P07, P10–P17, P20–P27, P30–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 “L” output voltage USB D+, USB D- USB+, and USB- pins pull-down via a resistor of 15 kΩ ± 5 % USB+ pin pull-up to Ext. Cap. pin via a resistor of 1.5 kΩ ± 5 % V T+–VT- Hysteresis CNTR 0, CNTR1, INT0, INT1, RDY, HOLD, P20–P27 Hysteresis URXD1, URXD2 (SCLK), CTS2 (SRXD), SRDY , CTS1 Hysteresis RESET “H” input current P00–P07, P10–P17, P20–P27, P30–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 “H” input current RESET, CNVSS “H” input current XIN “H” input current XCIN “L” input current P00–P07, P10–P17, P30–P37, P40–P44, P50–P57, P60–P67, P70–P74, P80–P87 “L” input current RESET “L” input current CNV SS “L” input current XIN “L” input current XCIN “L” input current P20–P27 VT+–VT- VT+–VT- IIH IIH IIH IIH IIL IIL IIL IIL IIL IIL VI = VCC VI = VSS VI = VSS Pull-ups “off” V CC = 3.0 V, VI = VSS Pull-ups “on” When clock is stopped 2.8 –10 2.0 0.3 0.3 0.3 9.0 –9.0 –20 3.6 1.0 0.3 5.0 5.0 5.0 –5.0 –5.0 –20 –20 –5.0 –5.0 V V V V V V µA µA µA µA µA µA µA µA µA µA µA V OL –50 VVRAM
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. Table 20 Electrical characteristics (2) (Vcc = 3.0 to 3.6 V, Vss = 0 V, Ta = –20 to 70°C, unless otherwise noted) In Vcc = 3 V Power source current (Output transistor is isolated.) LimitsParameter Min. Typ. Max. Symbol UnitTest conditions ICC mANormal mode (Note 1) f(XIN) = 24 MHz, φ = 6 MHz USB operating Frequency synthesizer ON Wait mode (Note 2) f(X IN) = 24 MHz, φ = 6 MHz USB enabled, USB clock stopped Frequency synthesizer ON Wait mode (Note 3) f(X CIN) = 32 kHz, φ = 16 kHz USB disabled Frequency synthesizer OFF USB transceiver DC-DC converter OFF Stop mode USB transceiver DC-DC converter ON Low current mode (USBC3 = “1”) Stop mode USB transceiver DC-DC converter OFF Ta = 25 °C Stop mode USB transceiver DC-DC converter OFF Ta = 70 °C 2.5 TBD TBD 1.0 mA µA µA µA µA <Test conditions> Notes 1: Operating in single-chip mode Clock input from XIN pin (XOUT oscillator stopped) USB operating with USB transceiver DC-DC converter enabled Operating functions: Frequency synthesizer, CPU, two UARTs, DMAC, Timers and Count source generator Disabled functions: Master CPU bus interface and Serial I/O 2: Operating in single-chip mode with Wait mode Clock input from X IN pin (XOUT oscillator stopped) USB suspended due to USB clock stopped with USB transceiver DC-DC converter enabled Operating functions: Frequency synthesizer, Timers and Count source generator Disabled functions: CPU, two UARTs, DMAC, Master CPU bus interface and Serial I/O 3: Operating in single-chip mode with Wait mode X IN - XOUT oscillator stopped Clock input from XCIN pin (XCOUT oscillator stopped) USB stopped, USB clock stopped and USB transceiver DC-DC converter disabled Operating functions: Timers and Count source generator Disabled functions: Frequency synthesizer, CPU, two UARTs, DMAC, Master CPU bus interface and Serial I/O
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. Reset input “L” pulse width Main clock input cycle time (Note) Main clock input “H” pulse width Main clock input “L” pulse width Sub-clock input cycle time Sub-clock input “H” pulse width Sub-clock input “L” pulse width INT 0, INT1 input cycle time INT0, INT1 input “H” pulse width INT0, INT1 input “L” pulse width CNTR 0, CNTR1 input cycle time CNTR 0, CNTR1 input “H” pulse width CNTR 0, CNTR1 input “L” pulse width Timer TOUT delay time Timer CNTR0 delay time (Pulse output mode) Timer CNTR0 input cycle time (Event counter mode) Timer CNTR0 input “H” pulse width (Event counter mode) Timer CNTR0 input “L” pulse width (Event counter mode) Timer CNTR1 delay time (Pulse output mode) Timer CNTR1 input cycle time (Event counter mode) Timer CNTR1 input “H” pulse width (Event counter mode) Timer CNTR1 input “L” pulse width (Event counter mode) Serial I/O external clock input cycle time Serial I/O external clock input “H” pulse width Serial I/O external clock input “L” pulse width Serial I/O input setup time (external clock) Serial I/O input hold time (external clock) Serial I/O output delay time (external clock) Serial I/O SRDY valid time (external clock) Serial I/O internal clock output cycle time Serial I/O internal clock output “H” pulse width Serial I/O internal clock output “L” pulse width Serial I/O input setup time (internal clock) Serial I/O input hold time (internal clock) Serial I/O output delay time (internal clock) tW (RESET) tC (XIN) tWH (XIN) tWL (XIN) tC (XCIN) tWH (XCIN) tWL (XCIN) tC (INT) tWH (INT) tWL (INT) tC (CNTRI) tWH (CNTRI) tWL (CNTRI) td(φ -TOUT) td(φ -CNTR0) tC (CNTR E0) tWH (CNTR E0) tWL (CNTR E0) td(φ -CNTR1) tC (CNTR E1) tWH (CNTR E1) tWL (CNTR E1) tC (SCLK E) tWH (SCLK E) tWL (SCLK E) tsu(SRXD-SCLK E) th(SCLK E-SRXD) td(SCLK E-STXD) tv(SCLK E-SRDY) tc(SCLK I) tWH (SCLK I) tWL (SCLK I) tsu(SRXD-SCLK I) th(SCLK I-SRXD) td(SCLK I-STXD) Limits µs ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns Parameter Min. 41.66 0.4•tc(X IN) 0.4•tc(XIN) 200 0.4•tc(XCIN) 0.4•tc(XCIN) 250 110 110 250 110 110 250 0.4•tc(CNTR E0) 0.4•tc(CNTRE0) 250 0.4•tc(CNTRE1) 0.4•tc(CNTRE1) 450 220 190 300 0.5•tc(SCLK I) – 5 0.5•tc(SCLKI) – 5 T yp. Max.Symbol Unit Table 21 Timing requirements (Vcc = 3.0 to 3.6 V, Vss = 0 V, Ta = –20 to 70°C, unless otherwise noted) Note: Make sure not to exceed 6 MHz of φ, in other words, tc(φ) ≥ 166.66 ns). Timing Requirements In Vcc = 3 V
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. S0, S1 setup time for read S0, S1 setup time for write S0, S1 hold time for read S0, S1 hold time for write A0 setup time for read A0 setup time for write A0 hold time for read A0 hold time for write Read pulse width Write pulse width Data input setup time before write Data input hold time after write Data output enable time after read Data output disable time after read OBF output transmission time after read IBF output transmission time after write tsu(S-R) tsu(S-W) th(R-S) th(W-S) tsu(A-R) tsu(A-W) th(R-A) th(W-A) tw (R) tw (W) tsu(D-W) th(W-D) ta(R-D) tv(R-D) tv(R-OBF) td(W-IBF) Limits ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns Parameter Min. Typ. Max.Symbol Unit Table 22 Master CPU bus interface (MBI; RD, WR separate type) (Vcc = 3.0 to 3.6 V, Vss = 0 V, Ta = –20 to 70°C, unless otherwise noted) In Vcc = 3 V S0, S1 setup time S0, S1 hold time A0 setup time A0 hold time R/W setup time R/W hold time Enable pulse width Enable pulse interval Data input setup time before write Data input hold time after write Data output enable time after read Data output disable time after read OBF output transmission time after E inactive IBF output transmission time after E inactive tsu(S-E) th(E-S) tsu(A-E) th(E-A) tsu(RW-E) th(E-RW) tw (E) tw (E-E) tsu(D-E) th(E-D) ta(E-D) tv(E-D) tv(E-OBF) td(E-IBF) Limits ns ns ns ns ns ns ns ns ns ns ns ns ns ns Parameter Min. Typ. Max.Symbol Unit Table 23 Master CPU bus interface (MBI; R/W type) (Vcc = 3.0 to 3.6 V, Vss = 0 V, Ta = –20 to 70°C, unless otherwise noted) In Vcc = 3 V
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. φ clock cycle time φ clock “H” pulse width φ clock “L” pulse width AB 15–AB 8 delay time AB 15–AB 8 valid time AB 7–AB 0 delay time AB 7–AB 0 valid time WR delay time WR valid time RD delay time RD valid time SYNC OUT delay time SYNC OUT valid time DMA OUT delay time DMA OUT valid time RDY setup time RDY hold time HOLD setup time HOLD hold time HOLD “L” delay time HOLD “H” delay time Data bus setup time Data bus hold time Data bus delay time Data bus valid time (Note 1) EDMA delay time EDMA valid time WR pulse width RD pulse width AB 15–AB 8 valid time before WR AB 7–AB 0 valid time before WR AB 15–AB 8 valid time after WR AB 7–AB 0 valid time after WR AB 15–AB 8 valid time before RD AB 7–AB 0 valid time before RD AB 15–AB 8 valid time after RD AB 7–AB 0 valid time after RD RDY setup time before WR RDY hold time after WR RDY setup time before RD RDY hold time after RD Data bus setup time before RD Data bus hold time after RD Data bus delay time before WR Data bus valid time after WR (Note 1) EDMA delay time after WR EDMA valid time after RD USB output rise time, C L = 50 pF USB output fall time, CL = 50 pF tC (φ) tWH (φ) tWL (φ) td(φ -AH) tv(φ -AH) td(φ -AL) tv(φ -AL) td(φ -WR) tv(φ -WR) td(φ -RD) tv(φ -RD) td(φ -SYNC) tv(φ -SYNC) td(φ -DMA) tv(φ -DMA) tsu(RDY- φ) th(φ -RDY) tsu(HOLD- φ) th(φ -HOLD) td(φ -HLDAL) td(φ -HLDAH) tsu(DB- φ) th(φ -DB) td(φ -DB) tV(φ -DB) td(φ -EDMA) tv(φ -EDMA) tWL (WR) (Note 2) tWL (RD) (Note 2) td(AH-WR) td(AL-WR) tv(WR-AH) tv(WR-AL) td(AH-RD) td(AL-RD) tv(RD-AH) tv(RD-AL) tsu(RDY-WR) th(WR-RDY) tsu(RDY-RD) th(RD-RDY) tsu(DB-RD) th(RD-DB) td(WR-DB) tv(WR-DB) tv(WR-EDMA) tv(RD-EDMA) tr(D+), tr(D-) tf(D+), tf(D-) Limits µs ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns Parameter Min. 166.66 0.5•tc(φ) – 5 0.5•tc(φ) – 5 0.5•tc(φ) – 6 0.5•tc(φ) – 6 0.5•tc(φ) – 33 0.5•tc(φ) – 35 0.5•tc(φ) – 33 0.5•tc(φ) – 35 T yp. Max.Symbol Unit Table 24 Timing requirements and switching characteristics in memory expansion and microprocessor modes (Vcc = 3.0 to 3.6 V, Vss = 0 V, Ta = –20 to 70°C, unless otherwise noted) In Vcc = 3 V
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 79 Circuit for measuring output switching characteristics (1) Notes 1: Test conditions: IOHL = ± 5mA, CL = 50 pF 2: twL (RD) = ((n + 0.5) • tc(PHI)) – 5 ns (n = wait number) twL (WR) = ((n + 0.5) • tc(PHI)) – 5 ns (n = wait number) For example, two software waits, PHI = 12 MHz operating t wL (RD) = 2.5 • tc(PHI) – 5 ns = 203.33 ns Measurement output pin 100 pF CMOS output N -channel open-drain output (N ote) 1 kΩ 0 0 p F M easurement output pin N ote: This diagram applies when bit 7 of the serial I/O control register 1 is “1”. Fig. 80 Circuit for measuring output switching characteristics (2)
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. 0.2VCC tWL(INT) 0.8VCC tWH(INT) 0.5VCC 0.2VCC tWL(X IN) 0.8VCC tWH(X IN) tC(XIN) XIN 0.2VCC 0.8VCC tW(RESET) RESET td(φ – TOUT ) TOUT INT0, INT1 0.2VCC tWL(CNTR I) 0.8VCC tWH(CNTR I) tC(CNTR I) CNTR 0, CNTR1 0.2VCC tWL(X CIN) 0.8VCC tWH(X CIN) tC(XCIN) XCIN td(φ – CNTR 0,1) 0.2VCC tWL(CNTR E0,1) 0.8VCC tWH(CNTR E0,1) tC(CNTR E0,1) CNTR 0, CNTR1 CNTR 0, CNTR1 0.5VCC 0.5VCC tC(INT) G Timing diagram [Interrupt] [Input] [Timer] φ Fig. 81 Timing diagram (1)
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. 0.2VCC 0.2VCC 0.8VCC 0.8VCC td(SCLK E, I – STXD) tC(SCLK E,I) tWL(SCLK E, I) tWH(SCLK E,I) th(SCLKE, I – SRXD)tsu(SRXD – SCLK E, I) STXD SRXD SCLK SRDY tv(SCLKE – SRDY) 0.5VCC 0.8VCC G Timing diagram [Serial I/O] Fig. 82 Timing diagram (2) tf(D +) tf(D -) tr(D +) tr(D -) USBD+, USBD- 0.1VOH 0.9VOH Fig. 83 Timing diagram (3)
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. 0 . 8 VC C VC CDQ 0 to DQ7 R S0, S1 tsu(A-R) 0.8VCC (2.0V) 0.2VCC (0.8V) th(R-A) 0 . 2 VC C ( 0 . 8 V ) th R S )tsu(S-R) 0.8VCC (2.0V) 0.2VCC (0.8V) tw R 0.8VCC 0.2VCC ta(R-D) tv R D O B F 0.2VCC tv(R-OBF) 0.8VCC 0.2VCCD Q 0 t o D Q 7 W S0, S1 ts u A W 0.8VCC (2.0V) 0.2VCC (0.8V) th(W-A) 0.2VCC (0.8V) th W S )tsu(S-W) 0.8VCC (2.0V) 0.2VCC (0.8V) tw W 0.8VCC 0.2VCC th(W-D) I B F 0 . 2 VC C td(W-IBF) tsu(D-W) G T i m i n g d i a g r a m [ M a s t e r C P U b u s i n t e r f a c e : R / W s e p a r a t e m o d e ] R e a d < W r i t e > N o t e: T h i s t i m i n g a p p l i e s i n t h e c a s e o f t h e m a s t e r b u s i n p u t l e v e l s e l e c t b i t P T C T T L l e v e l i n p u t Fig. 84 Timing diagram (4)
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. tsu(A-E) S0, S1 R W 0 . 8 VC C ( 2 . 0 V ) VC C ( V th E A 0 . 2 VC C ( 0 . 8 V ) th E S tsu(S-E) OBF, IBF 0 . 2 VC C tv(E-OBF) td(E-IBF) E 0.2VCC (0.8V) 0 . 8 VC C ( 2 . 0 V ) VC C ( V tw E E ) tw E 0.8VCC 0.2VCCDQ 0 to DQ7 0.8VCC 0.2VCC ta(E-D) tv(E-D) 0 . 8 VC C VC CD Q 0 t o D Q 7 0.8VCC 0.2VCC th E D tsu(D-E) G T i m i n g d i a g r a m [ M a s t e r C P U b u s i n t e r f a c e : R / W m o d e ] < W r i t e > Note: This timing applies in the case of the master bus input level select bit (PTC7) = “1” (TTL level input) < R e a d > Fig. 85 Timing diagram (5)
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. tWL( φ) 0.5VCC tWH( φ) tC(φ) td(φ-AH) td(φ-AL) td(φ-SYNC) tv(φ-AH) tv(φ-AL) tv(φ-SYNC) td(φ-WR) td(φ-RD) tv(φ-WR) tv(φ-RD) 0.5VCC 0.5VCC 0.5VCC AB 15 to AB8 AB 7 to AB0 SYNC OUT RD,WR DMA OUT 0.8VCC 0.2VCC th(φ-DB) 0.5VCC td(φ-DB) tv(φ-DB) DB 0 to DB7 DB 0 to DB7 0.5VCC tv(φ-DMA) 0.5VCC td(φ-DMA) RDY 0.8VCC 0.2VCC tsu(RDY-φ) th(φ-RDY) HOLD (at entering) 0.8VCC 0.2VCC tsu(HOLD-φ) th(φ-HOLD) HLDA td(φ-HLDAL) HOLD (at releasing) 0.8VCC 0.2VCC tsu(HOLD-φ) th(φ-HOLD) HLDA td(φ-HLDAH) 0.5VCC 0.5VCC tsu(DB-φ) <CPU write> EDMA 0.5VCC tv(φ-EDMA) 0.5VCC td(φ-EDMA) <CPU read> φ n cycles of φ Fig. 86 Timing diagram (6); Memory expansion and microprocessor modes
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS Y Notice: This is not a final specification. Some parametric limits are subject to change. 0.5VCCRD,WR 0.5VCCAB 15 to AB8 td(AH-WR) tv(WR-AH) 0.5VCCAB 7 to AB0 td(AL-WR) tv(WR-AL) 0.8VCC 0.2VCCDB 0 to DB7 tSU(DB-RD) th(RD-DB) 0.5VCCDB 0 to DB7 td(WR-DB) tv(WR-DB) RDY tv(RD-AH)td(AH-RD) td(AL-RD) tv(RD-AL) tWL(RD) tWL(WR) 0.8VCC 0.2VCC tsu(RDY-WR) tsu(RDY-RD) th(WR-RDY) th(RD-RDY) <CPU read> EDMA 0.5VCC tv(WR-EDMA) tv(RD-EDMA) <CPUwrite> Fig. 87 Timing diagram (7); Memory expansion and microprocessor modes
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Table 25 Summary of M37641F8 (flash memory version) FLASH MEMORY MODE The M37641F8FP/HP (flash memory version) has an internal new DINOR (DIvided bit line NOR) flash memory that can be rewritten with a single power source when V CC is 5 V, and 2 power sources when VPP is 5 V and VCC is 3.3 V in the CPU rewrite and standard serial I/O modes. For this flash memory, three flash memory modes are available in which to read, program, and erase: the parallel I/O and standard serial I/O modes in which the flash memory can be manipulated using a programmer and the CPU rewrite mode in which the flash memory can be manipulated by the Central Processing Unit (CPU). Summary Table 25 lists the summary of the M37641F8 (flash memory ver- sion). This flash memory version has some blocks on the flash memory as shown in Figure 88 and each block can be erased. The flash memory is divided into User ROM area and Boot ROM area. In addition to the ordinary User ROM area to store the MCU op- eration control program, the flash memory has a Boot ROM area that is used to store a program to control rewriting in CPU rewrite and standard serial I/O modes. This Boot ROM area has had a standard serial I/O mode control program stored in it when shipped from the factory. However, the user can write a rewrite control program in this area that suits the user’s application sys- tem. This Boot ROM area can be rewritten in only parallel I/O mode. Item Power source voltage Program/Erase V PP voltage Flash memory mode Erase block division User ROM area Boot ROM area Program method Erase method Program/Erase control method Number of commands Number of program/Erase times ROM code protection Specifications IN) = 24 MHz, φ = 6 MHz) VPP = 4.50 – 5.25 V (f(XIN) = 24 MHz, φ = 6 MHz) 3 modes; Flash memory can be manipulated as follows:
- Parallel I/O mode: Manipulated using an external programmer
- Standard serial I/O mode: Manipulated using an external programmer
- CPU rewrite mode: Manipulated by the Central Processing Unit (CPU). See Figure 88. 1 block (4 Kbytes) (Note) Byte program Batch erasing/Block erasing Program/Erase control by software command 6 commands 100 times Available in parallel I/O mode and standard serial I/O mode Note: The Boot ROM area has had a standard serial I/O mode control program stored in it when shipped from the factory. This Boot ROM area can be rewrit- ten in only parallel I/O mode.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 88 Block diagram of built-in flash memory (1) CPU Rewrite Mode In CPU rewrite mode, the internal flash memory can be operated on (read, program, or erase) under control of the Central Process- ing Unit (CPU). In CPU rewrite mode, only the User ROM area shown in Figure 88 can be rewritten; the Boot ROM area cannot be rewritten. Make sure the program and block erase commands are issued for only the User ROM area and each block area. The control program for CPU rewrite mode can be stored in either User ROM or Boot ROM area. In the CPU rewrite mode, because the flash memory cannot be read from the CPU, the rewrite con- trol program must be transferred to internal RAM area to be executed before it can be executed. Microcomputer Mode and Boot Mode The control program for CPU rewrite mode must be written into the User ROM or Boot ROM area in parallel I/O mode beforehand. (If the control program is written into the Boot ROM area, the stan- dard serial I/O mode becomes unusable.) See Figure 88 for details about the Boot ROM area. Normal microcomputer mode is entered when the microcomputer is reset with pulling CNV SS pin low. In this case, the CPU starts operating using the control program in the User ROM area. When the microcomputer is reset by pulling the P8 1 pin high, the CNV SS pin high, the CPU starts operating using the control pro- gram in the Boot ROM area. This mode is called the “Boot” mode. Block Address Block addresses refer to the maximum address of each block. These addresses are used in the block erase command. U s e r R O M a r e a Kb y t e sF F F Boot ROM area N o t e s T h e B o o t R O M a r e a c a n b e r e w r i t t e n i n o n l y p a r a l l e l I O m o d e A c c e s s t o a n y o t h e r a r e a s i s i n h i b i t e d T o s p e c i f y a b l o c k u s e t h e m a x i m u m a d d r e s s i n t h e b l o c k P a r a l l e l I O m o d e C P U r e w r i t e m o d e s t a n d a r d s e r i a l I O m o d e BSEL = 0 BSEL = 1 User area / Boot area select bit = “0” User area / Boot area select bit = “1”
6 Block 1 : 8 Kbytes
Block 2 : 16 Kbytes Block 0 : 8 Kbytes 800016 F00016 FFFF 16 User ROM area Kb y t e sF F F B o o t R O M a r e a Block 2 : 16 Kbytes Block 0 : 8 Kbytes F00016 FFFF 16
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Outline Performance (CPU Rewrite Mode) CPU rewrite mode is usable in the single-chip, memory expansion or Boot mode. The only User ROM area can be rewritten in CPU rewrite mode. In CPU rewrite mode, the CPU erases, programs and reads the in- ternal flash memory as instructed by software commands. This rewrite control program must be transferred to a memory such as the internal RAM before it can be executed. The MCU enters CPU rewrite mode by applying 4.50 V to 5.25 V to the CNV SS pin and setting “1” to the CPU Rewrite Mode Select Bit (bit 1 of address 006A16). Software commands are accepted once the mode is entered. Use software commands to control program and erase operations. Whether a program or erase operation has terminated normally or in error can be verified by reading the status register. Figure 89 shows the flash memory control register. Bit 0 is the RY/BY status flag used exclusively to read the operat- ing status of the flash memory. During programming and erase operations, it is “0” (busy). Otherwise, it is “1” (ready). This is equivalent to the RY/BY pin function in parallel I/O mode. Bit 1 is the CPU Rewrite Mode Select Bit. When this bit is set to “1”, the MCU enters CPU rewrite mode. Software commands are F l a s h m e m o r y c o n t r o l r e g i s t e r a d d r e s s F M C R R Y B Y s t a t u s f l a g B u s y b e i n g w r i t t e n o r e r a s e d R e a d y C P U r e w r i t e m o d e s e l e c t b i t o t e N o r m a l m o d e S o f t w a r e c o m m a n d s i n v a l i d C P U r e w r i t e m o d e S o f t w a r e c o m m a n d s a c c e p t a b l e C P U r e w r i t e m o d e e n t r y f l a g N o r m a l m o d e S o f t w a r e c o m m a n d s i n v a l i d C P U r e w r i t e m o d e F l a s h m e m o r y r e s e t b i t N o t e N o r m a l o p e r a t i o n R e s e t U s e r a r e a B o o t a r e a s e l e c t b i t U s e r R O M a r e a a c c e s s e d B o o t R O M a r e a a c c e s s e d R e s e r v e d b i t s I n d e f i n i t e a t r e a d a t w r i t e b0b7 Notes 1: The contents of flash memory control register are “XXX00001 ” just after reset release. 2: For this bit to be set to “1”, the user needs to write “0” and then “1” to it in succession. If it is not this procedure, this bit will not be set to ”1”. Additionally, it is required to ensure that no interrupt will be generated during that interval. Use the control program in the area except the built-in flash memory for write to this bit. 3: This bit is valid when the CPU rewrite mode select bit is “1”. Set this bit 3 to “0” subsequently after setting bit 3 to “1”. 4: Use the control program in the area except the built-in flash memory for write to this bit. accepted once the mode is entered. In CPU rewrite mode, the CPU becomes unable to access the internal flash memory directly. Therefore, use the control program in a memory other than inter- nal flash memory for write to bit 1. To set this bit to “1”, it is necessary to write “0” and then write “1” in succession. The bit can be set to “0” by only writing “0”. Bit 2 is the CPU Rewrite Mode Entry Flag. This flag indicates “1” in CPU rewrite mode, so that reading this flag can check whether CPU rewrite mode has been entered or not. Bit 3 is the flash memory reset bit used to reset the control circuit of internal flash memory. This bit is used when exiting CPU rewrite mode and when flash memory access has failed. When the CPU Rewrite Mode Select Bit is “1”, setting “1” for this bit resets the control circuit. To set this bit to “1”, it is necessary to write “0” and then write “1” in succession. To release the reset, it is necessary to set this bit to “0”. Bit 4 is the User Area/Boot Area Select Bit. When this bit is set to “1”, Boot ROM area is accessed, and CPU rewrite mode in Boot ROM area is available. In Boot mode, this bit is set to “1” auto- matically. Reprogramming of this bit must be in a memory other than internal flash memory. Figure 90 shows a flowchart for setting/releasing CPU rewrite mode. Fig. 89 Structure of flash memory control register
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 90 CPU rewrite mode set/release flowchart End S t a r t E x e c u t e r e a d a r r a y c o m m a n d o r r e s e t f l a s h m e m o r y b y s e t t i n g f l a s h m e m o r y r e s e t b i t b y w r i t i n g a n d t h e n i n s u c c e s s i o n N o t e Single-chip mode, Memory expansion mode or Boot mode S e t C P U m o d e r e g i s t e r s A B N o t e U s i n g s o f t w a r e c o m m a n d e x e c u t e e r a s e p r o g r a m o r o t h e r o p e r a t i o n J u m p t o c o n t r o l p r o g r a m t r a n s f e r r e d i n m e m o r y o t h e r t h a n i n t e r n a l f l a s h m e m o r y S u b s e q u e n t o p e r a t i o n s a r e e x e c u t e d b y c o n t r o l p r o g r a m i n t h i s m e m o r y T r a n s f e r C P U r e w r i t e m o d e c o n t r o l p r o g r a m t o m e m o r y o t h e r t h a n i n t e r n a l f l a s h m e m o r y Notes 1: When starting the MCU in the single-chip mode or memory expansion mode, supply 4.5 V to 5.25 V to the CNVss pin until checking the CPU rewrite mode entry flag. 2: Set the main clock as follows depending on the XIN divider select bit of clock control register (bit 7 of address 001F16): When X IN divider select bit = “0” (φ = f(XIN)/4), the main clock is 24 MHz or less When X IN divider select bit = “1” (φ = f(XIN)/2), the main clock is 12 MHz or less. 3: Before exiting the CPU rewrite mode after completing erase or program operation, always be sure to execute the read array command or reset the flash memory. W r i t e t o C P U r e w r i t e m o d e s e l e c t b i t Set CPU rewrite mode select bit to “1” (by writing “0” and then “1” in succession) Check CPU rewrite mode entry flag
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Notes on CPU Rewrite Mode The below notes applies when rewriting the flash memory in CPU rewrite mode. G Operation speed During CPU rewrite mode, set the internal clock φ to 6 MHz or less using the XIN Divider Select Bit (bit 7 of address 001F16). G Instructions inhibited against use The instructions which refer to the internal data of the flash memory cannot be used during CPU rewrite mode . G Interrupts inhibited against use The interrupts cannot be used during CPU rewrite mode because they refer to the internal data of the flash memory. G Reset Reset is always valid. If reset is performed on erasing, 5 ms is needed until the flash memory will return to its normal state. Ac- cordingly, wait at least 5 ms before releasing reset.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Software Commands Table 26 lists the software commands. After setting the CPU Rewrite Mode Select Bit to “1”, write a soft- ware command to specify an erase or program operation. Each software command is explained below. G Read Array Command (FF 16) The read array mode is entered by writing the command code “FF 16” in the first bus cycle. When an address to be read is input in one of the bus cycles that follow, the contents of the specified ad- dress are read out at the data bus (DB 0 to DB7). The read array mode is retained intact until another command is written. G Read Status Register Command (7016) When the command code “7016” is written in the first bus cycle, the contents of the status register are read out at the data bus (DB0 to DB7) by a read in the second bus cycle. The status register is explained in the next section. G Clear Status Register Command (5016) This command is used to clear the bits SR4 and SR5 of the status register after they have been set. These bits indicate that opera- tion has ended in an error. To use this command, write the command code “50 16” in the first bus cycle. G Program Command (40 16) Program operation starts when the command code “4016” is writ- ten in the first bus cycle. Then, if the address and data to program are written in the 2nd bus cycle, program operation (data program- ming and verification) will start. Whether the write operation is completed can be confirmed by reading the status register or the RY/BY Status Flag. When the program starts, the read status register mode is entered automati- cally and the contents of the status register is read at the data bus (DB 0 to DB7). The status register bit 7 (SR7) is set to “0” at the Table 26 List of software commands (CPU rewrite mode) same time the write operation starts and is returned to “1” upon completion of the write operation. In this case, the read status reg- ister mode remains active until the next command is written. ____ The RY/BY Status Flag is “0” during write operation and “1” when the write operation is completed as is the status register bit 7. At program end, program results can be checked by reading the status register. Fig. 91 Program flowchart Command P r o g r a m C l e a r s t a t u s r e g i s t e r R e a d a r r a y R e a d s t a t u s r e g i s t e r X X F i r s t b u s c y c l e Second bus cycle F F1 7 01 5 01 4 01 Write Write Write Write XS R DRead W r i t e E r a s e a l l b l o c k s2 01 6Write X 20 16W r i t e (Note 1) WA (Note 2) WD (Note 2) Block erase 2 01 6Write D0 16W r i t eB A (Note 3) Mode Address Mode A d d r e s s Data ( D B0 t o D B7)( D B0 t o D B7) (Note 4) N o t e s 1 : SRD = Status Register Data 2: WA = Write Address, WD = Write Data 3: BA = Block Address to be erased (Input the maximum address of each block.) 4: X denotes a given address in the User ROM area . C y c l e n u m b e r X X X X Data S t a r t W r i t e S t a t u s r e g i s t e r r e a d Program completed NO Y E S W r i t e a d d r e s s W r i t e d a t a SR4 = 0 ? Program error NO YES SR7 = 1 ? or RY/BY = 1 ? W r i t e
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. G Erase All Blocks Command (2016/2016) By writing the command code “2016” in the first bus cycle and the confirmation command code “2016” in the second bus cycle that follows, the operation of erase all blocks (erase and erase verify) starts. Whether the erase all blocks command is terminated can be con- ____ firmed by reading the status register or the RY/BY Status Flag of flash memory control register. When the erase all blocks operation starts, the read status register mode is entered automatically and the contents of the status register can be read out at the data bus (DB 0 to DB7). The status register bit 7 (SR7) is set to “0” at the same time the erase operation starts and is returned to “1” upon completion of the erase operation. In this case, the read status register mode remains active until another command is written. ____ The RY/BY Status Flag is “0” during erase operation and “1” when the erase operation is completed as is the status register bit 7. After the erase all blocks end, erase results can be checked by reading the status register. For details, refer to the section where the status register is detailed. G Block Erase Command (20 16/D016) By writing the command code “2016” in the first bus cycle and the confirmation command code “D0 16” and the blobk address in the second bus cycle that follows, the block erase (erase and erase verify) operation starts for the block address of the flash memory to be specified. Whether the block erase operation is completed can be confirmed ____ by reading the status register or the RY/BY Status Flag of flash memory control register. At the same time the block erase opera- tion starts, the read status register mode is automatically entered, so that the contents of the status register can be read out. The status register bit 7 (SR7) is set to “0” at the same time the block erase operation starts and is returned to “1” upon completion of the block erase operation. In this case, the read status register mode remains active until the read array command (FF 16) is writ- ten. ____ The RY/BY Status Flag is “0” during block erase operation and “1” when the block erase operation is completed as is the status reg- ister bit 7. After the block erase ends, erase results can be checked by read- ing the status register. For details, refer to the section where the status register is detailed. W r i t e 2 01 2 01 6/ D 01 B l o c k a d d r e s s E r a s e c o m p l e t e d N O Y E S Start Write SR5 = 0 ? E r a s e e r r o r YES N O 2 01 6: E r a s e a l l b l o c k s D B l o c k e r a s e SR 7 = 1 ? or RY/BY = 1 ? S t a t u s r e g i s t e r r e a d Fig. 92 Erase flowchart
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Table 27 Definition of each bit in status register Status Register The status register shows the operating status of the flash memory and whether erase operations and programs ended suc- cessfully or in error. It can be read in the following ways: (1) By reading an arbitrary address from the User ROM area after writing the read status register command (70 16) (2) By reading an arbitrary address from the User ROM area in the period from when the program starts or erase operation starts to when the read array command (FF 16) is input. Also, the status register can be cleared by writing the clear status register command (5016). After reset, the status register is set to “8016”. Table 27 shows the status register. Each bit in this register is ex- plained below.
- Sequencer status (SR7) The sequencer status indicates the operating status of the flash memory. This bit is set to “0” (busy) during write or erase operation and is set to “1” when these operations ends. After power-on, the sequencer status is set to “1” (ready).
- Erase status (SR5) The erase status indicates the operating status of erase operation. If an erase error occurs, it is set to “1”. When the erase status is cleared, it is set to “0”.
- Program status (SR4) The program status indicates the operating status of write opera- tion. When a write error occurs, it is set to “1”. The program status is set to “0” when it is cleared. If “1” is written for any of the SR5 and SR4 bits, the program, erase all blocks, and block erase commands are not accepted. Before executing these commands, execute the clear status regis- ter command (50 16) and clear the status register. Also, if any commands are not correct, both SR5 and SR4 are set to “1”. Each bit of SRD0 bits SR7 (bit7) SR6 (bit6) SR5 (bit5) SR4 (bit4) SR3 (bit3) SR2 (bit2) SR1 (bit1) SR0 (bit0) Definition “1” “0” Sequencer status Reserved Erase status Program status Reserved Reserved Reserved Reserved Ready Terminated in error Terminated in error Status name Busy Terminated normally Terminated normally
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Full Status Check By performing full status check, it is possible to know the execu- tion results of erase and program operations. Figure 93 shows a Fig. 93 Full status check flowchart and remedial procedure for errors full status check flowchart and the action to be taken when each error occurs. R e a d s t a t u s r e g i s t e r S R 4 = 1 a n d S N O Y E S S R 5 = 0 ? Y E S Er a s e e r r o rN O S R 4 = 0 ? YES N O C o m m a n d s e q u e n c e e r r o r Program error E n d ( b l o c k e r a s e , p r o g r a m ) Execute the clear status register command (5016) to clear the status register. Try performing the operation one more time after confirming that the command is entered correctly. Should an erase error occur, the block in error cannot be used. N o t W h e n o n e o f S R a n d S R i s s e t t o n o n e o f t h e p r o g r a m e r a s e a l l b l o c k s a n d b l o c k e r a s e c o m m a n d s i s a c c e p t e d E x e c u t e t h e c l e a r s t a t u s r e g i s t e r c o m m a n d b e f o r e e x e c u t i n g t h e s e c o m m a n d s Should a program error occur, the block in error cannot be used.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Functions To Inhibit Rewriting Flash Memory Version To prevent the contents of internal flash memory from being read out or rewritten easily, this MCU incorporates a ROM code protect function for use in parallel I/O mode and an ID code check func- tion for use in standard serial I/O mode. G ROM Code Protect Function The ROM code protect function is the function to inhibit reading out or modifying the contents of internal flash memory by using the ROM code protect control register (address FFC9 16) in paral- lel I/O mode. Figure 94 shows the ROM code protect control register (address FFC916). (This address exists in the User ROM area.) If one or both of the pair of ROM Code Protect Bits is set to “0”, the ROM code protect is turned on, so that the contents of internal flash memory are protected against readout and modification. The ROM code protect is implemented in two levels. If level 2 is se- lected, the flash memory is protected even against readout by a shipment inspection LSI tester, etc. When an attempt is made to select both level 1 and level 2, level 2 is selected by default. If both of the two ROM Code Protect Reset Bits are set to “00”, the ROM code protect is turned off, so that the contents of internal flash memory can be read out or modified. Once the ROM code protect is turned on, the contents of the ROM Code Protect Reset Bits cannot be modified in parallel I/O mode. Use the serial I/O or CPU rewrite mode to rewrite the contents of the ROM Code Pro- tect Reset Bits. Fig. 94 Structure of ROM code protect control register R O M c o d e p r o t e c t c o n t r o l r e g i s t e r a d d r e s s F F C o t e R O M C P Reserved bits (“1” at read/write) ROM code protect level 2 set bits (ROMCP2) (Notes 2, 3) b3b2 0 0: Protect enabled 0 1: Protect enabled 1 0: Protect enabled 1 1: Protect disabled ROM code protect reset bits (Note 4) b5b4 0 0: Protect removed 0 1: Protect set bits effective 1 0: Protect set bits effective 1 1: Protect set bits effective ROM code protect level 1 set bits (ROMCP1) (Note 2) b7b6 0 0: Protect enabled 0 1: Protect enabled 1 0: Protect enabled 1 1: Protect disabled b Notes 1: This area is on the ROM in the mask ROM version. 2: When ROM code protect is turned on, the internal flash memory is protected against readout or modification in parallel I/O mode. 3: When ROM code protect level 2 is turned on, ROM code readout by a shipment inspection LSI tester, etc. also is inhibited. 4: The ROM code protect reset bits can be used to turn off ROM code protect level 1 and ROM code protect level 2. However, since these bits cannot be modified in parallel I/O mode, they need to be rewritten in standard serial I/O mode or CPU rewrite mode.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. ID Code Check Function Use this function in standard serial I/O mode. When the contents of the flash memory are not blank, the ID code sent from the pro- grammer is compared with the ID code written in the flash memory to see if they match. If the ID codes do not match, the commands sent from the programmer are not accepted. The ID code consists of 8-bit data, and its areas are FFC2 16 to FFC816. Write a program which has had the ID code preset at these addresses to the flash memory. Fig. 95 ID code store addresses ROM code protect control ID7 ID6 ID5 ID4 ID3 ID2 ID1 FFC9 16 FFC8 16 FFC7 16 FFC6 16 FFC5 16 FFC4 16 FFC3 16 FFC2 16 Address Interrupt vector area
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. (2) Parallel I/O Mode The parallel I/O mode is entered by making connections shown in Figures 96 and 97 and then turning the Vcc power supply (5 V) on. Pin name S i g n a l n a m eI O F u n c t i o n VC C , VS S P o w e r s u p p l y i n p u t Apply 4.50 V – 5.25 V to the Vcc pin and 0 V to the Vss pin. C N VS S C N VS S Connect this pin to Vcc. R e s e t i n p u tI n p u t “L” level.IR E S E T XI N C l o c k i n p u t Connect a ceramic or crystal resonator between the XIN and XOUT pins. When inputting an externally derived clock, input it from XIN and leave XOUT open.XO U T C l o c k o u t p u t A VC C , A VS S A n a l o g p o w e r s u p p l y i n p u t LPF LPF O Apply 4.50 V – 5.25 V to the AVcc pin and 0 V to the AVss pin. Leave this pin open. E x t . C a p A d d r e s s i n p u t These are address AB 0–AB 7 input pins.I 3 . 3 V l i n e p o w e r s u p p l y i n p u t I P 20 t o P 27 P 30 B S E L i n p u t This is a BSEL input pin. P 33 P34 R P i n p u t This is a RP input pin. W E i n p u t This is a WE input pin. P40 to P44 C E i n p u t OE input This is a OE input pin. This is a CE input pin. ORY/BY output This is a RY/BY output pin.P31 P 32 P 00 t o P 07 D a t a I / O These are data DB 0–DB 7 input/output pins.I/O U S B D + Input “H ” level. U S B D + Input “H ” level. U S B D -U S B D - Input “L” level. A d d r e s s i n p u t These are address AB 8–AB 15 input pins.IP 10 t o P 17 I n p u t p o r t P 30 II n p u t “L” level. I n p u t p o r t P 34 Input “L” level. P 35 P 36 P37 Input port P4 Input “L” level. P t o P 57 I n p u t p o r t P 5I n p u t “L” level. P60 to P67 Input port P6 Input “L” level. P t o P 74 I n p u t p o r t P 7I n p u t “L” level. P t o P 87 I n p u t p o r t P 8I n p u t “L” level. I I I I I I I I I I I I I Table 28 Description of pin function (Flash Memory Parallel I/O Mode)
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. P74/OBF1 P 61/ D Q 1 P 56/ R ( E ) P 55/ A0 P 53/ I B F0 P 52/ O B F0 C N VS S R E S E T A VC C A VS S P 44/ C N T R 1 P87/RTS1 P86/CTS1 VC C P 50/ XC I N VS S XI N XO U T P 51/ TO U T/ XC O U T L P F P85/URXD 1 P84/UTXD 1 P32{RP} P31{RY/BY} M 3 7 6 4 1 F 8 F P P 60/ D Q 0 P 54/ S0 P 43/ C N T R 0 P 42/ I N T1 P 41/ I N T0 P 40/ E D M A P83/RTS2/STXD P82/CTS2/SRXD P81/URXD 2/SCLK P80/UTXD 2/SRDY P37/RD{OE} P36/WR{CE} P35/SYNC OUT {BSEL} P34/φOUT P33/DMA OUT {WE} P30/RDY P 17/ A B1 5{ A B1 P 16/ A B1 4{ A B1 P 15/ A B1 3{ A B1 P 14/ A B1 2{ A B1 P 13/ A B1 1{ A B1 P 12/ A B1 0{ A B1 P 11/ A B9{ A B9} P 10/ A B8{ A B8} P 07/ A B7{ A B7} P 06/ A B6{ A B6} P 05/ A B5{ A B5} P 04/ A B4{ A B4} P 03/ A B3{ A B3} P 02/ A B2{ A B2} P 01/ A B1{ A B1} P 00/ A B0{ A B0} P 27/ D B7{ D B7} P 26/ D B6{ D B6} P 25/ D B5{ D B5} P 24/ D B4{ D B4} P 23/ D B3{ D B3} P 22/ D B2{ D B2} P 21/ D B1{ D B1} P 20/ D B0{ D B0} P73/IBF1/HLDA P 72/ S1 P71/HOLD P 70/ S O F USB D+ USB D- Ext.Cap VS S VC C P67/DQ7 P66/DQ6 P 65/ D Q 5 P 64/ D Q 4 P 63/ D Q 3 P62/DQ2 O E CE B S E L WE RP RY/BY D B0 D B1 D B3 D B2 D B5 D B7 D B6 D B4 A B1 A B0 A B3 A B2 A B5 A B4 A B7 A B6 A B9 A B8 A B1 A B1 A B1 A B1 A B1 A B1 C N VS S S C L K R E S E T VC C VS S VS S VCC VSS Mode setup method Signal Value Connect to oscillator circuit. P a c k a g e o u t l i n e : 8 0 P 6 N - A Fig. 96 Pin connection diagram in parallel I/O mode (1)
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. P74/OBF1 404 P61/DQ1 P 56/ R ( E ) P 55/ A0 P 53/ I B F0 P 52/ O B F0 C N VS S R E S E T A VC C A VS S P 44/ C N T R 1 P87/RTS1 P86/CTS1 VC C P 50/ XC I N VS S XI N XO U T P 51/ TO U T/ XC O U T L P F P85/URXD 1 P84/UTXD 1 P32{RP} P31{RY/BY} M37641F8HP P60/DQ0 P 54/ S0 P 43/ C N T R 0 P 42/ I N T1 P41/INT0 P83/RTS2/STXD P82/CTS2/SRXD P81/URXD 2/SCLK P80/UTXD 2/SRDY P37/RD{OE} P36/WR{CE} P35/SYNC OUT {BSEL} P34/φOUT P33/DMA OUT {WE} P30/RDY P17/AB15{AD15} P16/AB14{AD14}P21/DB1 P20/DB0 USB D+ USB D- Ext.Cap VSS VCC P67/DQ7 P66/DQ6 P65/DQ5 P64/DQ4 P63/DQ3 P62/DQ2 P40/EDMA P71/HOLD P70/SOF P72/S1 P73/IBF1/HLDA OE CE BSEL WE RP RY/BY VC C VS S AB 15 AB 14 P 15/ A B1 3{ A B1 P 14/ A B1 2{ A B1 P 13/ A B1 1{ A B1 P 12/ A B1 0{ A B1 P 11/ A B9{ A B9} P 10/ A B8{ A B8} P 07/ A B7{ A B7} P 06/ A B6{ A B6} P 05/ A B5{ A B5} P 04/ A B4{ A B4} P 03/ A B3{ A B3} P 02/ A B2{ A B2} P 01/ A B1{ A B1} P 00/ A B0{ A B0} P 27/ D B7{ D B7} P 26/ D B6{ D B6} P 25/ D B5{ D B5} P 24/ D B4{ D B4} P 23/ D B3{ D B3} P 22/ D B2{ D B2} D B3 D B2 D B5 D B7 D B6 D B4 A B1 A B0 A B3 A B2 A B5 A B4 A B7 A B6 A B9 A B8 A B1 A B1 A B1 A B1 DB 0 DB 1 CNV SS SCLK RESET VCC VSS VSS Mode setup method Signal Value Connect to oscillator circuit. Package outline: 80P6Q-A Fig. 97 Pin connection diagram in parallel I/O mode (2)
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. DB 0 to DB7 Data output Status register data output High impedance High impedance Command/data input Command input Command input High impedance RP VIH VIH VIH VIH VIH VIH VIH VIL WE VIH VIH VIH X VIL VIL VIL X OE VIL VIL VIH X VIH VIH VIH X CE VIL VIL VIL VIH VIL VIL VIL X Pin nameMode Array Status register Output disabled Stand by Program Write Erase all blocks Block erase Deep power down Read Note: X can be VIL or VIH. Table 29 Relationship between control signals and bus operation modes Address The User ROM has some blocks as shown in Figure 98. The block address is the maximum address value of each block. User ROM and Boot ROM Areas In parallel I/O mode, the User ROM and Boot ROM areas shown in Figure 98 can be rewritten. The BSEL pin is used to choose be- tween these two areas. The User ROM area is selected by pulling the BSEL input low; the Boot ROM area is selected by driving the BSEL input high. Both areas of flash memory can be operated on in the same way. Program and block erase operations can be performed only in the User ROM area. The User ROM area is 32 Kbytes in size. In parallel I/O mode, it is located at addresses 8000 16 through FFFF16. The Boot ROM area is 4 Kbytes in size. In parallel I/O mode, it is located at addresses F000 16 through FFFF16. Make sure program and block erase op- erations are always performed within this address range. (Access to any location outside this address range is prohibited.) In the Boot ROM area, an erase block operation is applied to only one 4 Kbyte block. The boot ROM area has had a standard serial I/O mode control program stored in it when shipped from the Mitsubishi factory. Therefore, using the MCU in standard serial I/O mode, do not rewrite to the Boot ROM area. Outline Performance (Parallel I/O Mode) In parallel I/O mode, bus operation modes— Read, Output Dis- able, Standby, Write, and Deep Power Down— are selected by the state of the CE, OE, WE, and RP input pins. The contents of erase, program, and other operations are selected by writing a software command. The data, status register, etc. in a memory can only be read out by a read after software command input. Program and erase operations are controlled using software com- mands. The following explains about bus operation modes, software com- mands, and status register. E00016 User ROM area
4 KbyteFFFF 16
Notes 1: The Boot ROM area can be rewritten in only parallel input/output mode. (Access to any other areas is inhibited.) 2: To specify a block, use the maximum address in the block. Parallel I/O mode BSEL = 0 BSEL = 1 C000 16 Block 1 : 8 Kbytes Block 2 : 16 Kbytes Block 0 : 8 Kbytes 800016 F00016 FFFF 16 Fig. 98 Internal flash memory block diagram
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Bus Operation Modes G Read The Read mode is entered by pulling the OE pin low when the CE pin is low and the WE and RP pins are high. There are two read modes: array and status register, which are selected by software command input. In read mode, the data corresponding to each software command entered is output from the data I/O pins DB0– DB 7. The read array mode is automatically selected when the MCU is powered on or after releasing deep power down mode. G Output Disable The output disable mode is entered by pulling the CE pin low and the WE, OE, and RP pins high. Also, the data I/O pins are placed in the high-impedance state. G Standby The standby mode is entered by driving the CE pin high when the RP pin is high. Also, the data I/O pins are placed in the high-im- pedance state. However, if the CE pin is set high during erase or program operation, the internal control circuit does not halt imme- diately and normal power consumption is required until the operation under way is completed. G Write The write mode is entered by pulling the WE pin low when the CE pin is low and the OE and RP pins are high. In this mode, the MCU accepts the software commands or write data entered from the data I/O pins. A program, erase, or some other operation is ini- tiated depending on the contents of the software command entered here. The input data such as address and software com- mand is latched at the rising edge of WE or CE whichever occurs earlier. G Deep Power Down The deep power down mode is entered by pulling the RP pin low. Also, the data I/O pins are placed in the high-impedance state. When the MCU is freed from deep power down mode, the read ar- ray mode is selected and the contents of the status register is set to “8016”. If the RP pin is pulled low during erase or program op- eration, the operation under way is canceled and the data in the relevant block becomes invalid. Software Commands Table 30 lists the software commands. By inputting a software command from the data I/O pins (DB 0–DB 7) in write mode, specify the contents of the operation, such as erase or program operation, to be performed. The following explains the contents of each software command. G Read Array Command (FF 16) The read array mode is entered by writing the command code “FF 16” in the first bus cycle. When an address to be read is input in one of the bus cycles that follow, the contents of the specified address are output from the data I/O pins (DB0–DB 7). The read array mode is retained intact until another command is written. The read array mode is also selected automatically when the MCU is powered on and after releasing deep power down mode. G Read Status Register Command (70 16) When the command code “7016” is written in the first bus cycle, the contents of the status register are output from the data I/O pins (DB 0–DB 7) by a read in the second bus cycle. Since the con- tents of the status register are updated at the falling edge of OE or CE, the OE or CE signal must be input each time the status is read. The status register is explained in the next section. G Clear Status Register Command (5016) This command is used to clear the bits SR4, SR5 of the status register after they have been set. These bits indicate that opera- tion has ended in an error. To use this command, write the command code “50 16” in the first bus cycle. G Program Command (40 16) The program mode is entered when the command code “4016” is written in the first bus cycle. Then, if the address and data to pro- gram are written in the second bus cycle, program operation (data programming and verification) will start. Whether the write operation is completed can be confirmed by reading the status register or the RY/BY signal status. When the program starts, the read status register mode is entered automati- cally and the contents of the status register can be read out from the data I/O pins (DB 0 to D7B ). The status register bit 7 (SR7) is set to “0” at the same time the write operation starts and is re- turned to “1” upon completion of the write operation. In this case, the read status register mode remains active until the next com- mand is written.2 ____ The RY/BY pin is “L” during write operation and “H ” when the write operation is completed as is the status register bit 7 (SR7). At program end, program results can be checked by reading the status register. Figure 99 shows the byte program flowchart.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Command Read array Read status register Clear status register Byte Program All block erase Block erase Mode Write Write Write Write Write Write Address X(Note 4) X X X X X Data (DB0 to DB7) FF16 7016 5016 4016 2016 2016 Mode Read Write Write Write Address X WA (Note 2) X BA (Note 3) Data (DB0 to DB7) SRD (Note 1) WD (Note 2) 2016 D0 16 First bus cycle Second bus cycle Notes 1: SRD = Status Register Data 2: WA = Write Address, WD = Write Data 3: BA = Block Address to be erased (Input the maximum address of each block) 4: X denotes a given address in the User ROM area or Boot ROM area. Table 30 Software command list (parallel I/O mode) Cycle number Fig. 99 Byte program flowchart S t a r t W r i t e 4 01 S t a t u s r e g i s t e r r e a d Auto program completed (Write read command FF 16) N O YES W r i t e a d d r e s s W r i t e d a t a SR4 = 0 ? P r o g r a m e r r o r NO Y E S S R 7 = 1 ? o r R Y B Y W r i t e
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. G Erase All Blocks Command (2016/2016) By writing the command code “2016” in the first bus cycle and the confirmation command code “2016” in the second bus cycle that follows, the erase all blocks (erase and erase verify) operation starts. Whether the erase all blocks command is terminated can be con- ____ firmed by reading the status register or the RY/BY signal status . When the erase all blocks operation starts, the read status regis- ter mode is entered automatically and the contents of the status register can be read out at the data I/O pins (DB 0 to DB7). The status register bit 7 (SR7) is set to “0” at the same time the erase operation starts and is returned to “1” upon completion of the erase operation. In this case, the read status register mode re- mains active until another command is written. ____ The RY/BY pin is “L” during erase operation and “H ” when the erase operation is completed as is the status register bit 7 (SR7). At erase all blocks end, erase results can be checked by reading the status register. For details, refer to the section where the sta- tus register is detailed. G Block Erase Command (20 16/D016) By writing the command code “2016” in the first bus cycle and the confirmation command code “D0 16” in the second bus cycle that follows to the block address of a flash memory block, the block erase (erase and erase verify) operation starts. Whether the block erase operation is completed can be confirmed ____ by reading the status register or the RY/BY pin state. When the block erase operation starts, the read status register mode is en- tered automatically and the contents of the status register can be read out at the data I/O pins (DB 0 to DB7). The status register bit 7 (SR7) is set to “0” at the same time the block erase operation starts and is returned to “1” upon completion of the block erase operation. In this case, the read status register mode remains ac- tive until the read array command (FF 16) is written. ____ The RY/BY pin is “L” during block erase operation and “H ” when the block erase operation is completed as is the status register bit 7 (SR7). At block erase operation end, erase results can be checked by reading the status register. For details, refer to the section where the status register is detailed. Figure 100 shows the erase flowchart. Fig. 100 Erase flowchart W r i t e 2 01 2 01 6/ D 01 B l o c k a d d r e s s Erase completed (Write read command FF16) NO YES S t a r t W r i t e SR5 = 0 ? Erase error Y E S NO 2 01 6: E r a s e a l l b l o c k s D B l o c k e r a s e SR 7 = 1 ? or RY/BY = 1 ? Status register read
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Status Register The status register indicates status such as whether an erase op- eration or a program ended successfully or in error. It can be read under the following conditions. (1) In the read array mode when the read status register command (70 16) is written and the block address is subsequently read. (2) When reading the User ROM area, in the period from when the program write or block erase starts to when the read array command (FF 16) is written. The status register is cleared in the following situations. (1) By writing the clear status register command (5016) (2) In the deep power down mode (3) In the power supply off state Table 31 lists the definition of each status register bit. When power is turned on or returning from the deep power down mode, the sta- tus register becomes “80 16”. G Sequencer Status (SR7) The sequencer status indicates the operating status of the flash memory. This bit is set to “0” (busy) during write or erase operation and is set to “1” (ready) when these operations end. After power-on, the sequencer status is set to “1” (ready). G Erase Status (SR5) The erase status indicates the operating status of erase operation. If an erase error occurs, it is set to “1”. When the erase status is cleared, it is set to “0”. G Program Status (SR4) The program status indicates the operating status of write opera- tion. When a write error occurs, it is set to “1”. The program status is set to “0” when it is cleared. Table 31 Status register Each bit of SRD0 bits SR7 (DB7) SR6 (DB6) SR5 (DB5) SR4 (DB4) SR3 (DB3) SR2 (DB2) SR1 (DB1) SR0 (DB0) Sequencer status Reserved Erase status Program status Reserved Reserved Reserved Reserved “1” Ready Ended in error Ended in error Status name “0” Busy Ended successfully Ended successfully Definition
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Full Status Check By performing full status check, it is possible to know the execu- tion results of erase and program operations. Figure 101 shows a full status check flowchart and the action to be taken when each error occurs. Fig. 101 Full status check flowchart and remedial procedure for errors ____ Ready/Busy (RY/BY) Pin ____ The RY/BY pin is an output pin (N-channel open drain output) which, such as the sequencer status (SR7), indicates the operat- ing status of the flash memory. It is “L” level (busy) during program or erase operation and becomes the high impedance state (ready) ____ when these operations end. The RY/BY pin requires an external pull-up operation. Read status register SR4 = 1 and SR5 = 1 ? N O Y E S S R 5 = 0 ? Y E S Er a s e e r r o rN O S R 4 = 0 ? YES N O Command sequence error P r o g r a m e r r o r E n d ( E r a s e , p r o g r a m ) E x e c u t e t h e c l e a r s t a t u s r e g i s t e r c o m m a n d ( 5 01 t o c l e a r t h e s t a t u s r e g i s t e r T r y p e r f o r m i n g t h e o p e r a t i o n o n e m o r e t i m e a f t e r c o n f i r m i n g t h a t t h e c o m m a n d i s e n t e r e d c o r r e c t l y S h o u l d a b l o c k e r a s e e r r o r o c c u r , t h e b l o c k i n e r r o r c a n n o t b e u s e d N o t e: W h e n o n e o f S R 5 a n d S R 4 i s s e t t o “ 1 ” , n o n e o f t h e p r o g r a m , e r a s e a l l b l o c k s , a n d b l o c k e r a s e c o m m a n d s i s a c c e p t e d E x e c u t e t h e c l e a r s t a t u s r e g i s t e r c o m m a n d b e f o r e e x e c u t i n g t h e s e c o m m a n d s Should a program error occur, the block in error cannot be used.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. (3) Standard serial I/O Mode The standard serial I/O mode inputs and outputs the software commands, addresses and data needed to operate (read, pro- gram, erase, etc.) the internal flash memory. This I/O is clock synchronized serial. This mode requires a purpose-specific pe- ripheral unit. Table 32 Description of pin function (Flash Memory Standard Serial I/O Mode) P i n n a m eS i g n a l n a m eI OF u n c t i o n VCC ,VSS P o w e r s u p p l y i n p u tA p p l y V V f o r V v e r s i o n o r V V f o r V v e r s i o n t o t h e VC C p i n A p p l y V t o t h e V s s p i n C N VS S C N VS S T h i s c o n t r o l s t h e M C U o p e r a t i n g m o d e C o n n e c t t h i s p i n t o VP P V V I Reset input To reset, input “L” level for 20 cycles or longer clocks of φ.IRESET XI N C l o c k i n p u t C o n n e c t a c e r a m i c o r c r y s t a l r e s o n a t o r b e t w e e n t h e XI N a n d XO U T p i n s W h e n i n p u t t i n g a n e x t e r n a l l y d e r i v e d c l o c k i n p u t i t f r o m XI N a n d l e a v e XO U T o p e n .XO U T C l o c k o u t p u t A VC C , A VS S A n a l o g p o w e r s u p p l y i n p u t L P FL P FO L o o p f i l t e r f o r t h e f r e q u e n c y s y n t h e s i z e r . E x t . C a p 3 . 3 V l i n e p o w e r s u p p l y i n p u t I P00 to P07 I / O U S B D + U S B D + s i g n a l p o r t .USB D+ U S B D - USB D- P 10 t o P 17 P80 BUSY output P81 SCLK input I / O I / O O I I A p p l y 4 . 1 5 V – 5 . 2 5 V f o r 5 V v e r s i o n o r 3 . 0 0 V – 3 . 6 0 V f o r 3 V v e r s i o n t o t h e A VC C p i n A p p l y V t o t h e A V s s p i n U S B D - s i g n a l p o r t . P o w e r s u p p l y i n p u t p i n f o r 3 . 3 V U S B l i n e d r i v e r . When these ports are not used, input “L” or “H ” level, or leave them open in output mode. I/O port P0 I/O I / O p o r t P 1 I / OP 20 t o P 27 I / O p o r t P 2 P30 to P37 I / OP 40 t o P 44 I/O port P3 I/O I / O p o r t P 4 I / OP 50 t o P 57 I / O p o r t P 5 I / OP 60 t o P 67 I / O p o r t P 6 I OP t o P 74 I O p o r t P T h i s i s a B U S Y o u t p u t p i n This is a serial clock input pin. P 82 S R X D in p u tT h i s i s a s e r i a l d a t a i n p u t p i n OP 83 S T X D o u t p u tT h i s i s a s e r i a l d a t a o u t p u t p i n P t o P 87 W h e n t h e s e p o r t s a r e n o t u s e d i n p u t L o r H l e v e l o r l e a v e t h e m o p e n i n o u t p u t m o d e I O p o r t P O Note: The unused pins LPF, Ext.Cap, USB D+/USB D- require the same treatment as that of in the parallel I/O mode.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 102 Pin connection diagram in standard serial I/O mode (1) P74/OBF1 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0 4 1 4 2 4 3 4 4 4 5 4 6 4 7 4 8 4 9 5 0 5 1 5 2 5 3 5 4 5 5 5 6 5 7 5 8 5 9 6 0 6 5 6 7 6 8 7 0 7 1 P 61/ D Q 1 P 56/ R ( E ) P 55/ A0 P 53/ I B F0 P 52/ O B F0 C N VS S R E S E T A VC C A VS S P 44/ C N T R 1 P87/RTS1 P86/CTS1 VC C P 50/ XC I N VS S XI N XO U T P 51/ TO U T/ XC O U T L P F P85/URXD 1 P 84/ U T X D 1 P32 P 31 M37641F8FP P 60/ D Q 0 P 54/ S0 2 1 2 2 2 3 2 4 P 43/ C N T R 0 P 42/ I N T1 P 41/ I N T0 P 40/ E D M A 6 1 6 2 6 3 6 4 P 83/ R T S2/ S T X D P 82/ C T S2/ S R X D P81/URXD 2/SCLK P80/UTXD 2/SRDY P 37/ R D P 36/ W R P35/SYNC OUT P 34/φOUT P 33/ D M AO U T P 30/ R D Y P 17/ A B1 5{ A B1 P 16/ A B1 4{ A B1 P 15/ A B1 3{ A B1 P 14/ A B1 2{ A B1 P 13/ A B1 1{ A B1 P 12/ A B1 0{ A B1 P 11/ A B9{ A B9} P 10/ A B8{ A B8} P 07/ A B7{ A B7} P 06/ A B6{ A B6} P 05/ A B5{ A B5} P 04/ A B4{ A B4} P 03/ A B3{ A B3} P 02/ A B2{ A B2} P 01/ A B1{ A B1} P 00/ A B0{ A B0} P 27/ D B7{ D B7} P 26/ D B6{ D B6} P 25/ D B5{ D B5} P 24/ D B4{ D B4} P 23/ D B3{ D B3} P 22/ D B2{ D B2} P 21/ D B1{ D B1} P 20/ D B0{ D B0} P73/IBF1/HLDA P 72/ S1 P 71/ H O L D P70/SOF U S B D + U S B D - E x t . C a p VSS VCC P 67/ D Q 7 P 66/ D Q 6 P 65/ D Q 5 P64/DQ4 P63/DQ3 P 62/ D Q 2 BUSY SCLK C N VS S S C L K R E S E T 4 . 5 t o 5 . 2 5 V VC C (Note) VSS → VCC VCC VSS Mode setup method Signal Value Connect to oscillator circuit. P a c k a g e o u t l i n e : 8 0 P 6 N - A SRXD STXD R E S E T VP P Note: It is necessary to apply Vcc only when reset is released.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 103 Pin connection diagram in standard serial I/O mode (2) P 74/ O B F1 2 5 2 8 3 1 3 4 3 7 4 0 6 5 6 6 6 7 6 9 7 0 7 2 7 3 7 4 7 6 7 8 7 9 P61/DQ1 P 56/ R ( E ) P 55/ A0 P 53/ I B F0 P 52/ O B F0 C N VS S R E S E T A VC C A VS S P 44/ C N T R 1 P87/RTS1 P86/CTS1 VC C P 50/ XC I N VS S XI N XO U T P 51/ TO U T/ XC O U T L P F P85/URXD 1 P84/UTXD 1 P32 P31 M 3 7 6 4 1 F 8 H P P 60/ D Q 0 P 54/ S0 2 2 P 43/ C N T R 0 P 42/ I N T1 P41/INT0 6 1 6 2 6 3 P83/RTS2/STXD P82/CTS2/SRXD P81/URXD 2/SCLK P80/UTXD 2/SRDY P37/RD P36/WR P35/SYNC OUT P34/φOUT P33/DMA OUT P30/RDY P17/AB15{AD15} P16/AB14{AD14}P21/DB1 P 20/ D B0 U S B D + U S B D - Ext.Cap VSS VCC P 67/ D Q 7 P66/DQ6 P65/DQ5 P 64/ D Q 4 P63/DQ3 P 62/ D Q 2 P40/EDMA P 71/ H O L D P 70/ S O F P 72/ S1 P73/IBF1/HLDA VC C VSS P 15/ A B1 3{ A B1 P 14/ A B1 2{ A B1 P 13/ A B1 1{ A B1 P 12/ A B1 0{ A B1 P 11/ A B9{ A B9} P 10/ A B8{ A B8} P 07/ A B7{ A B7} P 06/ A B6{ A B6} P 05/ A B5{ A B5} P 04/ A B4{ A B4} P 03/ A B3{ A B3} P 02/ A B2{ A B2} P 01/ A B1{ A B1} P 00/ A B0{ A B0} P 27/ D B7{ D B7} P 26/ D B6{ D B6} P 25/ D B5{ D B5} P 24/ D B4{ D B4} P 23/ D B3{ D B3} P 22/ D B2{ D B2} C N VS S S C L K R E S E T M o d e s e t u p m e t h o d S i g n a lV a l u e Connect to oscillator circuit. Package outline: 80P6Q-A B U S Y S C L K SRXD S T X D R E S E T VP P 4 . 5 t o 5 . 2 5 V VC C o t VS S → VC C Note: It is necessary to apply Vcc only when reset is released.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. The standard serial I/O mode is different from the parallel I/O mode in that the CPU controls flash memory rewrite (uses the CPU rewrite mode), rewrite data input and so forth. The standard serial I/O mode is started by connecting “H ” to the P8 1(SCLK) pin and “H ” to the CNVSS pin (apply 4.5 V to 5.25 V to Vpp from an external source), and releasing the reset operation. (In the ordi- nary microcomputer mode, set CNVss pin to “L” level.) This control program is written in the Boot ROM area when the product is shipped from Mitsubishi. Accordingly, make note of the fact that the standard serial I/O mode cannot be used if the Boot ROM area is rewritten in parallel I/O mode. Figures 102 and 103 show the pin connections for the standard serial I/O mode. In standard serial I/O mode, serial data I/O uses the four serial I/O pins SCLK, SRXD, STXD and SRDY (BUSY). The SCLK pin is the transfer clock input pin through which an external transfer clock is input. The STXD pin is for CMOS output. The SRDY (BUSY) pin outputs “L” level when ready for reception and “H ” level when re- ception starts. Serial data I/O is transferred serially in 8-bit units. In standard serial I/O mode, only the User ROM area shown in Figure 104 can be rewritten. The Boot ROM area cannot. In standard serial I/O mode, a 7-byte ID code is used. When there is data in the flash memory, commands sent from the peripheral unit (programmer) are not accepted unless the ID code matches. Outline Performance (Standard Serial I/O Mode) In standard serial I/O mode, software commands, addresses and data are input and output between the MCU and peripheral units (serial programer, etc.) using 4-wire clock-synchronized serial I/O. In reception, software commands, addresses and program data are synchronized with the rise of the transfer clock that is input to the SCLK pin, and are then input to the MCU via the SRXD pin. In transmission, the read data and status are synchronized with the fall of the transfer clock, and output from the STXD pin. The STXD pin is for CMOS output. Transfer is in 8-bit units with LSB first. When busy, such as during transmission, reception, erasing or program execution, the SRDY (BUSY) pin is “H ” level. Accordingly, always start the next transfer after the SRDY (BUSY) pin is “L” level. Also, data and status registers in a memory can be read after in- putting software commands. Status, such as the operating state of the flash memory or whether a program or erase operation ended successfully or not, can be checked by reading the status register. Here following explains software commands, status registers, etc. N o t e s T h e B o o t R O M a r e a c a n b e r e w r i t t e n i n o n l y p a r a l l e l I O m o d e A c c e s s t o a n y o t h e r a r e a s i s i n h i b i t e d T o s p e c i f y a b l o c k u s e t h e m a x i m u m a d d r e s s i n t h e b l o c k CPU rewrite mode, standard serial I/O mode U s e r a r e a B o o t a r e a s e l e c t b i t ” User area / Boot area select bit = “1” E00016 U s e r R O M a r e a Kb y t eFFFF 16 B o o t R O M a r e a C000 16 Block 1 : 8 Kbytes Block 2 : 16 Kbytes Block 0 : 8 Kbytes 800016 F00016 FFFF 16 Fig. 104 Block digram of on-chip flash memory
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Software Commands Table 33 lists software commands. In standard serial I/O mode, erase, program and read are controlled by transferring software commands via the SRXD pin. Software commands are explained 2nd byte Address (middle) 3rd byte Address (high) 4th byte Data output 5th byte Data output 6th byte Data output Data output to 259th byte Data input to 259th byte FF When ID is not verified Not acceptable 1st byte transfer Notes1: Shading indicates transfer from the internal flash memory microcomputer to a programmer. All other data is transferred from a programmer to the in- ternal flash memory microcomputer. 2: SRD refers to status register data. SRD1 refers to status register 1 data. 3: All commands can be accepted for the products of which boot ROM area is totally blank. 4: Address low is AB0 to AB7; Address middle is AB8 to AB15; Address high is AB16 to AB23. here below. Basically, the software commands of the standard se- rial I/O mode are as same as that of the parallel I/O mode, but 4 commands are added: ID check, download, version data output and Boot ROM area output functions. Table 33 Software commands (Standard serial I/O mode) Control command
1 Page read
2 Page program 41
16 Address
(middle) Address (high) Data input Data input Data input Not acceptable Not acceptable Not acceptable
3 Block erase 20 16 Address
(middle) Address (high) D0 16
4 Erase all blocks A7 16 D0 16
5 Read status register 70 16 SRD
6 Clear status register 50 16 Not
7 ID check F5 16 Address
(low) Size (low) Address (middle) Size (high) Address (high) Check- sum ID size ID1 To ID7 Acceptable
8 Download function FA 16 Data
9 Version data output function FB 16 Version
(middle) Version data output Address (high) Version data output Data output Version data output Data output Version data output Data output Version data output to 9th byte Data output to 259th byte Acceptable Not acceptable FC 1610 Boot ROM area output function
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. G Read Status Register Command This command reads status information. When the “7016” com- mand code is transferred with the 1st byte, the contents of the status register (SRD) with the 2nd byte and the contents of status register 1 (SRD1) with the 3rd byte are read. G Page Read Command This command reads the specified page (256 bytes) in the flash memory sequentially one byte at a time. Execute the page read command as explained here following. (1) Transfer the “FF 16” command code with the 1st byte. (2) Transfer addresses A8 to A15 and A16 to A23 with the 2nd and 3rd bytes respectively. (3) From the 4th byte onward, data (DB0 to DB7) for the page (256 bytes) specified with addresses A8 to A23 will be output se- quentially from the smallest address first synchronized with the fall of the clock. data0 data255 A t o A A t o A S C L K S R X D S T X D S R D Y B U S Y S R D o u t p u t S R D 1 o u t p u t S C L K S R X D S T X D S R D Y B U S Y 7016 Fig. 105 Timing for page read Fig. 106 Timing for reading status register
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 107 Timing for clear status register G Clear Status Register Command This command clears the bits (SR3 to SR5) which are set when the status register operation ends in error. When the “50 16” com- mand code is sent with the 1st byte, the aforementioned bits are cleared. When the clear status register operation ends, the SRDY (BUSY) signal changes from “H ” to “L” level. SCLK SRXD STXD SRDY (BUSY) 5016 AB 8 to AB 15 A B1 6 t o A 34 11 6 d a t a 0 d a t a 2 5 5 S C L K S R X D S T X D S R D Y B U S Y G Page Program Command This command writes the specified page (256 bytes) in the flash memory sequentially one byte at a time. Execute the page pro- gram command as explained here following. (1) Transfer the “41 16” command code with the 1st byte. (2) Transfer addresses AB8 to AB15 and AB16 to AB23 with the 2nd and 3rd bytes respectively. (3) From the 4th byte onward, as write data (DB0 to DB7) for the page (256 bytes) specified with addresses A8 to A23 is input sequentially from the smallest address first, that page is auto- matically written. When reception setup for the next 256 bytes ends, the SRDY (BUSY) signal changes from “H ” to “L” level. The result of the page program can be known by reading the status register. For more information, see the section on the status register. Fig. 108 Timing for page program
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. G Block Erase Command This command erases the contents of the specifided block. Ex- ecute the block erase command as explained here following. (1) Transfer the “20 16” command code with the 1st byte. (2) Transfer addresses AB8 to AB15 and AB16 to AB23 with the 2nd and 3rd bytes respectively. (3) Transfer the verify command code “D0 16” with the 4th byte. With the verify command code, the erase operation will start for the specifided block in the flash memory. Set the addresses AB 8 to AB23 to the maximum address of the specified block.
2016 D 01
S R X D S T X D S R D Y B U S Y A B8 t o A A B1 6 t o A When block erasing ends, the SRDY (BUSY) signal changes from “H ” to “L” level. The result of the erase operation can be known by reading the status register. For more information, see the section on the status register. Fig. 109 Timing for block erasing G Erase All Blocks Command This command erases the contents of all blocks. Execute the erase all blocks command as explained here following. (1) Transfer the “A7 16” command code with the 1st byte. (2) Transfer the verify command code “D0 16” with the 2nd byte. With the verify command code, the erase operation will start and continue for all blocks in the flash memory. When erase all blocks end, the SRDY (BUSY) signal changes from “H ” to “L” level. The result of the erase operation can be known by reading the status register. A716 D0 16 SCLK SRXD STXD SRDY (BUSY) Fig. 110 Timing for erase all blocks
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. G Download Command This command downloads a program to the RAM for execution. Execute the download command as explained here following. (1) Transfer the “FA 16” command code with the 1st byte. (2) Transfer the program size with the 2nd and 3rd bytes. (3) Transfer the check sum with the 4th byte. The check sum is added to all data sent with the 5th byte onward. (4) The program to execute is sent with the 5th byte onward. When all data has been transmitted, if the check sum matches, the downloaded program is executed. The size of the program will vary according to the internal RAM. Fig. 111 Timing for download F A1 P r o g r a m d a t a P r o g r a m d a t a Data size (low) C h e c k s u m S C L K S R X D S T X D S R D Y B U S Y D a t a s i z e h i g h
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. G Version Information Output Command This command outputs the version information of the control pro- gram stored in the Boot ROM area. Execute the version information output command as explained here following. (1) Transfer the “FB 16” command code with the 1st byte. (2) The version information will be output from the 2nd byte on- ward. This data is composed of 8 ASCII code characters. Fig. 112 Timing for version information output F B1 ‘X’ ‘V’‘ E’‘ R ’ SCLK SRXD STXD SRDY (BUSY) G Boot ROM Area Output Command This command reads the control program stored in the Boot ROM area in page (256 bytes) unit. Execute the Boot ROM area output command as explained here following. (1) Transfer the “FC 16” command code with the 1st byte. (2) Transfer addresses AB8 to AB15 and AB16 to AB23 with the 2nd and 3rd bytes respectively. (3) From the 4th byte onward, data (DB0 to DB7) for the page (256 bytes) specified with addresses AB8 to AB23 will be output se- quentially from the smallest address first synchronized with the fall of the clock. Fig. 113 Timing for Boot ROM area output F C 1
6 A B8 t o
A A 6 t o A d a t a 0d a t a 2 5 5 SCL K SRX D STX D SRDY(BUSY)
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. G ID Check This command checks the ID code. Execute the boot ID check command as explained here following. G ID Code When the flash memory is not blank, the ID code sent from the se- rial programmer and the ID code written in the flash memory are compared to see if they match. If the codes do not match, the command sent from the serial programmer is not accepted. An ID code contains 8 bits of data. Area is, from the 1st byte, addresses FFC2 16 to FFC916. Write a program into the flash memory, which already has the ID code set for these addresses. Fig. 114 Timing for ID check ID size ID1 ID7F516 C2 16 FF16 0016 SCLK SRXD STXD SRDY (BUSY) ROM code protect control ID7 ID6 ID5 ID4 ID3 ID2 ID1 FFC9 16 FFC8 16 FFC7 16 FFC6 16 FFC5 16 FFC4 16 FFC3 16 FFC2 16 Address Interrupt vector area Fig. 115 ID code storage addresses (1) Transfer the “F516” command code with the 1st byte. (2) Transfer addresses AB0 to AB7, AB8 to AB15 and AB16 to AB23 (“0016”) of the 1st byte of the ID code with the 2nd and 3rd re- spectively. (3) Transfer the number of data sets of the ID code with the 5th byte. (4) Transfer the ID code with the 6th byte onward, starting with the 1st byte of the code.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. G Status Register (SRD) The status register indicates operating status of the flash memory and status such as whether an erase operation or a program ended successfully or in error. It can be read by writing the read status register command (70 16). Also, the status register is cleared by writing the clear status register command (5016). Table 34 lists the definition of each status register bit. After releas- ing the reset, the status register becomes “80 16”.
- Sequencer status (SR7) The sequencer status indicates the operating status of the the flash memory. After power-on and recover from deep power down mode, the se- quencer status is set to “1” (ready). This status bit is set to “0” (busy) during write or erase operation and is set to “1” upon completion of these operations.
- Erase status (SR5) The erase status indicates the operating status of erase operation. If an erase error occurs, it is set to “1”. When the erase status is cleared, it is set to “0”.
- Program status (SR4) The program status indicates the operating status of write opera- tion. If a write error occurs, it is set to “1”. When the program status is cleared, it is set to “0”. SRD0 bits SR7 (bit7) SR6 (bit6) SR5 (bit5) SR4 (bit4) SR3 (bit3) SR2 (bit2) SR1 (bit1) SR0 (bit0) Definition “1”“ 0” Table 34 Status register (SRD) Status name Sequencer status Reserved Erase status Program status Reserved Reserved Reserved Reserved Ready Terminated in error Terminated in error Busy Terminated normally Terminated normally
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. G Status Register 1 (SRD1) The status register 1 indicates the status of serial communica- tions, results from ID checks and results from check sum comparisons. It can be read after the SRD by writing the read sta- tus register command (70 16). Also, status register 1 is cleared by writing the clear status register command (5016). Table 35 lists the definition of each status register 1 bit. This regis- ter becomes “00 16” when power is turned on and the flag status is maintained even after the reset. Table 35 Status register 1 (SRD1)
00 Not verified
01 Verification mismatch
10 Reserved
11 Verified
SR15 (bit7) SR14 (bit6) SR13 (bit5) SR12 (bit4) SR11 (bit3) SR10 (bit2) SR9 (bit1) SR8 (bit0) Boot update completed bit Reserved Reserved Checksum match bit ID check completed bits Data reception time out Reserved “1” Update completed Match Time out “0” Not Update Mismatch Normal operation DefinitionSRD1 bits Status name
- Boot update completed bit (SR15) This flag indicates whether the control program was downloaded to the RAM or not, using the download function.
- Check sum consistency bit (SR12) This flag indicates whether the check sum matches or not when a program, is downloaded for execution using the download func- tion.
- ID check completed bits (SR11 and SR10) These flags indicate the result of ID checks. Some commands cannot be accepted without an ID check.
- Data reception time out (SR9) This flag indicates when a time out error is generated during data reception. If this flag is attached during data reception, the re- ceived data is discarded and the MCU returns to the command wait state.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Full Status Check Results from executed erase and program operations can be known by running a full status check. Figure 116 shows a flow- chart of the full status check and explains how to remedy errors which occur. R e a d s t a t u s r e g i s t e r S R 4 = 1 a n d S N O Y E S S R 5 = 0 ? Y E S Er a s e e r r o rN O S R 4 = 0 ? Y E S NO C o m m a n d s e q u e n c e e r r o r Program error E n d ( E r a s e , p r o g r a m ) Execute the clear status register command (5016) to clear the status register. Try performing the operation one more time after confirming that the command is entered correctly. Should an erase error occur, the block in error cannot be used. Note: When one of SR5 to SR4 is set to “1” , none of the program, erase all blocks, and block erase commands is accepted. Execute the clear status register command (50 16) before executing these commands. S h o u l d a p r o g r a m e r r o r o c c u r , t h e b l o c k i n e r r o r c a n n o t b e u s e d Fig. 116 Full status check flowchart and remedial procedure for errors
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Example Circuit Application for Standard Serial I/O Mode Figure 117 shows a circuit application for the standard serial I/O mode. Control pins will vary according to a programmer, therefore see a programmer manual for more information. SRDY (BUSY) SCLK SRXD STXD CNVss Clock input BUSY output Data input Data output M37641F8 Notes 1: Control pins and external circuitry will vary according to a programmer. For more information, see the programmer manual. 2: In this example, the Vpp power supply is supplied from an external source (programmer). To use the user’s power source, connect to 4.5 V to 5.25 V. VPP power source input Fig. 117 Example circuit application for standard serial I/O mode
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Flash Memory Electrical Characteristics (Timing) (Ta = 20 to 70 oC, VCC = 4.5 to 5.25 V, φ = 6 MHz unless otherwise noted) Table 36 Read-only mode Read cycle time Address access time CE access time OE access time Output enable time (after CE) Output floating time (after CE) Output enable time (after OE) Output floating time (after OE) Output floating time (after PR) Output valid time (after CE, OE, address) Write recovery time (before read) RP recovery time Limits ns ns ns ns ns ns ns ns ns ns ns µs Parameter Min. 167 167 Typ. Max. 83.3 83.3 66.7 20.8 20.8 250 Symbol Unit Note :Timing measurement condition is showed in Figure 118. tRC ta (AD) ta (CE) ta (OE) tCLZ tDF(CE) tOLZ tDF(OE) tPHZ tOH tOEH tPS LimitsParameter 167 83.3 20.8 83.3 20.8 83.3 41.7 167 Symbol Unit Note :The read timing parameter in the command write operation mode is the same as that of the read-only mode. Typical value is at VCC = 5.0 V, Ta = 25 °C condition. Write cycle time Address set up time Address hold time Data set up time Data hold time CE set up time CE hold time WE pulse width “H ” write pulse width Read recover time (before write) Program time Erase all blocks time RY/BY delay time RP recovery time tWC tAS tAH tDS tDH tCS tCH tWP tWPH tGHWL tDAP tDAE tWHRL tPS Min. Typ. Max. 1.5 1000 167 ns ns ns ns ns ns ns ns ns ns µs s ns µs Table 37 Read / Write mode (WE control)
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. LimitsParameter 167 83.3 20.8 83.3 20.8 83.3 41.7 Symbol Unit Write cycle time Address set up time Address hold time Data set up time Data hold time WE set up time WE hold time CE pulse width “H ” CE pulse width Program time Erase all blocks time RY/BY delay time RP recovery time tWC tAS tAH tDS tDH tCS tCH tWP tWPH tDAP tDAE tWHRL tPS Min. Typ. Max. 1.5 1000 167 ns ns ns ns ns ns ns ns ns µs s ns µs Table 38 Read / Write mode (CE control) Parameter Erase all blocks time Block erase time Program time (1byte) 1.5 1.0 s s µs Min. Typ. Max. Unit Table 39 Erase and program operation Symbol Min. Typ. Max. Unit Table 40 VCC power up / power down timing Parameter RP = VIH set up time (after rised VCC = VCC min.)tVCS 10 Note :The read timing parameter in the command write operation mode is the same as that of the read-only mode. Typical value is at VCC = 5.0 V, Ta = 25 °C condition. Note :Miserase or miswrite may happen, in case of noise pulse due to the power supply on or off is input to the control pins. Therefore disableing the write mode is need for preventing memory data from breaking at the power supply on or off. 10µs (min.) waiting time is need to initiate read or write operation after VCC rises to VCC min. at power supply on. The memory data is protected owing to keep the RP pin VIL level at power supply off. The RP pin must be kept VIL level for 10µs (min.) after VCC rises to VCC min. at the power supply on. The RP pin must be kept VIL level until the VCC falls to the GND level at power supply off. RP pin doesn’t have latch mode, so that RP pin must be kept VIH level during read, erase and program operation. µs
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 118 VCC power up / power down timing 5.0V GND VCC VIH VIL RP Inhibit read / write tVCS VIH VIL CE VIH VIL WE tPS tPS Inhibit read / write Inhibit read / write V a l i d o u t p u t H I G H ZtD F O E tR C VI H VI L VI H VI L VI H VI L VI H VI L VO H VO L A d d r e s s C E O E W E D A T A V a l i d a d d r e s s tO H tO L Z ta C E tO E H tC L Z ta A D ta O E H I G H Z VI H VI L R P tP S tD F C E tP H Z A C e l e c t r i c a l c h a r a c t e r i s t i c s t e s t c o n d i t i o n I n p u t v o l t a g e VI L V VI H V I n p u t s i g n a l r i s i n g t i m e f a l l i n g t i m e n s T i m i n g m e a s u r e m e n t R e f e r e n c e v o l t a g e V L o a d c i r c u i t T T L g a t e C L p F o r kΩ N V C L p F m e a s u r e m e n t p i n Fig. 119 AC wave for read operation and test condition
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 120 AC wave for program operation (WE control) Fig.121 AC wave for program operation (CE control) VIH VIL Address VIH VIL VIH VIL VIH VoH CE OE WE DATA RY/BY VIL VIH VIL VoL 40H DIN tCS tCH tWPH tWP tDS tWHRL tOEH ta(CE) ta(OE) tDH SRD FFH tAHtAStWC VIH VIL RP tPS tDAP Valid Address Valid Address Program Read status register Write read array command VIH VIL Address VIH VIL VIH VIL VIH VoH CE OE WE DATA RY/BY VIL VIH VIL VoL 40H DIN tWS tWH tCEP tDS tEHRL tOEH ta(CE) ta(OE) tDH SRD FFH tAHtAStWC VIH VIL RP tPS tDAP Program Read status register Write read array command Valid Address Valid Address
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Fig. 122 AC wave for erase operation (WE control) Fig. 123 AC wave for erase operation (CE control) 20H D0H tWPH tWP tDS tDH tCS tCH tWC VIH VIL VIH VIL VIH VIL VIH VIL tAH VIH VOH VOL VILAddress tAS FFHSRD tOEH tDAE tWHRL ta(OE) ta(CE) CE OE WE DATA RY/BY VIH VIL tPS RP Erase Read status register Write read array command Valid Address Valid Address 20H D0H tCEPHtCEP tDS tDH tWS tWH tWC VIH VIL VIH VIL VIH VIL VIH VIL tAH VIH VOH VOL VIL Address tAS FFHSRD tOEH tDAE tEHRL ta(OE) ta(CE) CE OE WE DATA RY/BY VIH VIL tPS RP Valid Address Erase Read status register Write read array command Valid Address
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. NOTES ON PROGRAMMING Processor Status Register
- The contents of the processor status register (PS) after a reset are undefined, except for the interrupt disable flag (I) which is “1”. After a reset, initialize flags which affect program execution. In particular, it is essential to initialize the index X mode (T) and the decimal mode (D) flags because of their effect on calculations.
- To reference the contents of the processor status register (PS), execute the PHP instruction once then read the contents of (S+1). If necessary, execute the PLP instruction to return the PS to its original status. A NOP instruction must be executed after every PLP instruction.
- A SEI instruction must be executed before every PLP instruction. A NOP instruction must be executed before every CLI instruction. BRK Instruction It can be detected that the BRK instruction interrupt event or the least priority interrupt event by referring the stored B flag state. Refer to the stored B flag state in the interrupt routine. Decimal Calculations When decimal mode is selected, the values of the V flags are in- valid. The carry flag (C) is set to “1” if a carry is generated as a result of the calculation, or is cleared to “0” if a borrow is generated. To de- termine whether a calculation has generated a carry, the C flag must be initialized to “0” before each calculation. To check for a borrow, the C flag must be initialized to “1” before each calcula- tion. Multiplication and Division Instructions
- The index X mode (T) and the decimal mode (D) flags do not af- fect the MUL and DIV instruction. Instruction Execution Time The instruction execution time is obtained by multiplying the fre- quency of the internal clock φ by the number of cycles needed to execute an instruction. The number of cycles required to execute an instruction is shown in the list of machine instructions. Timers
- If a value n (between 0 and 255) is written to a timer latch, the frequency division ratio is 1/(n+1).
- P51/XCOUT /TOUT pin cannot function as an I/O port when XCIN - XCOUT is oscillating. When XCIN - XCOUT oscillation is not used or X COUT oscillation drive is disabled, this pin can function as the TOUT output pin of the timer 1 or 2. When using the TOUT output function and f(XCIN) divided by 2 is used as the timer 1 count source (bit 2 of T123M = “1”), disable XCOUT oscillation drive (bit 5 of CCR = “1”). Ports
- When the data register (port latch) of an I/O port is modified with the bit managing instruction (SEB , CLB instructions) the value of the unspecified bit may be changed.
- In standby state (the stop mode by executing the STP instruction, and the wait mode by executing the WIT instruction) for low- power dissipation, do not make input levels of an I/O port “undefined”, especially for I/O ports of the P-channel and the N- channel open-drain. Pull-up (connect the port to Vcc) or pull-down (connect the port to Vss) these ports through a resistor. When determining a resistance value, note the following points: (1) External circuit (2) Variation of output levels during the ordinary operation When using built-in pull-up or pull-down resistor, note on varied current values. (1) When setting as an input port : Fix its input level (2) When setting as an output port : Prevent current from flowing out to external Serial I/O Do not write to the serial I/O shift register during a transfer when in SPI compatible mode. UART
- The all error flags PER, FER, OER and SER are cleared to “0” when the UARTx status register is read, at the hardware reset or initialization by setting the Transmit Initialization Bit. These flags are also cleared to “0” by execution of bit test instructions such as BBC and BCS .
- The transmission interrupt request bit is set and the interrupt re- quest is generated by setting the transmit enable bit to “1” even when selecting timing that either of the following flags is set to “1” as timing where the transmission interrupt is generated: (1) Transmit buffer empty flag is set to “1” (2) Transmit complete flag is set to “1”. Therefore, when the transmit interrupt is used, set the transmit in- terrupt enable bit to transmit enabled as the following sequence: (1) Transmit enable bit is set to “1” (2) Transmit interrupt request bit is set to “0” (3) Transmit interrupt enable bit is set to “1”.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. USB
- When the USB Reset Interrupt Status Flag is kept at “1”, all other flags in the USB internal registers (addresses 005016 to 005E16) will return to their reset status. However, the following registers are not affected by the USB reset: USB control register (address 0013 16), Frequency synthesizer control register (address 006C 16), Clock control register (address 001F16), and USB end- point-x FIFO register (addresses 006016 to 006416).
- When not using the USB function, set the USB Line Driver Supply Enable Bit of the USB control register (address 001316) to “1” for power supply to the internal circuits (at Vcc = 5V).
- When using an isochronous transfer, set the FLUSH Bit (bit 6 of address 005916 and bit 6 of address 005A16) as follows: IN FIFO: use AUTO_FLUSH Bit (bit 6 of 005816) OUT FIFO: when OUT_PKT_RDY Bit is “1”, set FLUSH Bit to “1”
- When the USB SOF Port Select Bit is “1”, the reference pulse of 83.3 ns (φ = 12 MHz) is output from the P70/SOF pin and syn- chronized with the SOF packet.
- The receive buffer full interrupt request is not generated if receive errors are detected at receiving.
- If a character bit length is 7 bits, bit 7 of the UARTx transmit/re- ceive buffer register 1 and bits 0 to 7 of the UARTx transmit/ receive buffer register 2 are ignored at transmitting; they are in- valid at receiving. If a character bit length is 8 bits, bits 0 to 7 of the UARTx transmit/ receive buffer register 2 are ignored at transmitting; they are in- valid at receiving. If a character bit length is 9 bits, bits 1 to 7 of the UARTx transmit/ receive buffer register 2 are ignored at transmitting; they are “0” at receiving.
- The IN_PKT_RDY Bit and OUT_PKT_RDY Flag can be set or cleared by software even when using the AUTO_SET or AUTO_CLR function.
- When writing to USB-related registers, set the USB Clock Enable Bit to “1”, then perform the write after four φ cycle waits.
- When using the MCU at Vcc = 3.3V, set the USB Line Driver Sup- ply Enable Bit to “0” (line driver disable). Note that setting the USB Line Driver Current Control Bit (USBC3) doesn’t affect the USB operation.
- Read one packet data from the OUT FIFO before clearing the OUT_PKT_RDY Flag. If the OUT_PKT_RDY Flag is cleared while one packet data is being read, the internal read pointer can- not operate normally.
- Use the transfer instructions such as LDA and STA to set the reg- isters: USB interrupt status registers 1, 2 (addresses 0052 16, 005316); USB endpoint 0 IN control register (address 005916); USB endpoint x IN control register (address 005916); USB end- point x OUT control register (address 005A16). Do not use the read-modify-write instructions such as the SEB or the CLB in- struction. When writing to bits shown by Table 39 using the transfer instruc- tion such as LDA or STA , a value which never affect its bit state is required. Take the following sequence to change these bits contents: (1) Store the register contents onto a variable or a data register. (2) Change the target bit on the variable or the data register. Si- multaneously mask the bit so that its bit state cannot be changed. (See to Table 39.) (3) Write the value from the variable or the data register to the register using the transfer instruction such as LDA or STA. Table 39 Bits of which state might be changed owing to software write Regster name USB endpoint 0 IN control register USB endpoint x (x = 1 to 4) IN control register USB endpoint x (x = 1 to 4) OUT control register Bit name IN_PKT_RDY (b1) DATA_END (b3) FORCE_STALL (b4) IN_PKT_RDY (b0) UNDER_RUN (b1) OUT_PKT_RDY (b0) OVER_RUN (b1) FORCE_STALL (b4) DATA_ERR (b5) Value not affecting state (Note) “0” “0” “1” “0” “1” “1” “1” “1” “1” Note: Writing this value will not change the bit state, because this value cannot be written to the bit by software.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Frequency Synthesizer
- The frequency synthesizer and DC-DC converter must be set up as follows when recovering from a Hardware Reset: (1) Enable the frequency synthesizer after setting the frequency synthesizer related registers (addresses 006C 16 to 006F16). Then wait for 2 ms. (2) Check the Frequency Synthesizer Lock Status Bit. If “0”, wait for 0.1 ms and then recheck. (3) When using the USB built-in DC-DC converter, set the USB Line Driver Supply Enable Bit of the USB control register to “1”. This setting must be done 2 ms or more after the setup described in step (1). The USB Line Driver Current Control Bit must be set to “0” at this time. (When Vcc = 3.3V, the setting explained in this step is not necessary.) (4) After waiting for (C + 1) ms so that the external capacitance pin (Ext. Cap. pin) can reach approximately 3.3 V, set the USB Clock Enable Bit to “1”. At this time, “C” equals the ca- pacitance (µ F) of the capacitor connected to the Ext. Cap. pin. For example, if 2.2 µF and 0.1 µF capacitors are con- nected to the Ext. Cap. in parallel, the required wait will be (2.3 + 1) ms. (5) After enabling the USB clock, wait for 4 or more φ cycles, and then set the USB Enable Bit to “1”.
- Bits 6 and 5 of the frequency synthesizer control register (ad- dress 006C 16) are initialized to “11” after reset release. Make sure to set bits 6 and 5 to “10” after the Frequency Synthesizer Lock Status Bit goes to “1”.
- When using the frequency synthesized clock function, we recom- mend using the fastest frequency possible of f(X IN) or f(XCIN) as an input clock for the PLL. Owing to the PLL mechanism, the PLL controls the speed of multiplied clocks from the source clock. As a result, when the source clock input is lower, the generated clock becomes less stable. This is because more multipliers are needed and the speed control is very rough. Higher source clock input generates a stabler clock, as less multipliers are needed and the speed control is more accurate. However, if the input clock frequency is relatively high, the PLL clock generator can quickly lock-up the output clock to the source and make the out- put clock very stable.
- Set the value of frequency synthesizer multiply register 2 (FSM2) so that the fPIN is 1 MHZ or higher. DMA
- In the memory expansion mode and microprocessor mode, the DMA OUT pin outputs “H” during a DMA transfer.
- Do not access the DMAC-related registers by using a DMAC transfer. The destination address data and the source address data will collide in the DMAC internal bus.
- When using the USB FIFO as the DMA transfer source or DMA transfer destination, make sure that, if you use the AUTO_SET or AUTO_CLR function, short packet data does not get mixed in with the transfer data.
- When setting the DMAC channel x enable bit (bit 7 of address 0041 16) to “1”, be sure simultaneously to set the DMAC channel x transfer initiation source capture register reset bit (bit 6 of ad- dress 0041 16) to “1”. If this is not performed, an incorrect data will be transferred at the same time when the DMAC is enabled. Memory Expansion Mode & Microprocessor Mode
- In both memory expansion mode and microprocessor mode, use the LDM instruction or STA instruction to write to port P3 (address 000E 16). When using the Read-Modify-Write instruction (SEB in- struction, CLB instruction) you will need to map a memory that the CPU can read from and write to.
- In the memory expansion mode, if the internal and external memory areas overlap, the internal memory becomes the valid memory for the overlapping area. When the CPU performs a read or a write operation on this overlapped area, the following things happen: (1) Read The CPU reads out the data in the internal memory instead of in the external memory. Note that, since the CPU will output a proper read signal, address signal, etc., the memory data at the respective address will appear on the external data bus. (2) Write The CPU writes data to both the internal and external memo- ries.
- The wait function is serviceable at accessing an external memory. Stop Mode
- When the STP instruction is executed, bit 7 of the clock control register (address 001F16) goes to “0”. To return from stop mode, reset CCR7 to “1”.
- When using fSYN (set Internal System Clock Select Bit (CPMA6) to “1”) as the internal system clock, switch CPMA6 to “0” before executing the STP instruction. Reset CPMA6 after the system re- turns from Stop Mode and the frequency synthesizer has stabilized. CPMA6 does not need to be switched to “0” when using the WIT instruction.
- When the STP instruction is being executed, all bits except bit 4 of the timer 123 mode register (address 0029 16) are initialized to “0”. It is not necessary to set T123M1 (Timer 1 Count Stop Bit) to “0” before executing the STP instruction. After returning from Stop Mode, reset the timer 1 (address 0024 16), timer 2 (address 002516), and the timer 123 mode register (address 002916).
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. USAGE NOTES Oscillator Connection Notice The built-in feedback register (400 Ω ) is internally connected be- tween pins XIN and XOUT . Power Supply Pins Treatment Notice Please connect 0.1 µF and 4.7 µF capacitors in parallel between pins Vcc and Vss, and pins AVss and AVcc. These capacitors must be connected as close as possible be- tween the DC supply and GND pins, and also the analog supply pin and corresponding GND pin. Wiring patterns for these supply and GND pins must be wider than other signal patterns. These filter capacitors should not be placed near the LPF pins as they will cause noise problems Rest Pin Treatment Notice (Noise Elimination) If the reset input signal rises very slowly, we recommend attaching a capacitor, such as a 1000 pF ceramic capacitor with excellent high frequency characteristics, between the RESET pin and the Vss pin. Please note the following two issues for this capacitor connection. (1) Capacitor wiring pattern must be as short as possible (within 20 mm). (2) The user must perform an application level operation test. LPF Pin Treatment Notice All passive components must be located as close as possible to the LPF pin. µF p F L P F p i n A VS S p i n kΩ Fig. 124 Passive components near LPF pin USB Transceiver Treatment (Noise Elimination)
- The USB specification ver. 1.1 requires a driver -impedance 28 to 44 Ω. (Refer to Clause 7.1.1.1 Full-speed (12 Mb/s) Driver Char- acteristics in the USB specification.) In order to meet the USB specification impedance requirements, connect a resistor (27 Ω to 33 Ω recommended) in series between the USB D+ pin and the USB D- pin. In addition, in order to reduce the ringing and control the falling/ rising timing of USB D+/D- and a crossover point, connect a ca- pacitor between the USB D+/D- pins and the Vss pin if necessary. The values and structure of those peripheral elements depend on the impedance characteristics and the layout of the printed circuit board. Accordingly, evaluate your system and observe waveforms before actual use and decide use of elements and the values of resistors and capacitors.
- Connect a capacitor between the Ext. Cap. pin and the Vss pin. The capacitor should have a 2.2 µF capacitor (Tantalum capaci- tor) and a 0.1 µF capacitor (ceramic capacitor) connected in parallel. Figure 125 for the proper positions of the peripheral components. XI N e n a b l e lock F S E LS U S B C enable U S B C l o c k M H z U S B F C U e n a b l e U S B C USB transceiver e n a b l e U S B C DC-DC converter e n a b l e U S B C c u r r e n t m o d e U S B C 3 Ext. Cap. µF µF D kΩ Frequency Synthesizer N o t e N o t e s I n V c c V c o n n e c t t o V c c T h e r e s i s t o r s v a l u e s d e p e n d o n t h e l a y o u t o f t h e p r i n t e d c i r c u i t b o a r d Note 2 Fig.125 Peripheral circuit
- In Vcc = 3.3 V operation, connect the Ext. Cap. pin directly to the Vcc pin in order to supply power to the USB transceiver. In addi- tion, you will need to disable the DC-DC converter in this operation (set bit 4 of the USB control register to “0”.) If you are using the bus powered supply in Vcc = 3.3 V operation, the DC- DC converter must be placed outside the MCU.
- Make sure the USB D+/D- lines do not cross any other wires. Keep a large GND area to protect the USB lines. Also, make sure you use a USB specification compliant connecter for the connec- tion. AVss and AVcc Pin Treatment Notice (Noise Elimination) An insulation connector (Ferrite Beads) must be connected be- tween AVss and Vss pins and between AVcc and Vcc pins.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. Oscillator Wiring (Noise Elimination) (1) Keeping oscillator away from large current signal lines Install a microcomputer (and especially an oscillator) as far as possible from signal lines, including USB signal lines, where a cur- rent larger than the tolerance of current value flows. When a large current flows through those signal lines, strong noise occurs be- cause of mutual inductance. (2) Installing oscillator away from signal lines where potential levels change frequently Install an oscillator and a connecting pattern of an oscillator away from signal lines where potential levels change frequently. Also, do not cross such signal lines over the clock lines or the signal lines which are sensitive to noise. Terminate Unused Pins (1) Output ports : Open (2) Input ports : Connect each pin to Vcc or Vss through each resistor of 1 kΩ to 10 kΩ . Ports that permit the selecting of a built-in pull-up or pull-down re- sistor can also use this resistor. As for pins whose potential affects to operation modes such as pins CNVss, INT or others, select the Vcc pin or the Vss pin according to their operation mode. (3) I/O ports :
- Set the I/O ports for the input mode and connect them to Vcc or Vss through each resistor of 1 kΩ to 10 kΩ . Ports that permit the selecting of a built-in pull-up or pull-down re- sistor can also use this resistor. Set the I/O ports for the output mode and open them at “L” or “H ”.
- When opening them in the output mode, the input mode of the initial status remains until the mode of the ports is switched over to the output mode by the program after reset. Thus, the potential at these pins is undefined and the power source current may in- crease in the input mode. With regard to an effects on the system, thoroughly perform system evaluation on the user side.
- Since the direction register setup may be changed because of a program runaway or noise, set direction registers by program pe- riodically to increase the reliability of program.
- At the termination of unused pins, perform wiring at the shortest possible distance (20 mm or less) from microcomputer pins. DATA REQUIRED FOR MASK ORDERS The following are necessary when ordering a mask ROM produc- tion: 1. Mask ROM Order Confirmation Form 2. Mark Specification Form 3. Data to be written to ROM, in EPROM form (three identical cop- ies) or one floppy disk. For the mask ROM confirmation and the mark specifications, refer to the “Mitsubishi MCU Technical Information” Homepage: http://www.infomicom.maec.co.jp Clock Input/Output Pin Wiring (Noise Elimination) (1) Make the wiring for the input/output pins as short as possible. (2) Make the wiring across the grounding lead of the capacitor which is connected to an oscillator and the Vss pin of the MCU as short as possible (within 20 mm) (3) Make sure to isolate the oscillation Vss pattern from other pat- terns for oscillation circuit-use only.
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. PACKAGE OUTLINE QFP80-P-1420-0.80 1.58 Weight(g) JEDEC CodeEIAJ Package Code Lead Material Alloy 42 80P6N-A Plastic 80pin 14✕ 20mm body QFP 0.1 0.2 Symbol Min Nom Max A b c D E H E L y Dimension in Millimeters H D 0.5 ––I2 1.3 ––M D 14.6 ––M E 20.6 10°0° 0.1 1.4 0.80.60.4 23.122.822.5 17.116.816.5 0.8 20.220.019.8 14.214.013.8 0.20.150.13 0.450.350.3 2.8 3.05 e e e E c H E 80 65 H D D M D M E A F A1 A2 L y Recommended Mount Pad Detail F x – – 0.2 b x M MMP
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER MITSUBISHI MICROCOMPUTERS PRELIMINAR Y Notice: This is not a final specification. Some parametric limits are subject to change. © 2001 MITSUBISHI ELECTRIC CORP. New publication, effective May. 2001. Specifications subject to change without notice. Notes regarding these materials
- These materials are intended as a reference to assist our customers in the selection of the Mitsubishi semiconductor product best suited to the customer’s application; they do not convey any license under any intellectual property rights, or any other rights, belonging to Mitsubishi Electric Corporation or a third party.
- Mitsubishi Electric Corporation assumes no responsibility for any damage, or infringement of any third-party’s rights, originating in the use of any product data, diagrams, charts, programs, algorithms, or circuit application examples contained in these materials.
- All information contained in these materials, including product data, diagrams, charts, programs and algorithms represents information on products at the time of publication of these materials, and are subject to change by Mitsubishi Electric Corporation without notice due to product improvements or other reasons. It is therefore recommended that customers contact Mitsubishi Electric Corporation or an authorized Mitsubishi Semiconductor product distributor for the latest product information before purchasing a product listed herein. The information described here may contain technical inaccuracies or typographical errors. Mitsubishi Electric Corporation assumes no responsibility for any damage, liability, or other loss rising from these inaccuracies or errors. Please also pay attention to information published by Mitsubishi Electric Corporation by various means, including the Mitsubishi Semiconductor home page (http://www.mitsubishichips.com).
- When using any or all of the information contained in these materials, including product data, diagrams, charts, programs, and algorithms, please be sure to evaluate all information as a total system before making a final decision on the applicability of the information and products. Mitsubishi Electric Corporation assumes no responsibility for any damage, liability or other loss resulting from the information contained herein.
- Mitsubishi Electric Corporation semiconductors are not designed or manufactured for use in a device or system that is used under circumstances in which human life is potentially at stake. Please contact Mitsubishi Electric Corporation or an authorized Mitsubishi Semiconductor product distributor when considering the use of a product contained herein for any specific purposes, such as apparatus or systems for transportation, vehicular, medical, aerospace, nuclear, or undersea repeater use.
- The prior written approval of Mitsubishi Electric Corporation is necessary to reprint or reproduce in whole or in part these materials.
- If these products or technologies are subject to the Japanese export control restrictions, they must be exported under a license from the Japanese government and cannot be imported into a country other than the approved destination. Any diversion or reexport contrary to the export control laws and regulations of Japan and/or the country of destination is prohibited.
- Please contact Mitsubishi Electric Corporation or an authorized Mitsubishi Semiconductor product distributor for further details on these materials or the products contained therein. Keep safety first in your circuit designs!
- Mitsubishi Electric Corporation puts the maximum effort into making semiconductor products better and more reliable, but there is always the possibility that trouble may occur with them. Trouble with semiconductors may lead to personal injury, fire or property damage. Remember to give due consideration to safety when making your circuit designs, with appropriate measures such as (i) placement of substitutive, auxiliary circuits, (ii) use of non-flammable material or (iii) prevention against any malfunction or mishap. HEAD OFFICE: 2-2-3, MARUNOUCHI, CHIYODA-KU, TOKYO 100-8310, JAPAN LQFP80-P-1212-0.5 Weight(g) – 0.47 JEDEC CodeEIAJ Package Code Lead Material Cu Alloy 80P6Q-A Plastic 80pin 12✕ 12mm body LQFP 0.1 0.2 Symbol Min Nom Max A b c D E H E L y Dimension in Millimeters H D 0.225 ––I2 0.9 ––M D 12.4 ––M E 12.4 10°0° 0.1 1.0 0.70.50.3 14.214.013.8 14.214.013.8 0.5 12.112.011.9 12.112.011.9 0.1750.1250.105 0.280.180.13 1.4 1.7 e A F e H D E H E D 21 40 6180 y Lp 0.45 0.6 0.25 0.75 0.08 x M D l2 b2 M E e Recommended Mount Pad b x M A1 A2 L Detail F Lp c MMP
REVISION HISTORY 7641 GROUP DATA SHEET Rev. Date Description Page Summary (1/1) 1.0 04/06/2001 First edition Page 1 Page 104 Page 105 Page 145 Page 146 2.0 05/17/2001 Notes 2 are added. Fig.89 is revised: Explanation of bits 5 to 7 and Notes. Fig.90 is revised: Explanation of flow chart. “USB Transceiver Treatment” Line 9 is revised: “between the USB D+ pin and USB D- pin, or” is deleted. URL of Mitsubishi MCU Technical Information Homepage is revised: http://www.infomicom.maec.co.jp