Page 2
11) Please use the Products in accordance with any applicable environmental laws and regulations, such as the RoHS Directive. For more details, including RoHS compatibility, please contact a ROHM sales office. LAPIS Semiconductor shall have no responsibility for any damages or losses resulting non-compliance with any applicable laws or regulations.
Page 3
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Preface This manual describes the operation of the hardware of the 16-bit microcontroller ML620Q150A Series. The following manuals are also available. Read them as necessary. nX-U16/100 Core Instruction Manual Description on the basic architecture and the each instruction of the nX-U16/100 Core MACU8 Assembler Package User’s Manual Description on the method of operating the relocatable assembler, the linker, the librarian,...
Page 4
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Notation Classification Notation Description ♦ Numeric value xxh, xxH Indicates a hexadecimal number. x: Any value in the range of 0 to F Indicates a binary number; “b” may be omitted. x: A value 0 or 1 ♦...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Contents Contents Chapter 1 Overview .................................1-1 Features ...............................1-1 Configuration of Functional Blocks ......................1-4 1.2.1 Block Diagram of ML620Q151A/ML620Q152A/ML620Q153A(TQFP48)........1-4 1.2.2 Block Diagram of ML620Q154A/ML620Q155A/ML620Q156A(TQFP52)........1-5 1.2.3 Block Diagram of ML620Q157A/ML620Q158A/ML620Q159A(QFP64) ..........1-6 Pins ................................1-7 1.3.1 Pin Layout..............................1-8 1.3.2 List of Pins............................1-10 1.3.3 Pin Description ............................1-14 1.3.4...
Page 6
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Contents 4.3.3 STOP Mode ............................4-12 4.3.3.1 STOP Mode When the CPU runs with Low-Speed Clock.............4-12 4.3.3.2 STOP Mode When the CPU runs with High-Speed Clock............4-13 4.3.3.3 Note on Return Operation from STOP/HALT Mode..............4-14 4.3.4 Block control function .........................4-15 Chapter 5 Interrupts (INTs) .............................5-1 Genral Description ............................5-1...
Page 7
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Contents Description of Registers ..........................6-4 6.2.1 List of Registers.............................6-4 6.2.2 Frequency Control Register 0(FCON0)....................6-5 6.2.3 Frequency Control Register 1 (FCON1)....................6-7 6.2.4 Frequency Control Register 3 (FCON3)....................6-8 6.2.5 Frequency Status Register (FSTAT) ....................6-10 Description of Operation ...........................6-11 6.3.1 Low-Speed Clock ..........................6-11 6.3.1.1...
Page 8
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Contents Chapter 9 16bit Timer..............................9-1 Genral Description ............................9-1 9.1.1 Features..............................9-1 9.1.2 Configuration............................9-1 Description of Registers ..........................9-2 9.2.1 List of Registers.............................9-2 9.2.2 16bit timer 8 data register L,H (TMH8DL,H) ..................9-3 9.2.3 16bit timer 9 data register L,H (TMH9DL,H) ..................9-4 9.2.4 16bit timer A data register L,H (TMHADL,H) ..................9-5 9.2.5...
Page 9
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Contents 11.2.17 PWM5 control register 2 (PW5CON2) .....................11-27 11.2.18 PWM5 control register 4 (PW5CON4) .....................11-29 11.2.19 PWM5 control register 5 (PW5CON5) .....................11-30 11.2.20 PWM5 control register 6 (PW5CON6) .....................11-31 11.2.21 PWM6 period registers (PW6PL, PW6PH)..................11-32 11.2.22 PWM6 duty registers (PW6DL, PW6DH) ..................11-33 11.2.23 PWM6 counter registers (PW6CL, PW6CH) ..................11-34 11.2.24 PWM6 control register 0 (PW6CON0) .....................11-35 11.2.25 PWM6 control register 1 (PW6CON1) .....................11-37...
Page 10
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Contents Chapter 12 12. Synchronous Serial Port (SSIO)........................12-1 12.1 Genral Description ............................12-1 12.1.1 Features..............................12-1 12.1.2 Configuration............................12-1 12.1.3 List of Pins............................12-2 12.2 Description of Registers ..........................12-3 12.2.1 List of Registers...........................12-3 12.2.2 Serial Port 0 Transmit/Receive Buffers (SIO0BUFL, SIO0BUFH)............12-4 12.2.3 Serial Port 0 Control Register (SIO0CON) ..................12-5 12.2.4 Serial Port 0 Mode Register 0 (SIO0MOD0) ..................12-6 12.2.5 Serial Port 0 Mode Register 1 (SIO0MOD1) ..................12-7...
Page 11
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Contents Chapter 14 14. I C Bus Interface ............................14-1 14.1 Genral Description ............................14-1 14.1.1 Features..............................14-1 14.1.2 Configuration............................14-1 14.1.3 List of Pins............................14-2 14.2 Description of Registers ..........................14-3 14.2.1 List of Registers...........................14-3 14.2.2 I C Bus 0 Receive Register (I2C0RD) ....................14-4 14.2.3 I C Bus 0 Slave Address Register (I2C0SA)..................14-5 14.2.4 I...
Page 12
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Contents Chapter 17 17. Port 2 ................................17-1 17.1 Genral Description ............................17-1 17.1.1 Features..............................17-1 17.1.2 Configuration............................17-1 17.1.3 List of Pins............................17-1 17.2 Description of Registers ..........................17-2 17.2.1 List of Registers...........................17-2 17.2.2 Port 2 Data Register (P2D) ........................17-3 17.2.3 Port 2 control registers 0, 1 (P2CON0, P2CON1)................17-4 17.2.4 Port 2 Mode Register (P2MOD)......................17-6 17.3 Description of Operation ...........................17-8 17.3.1 Output Port Function ...........................17-8...
Page 13
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Contents 20.2.3 Port 5 Direction Register (P5DIR) ......................20-6 20.2.4 Port 5 Control Registers 0, 1 (P5CON0, P5CON1)................20-7 20.2.5 Port 5 Mode Registers 0, 1 (P5MOD0, P5MOD1)................20-9 20.3 Description of Operation .........................20-12 20.3.1 Input/Output Port Functions ......................20-12 20.3.2 Secondary, Tertiary, and Quartic Functions ..................20-12 Chapter 21 21.
Page 14
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Contents 24.1.1 Features..............................24-1 24.1.2 Configuration............................24-1 24.1.3 List of Pins............................24-2 24.2 Description of Registers ..........................24-3 24.2.1 List of Registers...........................24-3 24.2.2 SA-ADC Result Register 0L (SADR0L).....................24-4 24.2.3 SA-ADC Result Register 0H (SADR0H)....................24-4 24.2.4 SA-ADC Result Register 1L (SADR1L).....................24-5 24.2.5 SA-ADC Result Register 1H (SADR1H)....................24-5 24.2.6 SA-ADC Result Register 2L (SADR2L).....................24-6 24.2.7 SA-ADC Result Register 2H (SADR2H)....................24-6...
Page 15
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Contents 26.2.2 LLD Circuit Control Register 1 (LLDCON1) ..................26-3 26.3 Description of Operation ...........................26-4 26.3.1 Threshold Voltage ..........................26-4 26.3.2 Operation of LLD Circuit ........................26-5 Chapter 27 27. Power Supply Circuit ............................27-1 27.1 Genral Description ............................27-1 27.1.1 Features..............................27-1 27.1.2 Configuration............................27-1 27.1.3 List of Pins............................27-1 27.2 Description of Registers ..........................27-2...
Page 16
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Contents Appendix D Application Circuit Example ......................D-1 Appendix E Check List ............................E-1 Revision History Revision History..............................R-1 FEUL620Q150A Contents-12...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 1 Overview 1. Overview 1.1 Features This LSI is a high-performance 16-bit CMOS microcontroller into which rich peripheral circuits, such as 10-bit A/D converter, timer, PWM, synchronous serial port, UART, I2C bus interface (master), Low level detect circuit, are incorporated around 16-bit CPU nX-U16/100.
Page 19
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 1 Overview - 16 bits x 4ch - The auto reload timer mode / PWM mode - Timer start-stop function by the software and an external trigger. - A pulse width can be measured using an external-trigger input. - An external event can be selected as the counter clock.
Page 20
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 1 Overview Clock - Low-speed clock (This LSI can not guarantee the operation without low-speed clock) - Crystal oscillation (32.768 kHz) or Built-in RC oscillation (32.768kHz) - Crystal oscillation or Built-in RC oscillation is selectable as Code-Option. - High-speed clock - Built-in RC oscillation (2.097MHz) or Built-in PLL oscillation (8.192MHz) Power management...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 1 Overview 1.3.2 List of Pins Primary function Secondary function Tertiary function Quaternary function Description name name scription name scription name scription Negative power ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ supply pin Positive power ⎯...
Page 28
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 1 Overview Primary function Secondary function Tertiary function Quaternary function Description name name scription name scription name scription Input/output port / P34/ Successive PWM4 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ PWM4 AIN4/ approximation type output ADC input Input/output port / P35/ Successive...
Page 29
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 1 Overview Primary function Secondary function Tertiary function Quaternary function Description name name scription name scription name scription UART0 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ Input/output port RXD0 data input UART0 SSIO0 UART1 Input/output port TXD0 data SIN0 data...
Page 30
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 1 Overview Primary function Secondary function Tertiary function Quaternary function Description name name scription name scription name scription UART0 SSIO0 ⎯ ⎯ ⎯ data Input/output port RXD0 data SOUT0 output input UART0 PWM4 ⎯ ⎯ ⎯ Input/output port TXD0 data...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 1 Overview 1.3.3 Pin Descriptions Table 1-2 Pin Descriptions (1/3) Primary/ Secondary/ Pin name Description Logic Tertiary/ Quaternary Power supply — Negative power supply pin — — — Positive power supply pin — — — Positive power supply pin for internal logic (internally generated). Connect —...
Page 32
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 1 Overview Table 1-2 Pin Descriptions (2/3) Primary/ Secondary/ Pin name Description Logic Tertiary/ Quaternary UART TXD0* Secondary UART0 data output pin. Allocated to the secondary function of the P43, Positive P55 , P87 and the fourthly function of the P73. Quaternary UART0 data input pin.
Page 33
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 1 Overview Table 1-2 Pin Descriptions (3/3) Primary/ Pin name Description Logic Secondary External interrupt External maskable interrupt input pins. The interrupt is enabled and EXI0~7* Positive/ interrupt edge is selectable by the software for each bit. Allocated to the Primary Negative primary function of the P00 to P05 and P30 to P31.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 1 Overview 1.3.4 Handling of Unused Pins Table 1-3 shows methods of terminating the unused pins. Table 1-3 Termination of Unused Pins Recommended pin termination RESET_N open P14/TEST0 open TEST1_N open Connect to V P00 to P05* Connect V or V Connect V...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 2 CPU and Memory Space CPU and Memory Space 2.1 General Description This LSI includes 16-bit CPU nX-U16/100 and the memory model is SMALL model. For details of the CPU nX-U16/100, see “nX-U16/100 Core Instruction Manual”. 2.2 Program Memory Space The program memory space is used to store program codes, table data (ROM window), or vector tables.
Page 37
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 2 CPU and Memory Space Segment 0 CSR:PC 0:0000H ~ 0BFFFH 0:0BFFFH Test data area 0:0BC00H 0:0BBFFH Program code ROM window area 0:0100H 0:00FFH Vector table area Program code ROM window area 0:0000H 8bit Figure 2-2 Configuration of ML620Q152A/ML620Q155A/ML620Q158A Program Memory Space (48-Kbyte) Note: ・...
Page 38
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 2 CPU and Memory Space Segment 0 CSR:PC 0:0000H ~ 0FFFFH 0:0FFFFH Test data area 0:0FC00H 0:0FBFFH Program code ROM window area 0:0100H 0:00FFH Vector table area Program code ROM window area 0:0000H 8bit Figure 2-3 Configuration of ML620Q153A/ML620Q156A/ML620Q159A Program Memory Space (64-Kbyte) Note: ・...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 2 CPU and Memory Space 2.3 Data Memory Space The data memory space of this LSI consists of the ROM window area of Segment 0, 2KByte RAM area, SFR area, and ROM reference area of segment 8. The data memory has the 8-bit length and is specified by a 4-bit Data Segment Register (DSR) and 16-bit addressing instructions.
Page 40
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 2 CPU and Memory Space DSR: Data address Segment 0 Segment 7 0:0FFFFH SFR are 0:0F000H Unused area 0:0E7FFH RAM area 2K Byte 0:0E000H Unused area 0:0DFFFH Unused area 0:0C000H 0:0BFFFH Test data area 0:0BC00H 7:07FFH ROM Window Data Flash area area...
Page 41
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 2 CPU and Memory Space DSR: Data address Segment 0 Segment 7 0:0FFFFH SFR area 0:0F000H Unused area 0:0E7FFH RAM area 2K Byte Unused area 0:0E000H ROM Window area 7:07FFH Data Flash area 2K Byte 0:0000H 7:0000H 8bit 8bit...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 2 CPU and Memory Space 2.4 Instruction Length The length of an instruction is 16 bits. 2.5 Data Type The data types supported include byte (8 bits) and word (16 bits). FEUL620Q150A...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 2 CPU and Memory Space 2.6 Description of Registers 2.6.1 List of Registers Address Name Symbol (Byte) Symbol (Word) Size Initial value 0F000H Data segment register — FEUL620Q150A...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 2 CPU and Memory Space 2.6.2 Data Segment Register (DSR) Address: 0F000H Access: R/W Access size: 8-bit Initial value: 00H — — — — DSR3 DSR2 DSR1 DSR0 Initial value DSR is a special function register (SFR) to retain a data segment. For details of DSR, see “nX-U16/100 Core Instruction Manual”.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 3 Reset Function Reset Function 3.1 General Description This LSI has the five reset functions. If any of the four reset conditions is satisfied, this LSI enters system reset mode. • Reset by the RESET_N pin •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 3 Reset Function 3.2.2 Reset Status Register (RSTAT) Address: 0F00CH Access: R/W Access size: 8 bits Initial value: Undefined ― ― ― ― RSTAT RSTR LLDR WDTR Initial value *)The initial value depends on the reset factor RSTAT is a special function register (SFR) that indicates the causes set to the system reset mode.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 3 Reset Function 3.3 Description of Operation 3.3.1 Operation of System Reset Mode System reset has the highest priority among all processings and any other processing will be cancelled. The system reset mode is set by any of the following causes. •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 4 MCU Control Function MCU Control Function 4.1 General Description The operating states of this LSI are classified into the following 4 modes including system reset mode: (1) System reset mode (2) Program run mode (3) HALT mode (4) STOP mode For the System reset mode, see Chapter 3, "Reset Function".
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 4 MCU Control Function 4.2 Description of Registers 4.2.1 List of Registers Initial Address Name Symbol (Byte) Symbol (Word) Size value 0F008H Stop code acceptor STPACP 0F009H Standby control register SBYCON 0F068H Block control register 0 BLKCON0 0F06AH Block control register 2...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 4 MCU Control Function 4.2.2 Stop Code Acceptor (STPACP) Address: 0F008H Access: W Access size: 8 bits Initial value: -(Undefined) STPACP Initial value STPACP is a write-only special function register (SFR) that is used for setting a STOP mode. When STPACP is read, “00H”...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 4 MCU Control Function 4.2.3 Standby Control Register (SBYCON) Address: 0F009H Access: W Access size: 8 bits Initial value: 00H SBYCON HLTH DHLT Initial value SBYCON is a special function register (SFR) to control the operation mode of MCU. Description of Bits •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 4 MCU Control Function 4.2.4 Block Control Register 0 (BLKCON0) Address: 0F068H Access: R/W Access size: 8 bit Initial value: 00H BLKCON0 DTM1 DTM0 Initial value BLKCON0 is a special function register (SFR) to control each block operation. Description of Bits •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 4 MCU Control Function 4.2.5 Block Control Register 2 (BLKCON2) Address: 0F06AH Access: R/W Access size: 8 bit Initial value: 00H BLKCON2 DI2C0 DUA1 DUA0 DSIO0 Initial value BLKCON2 is a special function register (SFR) to control each block operation. Description of Bits •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 4 MCU Control Function 4.2.6 Block Control Register 3 (BLKCON3) Address: 0F06BH(BLKCON3) Access: R/W Access size: 8 bit Initial value: 00H BLKCON3 DCMP Initial value BLKCON3 is a special function register (SFR) to control each block operation. Description of Bits •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 4 MCU Control Function 4.2.7 Block Control Register 4 (BLKCON4) Address: 0F06CH(BLKCON4) Access: R/W Access size: 8 bit Initial value: 00H BLKCON4 DSAD Initial value BLKCON4 is a special function register (SFR) to control each block operation. Description of Bits •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 4 MCU Control Function 4.2.8 Block Control Register 6 (BLKCON6) Address: 0F06EH(BLKCON6) Access: R/W Access size: 8 bit Initial value: 00H BLKCON6 DTMB DTMA DTM9 DTM8 Initial value BLKCON6 is a special function register (SFR) to control each block operation. Description of Bits •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 4 MCU Control Function 4.2.9 Block Control Register 7 (BLKCON7) Address: 0F06FH(BLKCON7) Access: R/W Access size: 8 bit Initial value: 00H BLKCON7 DPW7 DPW6 DPW5 DPW4 Initial value BLKCON7 is a special function register (SFR) to control each block operation. Description of Bits •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 4 MCU Control Function 4.3 Description of Operation 4.3.1 Program Operating Mode The program run mode is the state where the CPU executes instructions sequentially. At power-on reset, low-speed oscillation stop detect reset, WDT overflow reset, or RESET_N pin reset, the CPU executes instructions from the addresses that are set in addresses 0002H and 0003H of program memory (ROM) after the system reset mode is released.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 4 MCU Control Function 4.3.3 STOP Mode During the STOP mode, the low-speed oscillation and high-speed oscillation stop and the CPU and peripheral circuits stop the operation. When the stop code acceptor is enabled by successively writing “5nH” and “0AnH” (where n is 0 to 0FH) to the stop code acceptor (STPACP) and the STP bit of the standby control register (SBYCON) is set to “1”, the STOP mode is entered.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 4 MCU Control Function 4.3.3.2 Stop mode when the CPU runs with high-speed clock When the STP bit of SBYCON is set to “1” with the stop code acceptor enabled while the high-speed clock is operating, the mode changes to the STOP mode and the high-speed oscillation and low-speed oscillation stop.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 4 MCU Control Function 4.3.3.3 Note on Return Operation from STOP/HALT Mode The operation of returning from the STOP or HALT mode depends on the condition of interrupt level (ELEVEL) of the program status word (PSW), master interrupt enable flag (MIE), the contents of the interrupt enable register (IE0 to IE3), and whether the interrupt is a non-maskable interrupt or a maskable interrupt.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 4 MCU Control Function 4.3.4 Block Control Function This LSI has a block control function, which resets and completely turns operating circuits of unused peripherals off to make even more reducing current consumption. For each block control register, the initial value of each flag is “0”, meaning the operation of each block is enabled. When any flag is set to “1”...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5 Interrupt 5.1 General Description This LSI has external interrupts, internal interrupts, and a software interrupt (SWI). For details of each interrupt, see the following chapters: Chapter 7, "Time Base Counter" Chapter 8, "8-bit Timer" Chapter 9, "16-bit Timer"...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.2 Interrupt Enable Register 0 (IE0) Address: 0F010H Access: R/W Access size: 8 bits Initial value: 00H ELLD Initial value IE0 is a special function register (SFR) used to control enable/disable for each interrupt request. When an interrupt is accepted, the master interrupt enable flag (MIE) is set to "0", but the corresponding flag of IE0 is not reset.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.3 Interrupt Enable Register 1 (IE1) Address: 0F011H Access: R/W Access size: 8 bits Initial value: 00H EP31 EP30 EP05 EP04 EP03 EP02 EP01 EP00 Initial value IE1 is a special function register (SFR) used to control enable/disable for each interrupt request. When an interrupt is accepted, the master interrupt enable flag (MIE) is set to "0", but the corresponding flag of IE1 is not reset.
Page 70
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts • EP02 (bit 2) EP02 is the enable flag for the input port P02 pin interrupt (P02INT). EP02 Description Disabled (initial value) Enabled • EP01 (bit 1) EP01 is the enable flag for the input port P01 pin interrupt (P01INT). EP01 Description Disabled (initial value)
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.4 Interrupt Enable Register 2 (IE2) Address: 0F012H Access: R/W Access size: 8 bits Initial value: 00H EI2C0 ESAD ESIO0 Initial value IE2 is a special function register (SFR) used to control enable/disable for each interrupt request. When an interrupt is accepted, the master interrupt enable flag (MIE) is set to "0", but the corresponding flag of IE2 is not reset.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.5 Interrupt Enable Register 3 (IE3) Address: 0F013H Access: R/W Access size: 8 bits Initial value: 00H ECMP0 ETM9 ETM8 ETM1 ETM0 Initial value IE3 is a special function register (SFR) used to control enable/disable for each interrupt request. When an interrupt is accepted, the master interrupt enable flag (MIE) is set to "0", but the corresponding flag of IE3 is not reset.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.6 Interrupt Enable Register 4 (IE4) Address: 0F014H Access: R/W Access size: 8 bits Initial value: 00H EUA1 EUA0 Initial value IE4 is a special function register (SFR) used to control enable/disable for each interrupt request. When an interrupt is accepted, the master interrupt enable flag (MIE) is set to "0", but the corresponding flag of IE4 is not reset.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.7 Interrupt Enable Register 5 (IE5) Address: 0F015H Access: R/W Access size: 8 bits Initial value: 00H ETMB ETMA Initial value IE5 is a special function register (SFR) used to control enable/disable for each interrupt request. When an interrupt is accepted, the master interrupt enable flag (MIE) is set to "0", but the corresponding flag of IE5 is not reset.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.8 Interrupt Enable Register 6 (IE6) Address: 0F016H Access: R/W Access size: 8 bits Initial value: 00H ELTBC1 ELTBC0 EPW7 EPW6 EPW5 EPW4 Initial value IE6 is a special function register (SFR) used to control enable/disable for each interrupt request. When an interrupt is accepted, the master interrupt enable flag (MIE) is set to "0", but the corresponding flag of IE6 is not reset.
Page 76
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts • EPW5 (bit 1) EPW5 is the enable flag for the PWM5 interrupt (PW5INT). EPW5 Description Disabled (initial value) Enabled • EPW4 (bit 0) EPW4 is the enable flag for the PWM4 interrupt (PW4INT). EPW4 Description Disabled (initial value)
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.9 Interrupt Enable Register 7 (IE7) Address: 0F017H Access: R/W Access size: 8 bits Initial value: 00H ELTBC2 Initial value IE7 is a special function register (SFR) used to control enable/disable for each interrupt request. When an interrupt is accepted, the master interrupt enable flag (MIE) is set to "0", but the corresponding flag of IE7 is not reset.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.10 Interrupt Request Register 0 (IRQ0) Address: 0F018H Access: R/W Access size: 8 bits Initial value: 00H IRQ0 QLLD QCKC QWDT Initial value IRQ0 is a special function register (SFR) used to request an interrupt for each interrupt source. The watchdog timer interrupt (WDTINT) and the clock backup interrupt (CKCINT) are non-maskable interrupts that do not depend on MIE.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.11 Interrupt Request Register 1 (IRQ1) Address: 0F019H Access: R/W Access size: 8 bits Initial value: 00H IRQ1 QP31 QP30 QP05 QP04 QP03 QP02 QP01 QP00 Initial value IRQ1 is a special function register (SFR) used to request an interrupt for each interrupt source. Each IRQ1 request flag is set to "1"...
Page 80
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts • QP02 (bit 2) QP02 is the request flag for the input port P02 pin interrupt (P02INT). QP02 Description No request (initial value) Request • QP01 (bit 1) QP01 is the request flag for the input port P01 pin interrupt (P01INT). QP01 Description No request (initial value)
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.12 Interrupt Request Register 2 (IRQ2) Address: 0F01AH Access: R/W Access size: 8 bits Initial value: 00H IRQ2 QI2C0 QSAD QSIO0 Initial value IRQ2 is a special function register (SFR) used to request an interrupt for each interrupt source. Each IRQ2 request flag is set to "1"...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.13 Interrupt Request Register 3 (IRQ3) Address: 0F01BH Access: R/W Access size: 8 bits Initial value: 00H IRQ3 QCMP0 QTM9 QTM8 QTM1 QTM0 Initial value IRQ3 is a special function register (SFR) used to request an interrupt for each interrupt source. Each IRQ3 request flag is set to "1"...
Page 83
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts [Note] When an interrupt is generated by the write instruction to the interrupt request register (IRQ3) or to the interrupt enable register (IE3), the interrupt shift cycle starts after the next 1 instruction is executed. FEUL620Q150A 5-18...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.14 Interrupt Request Register 4 (IRQ4) Address: 0F01CH Access: R/W Access size: 8 bits Initial value: 00H IRQ4 QUA1 QUA0 Initial value IRQ4 is a special function register (SFR) used to request an interrupt for each interrupt source. Each IRQ4 request flag is set to "1"...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.15 Interrupt Request Register 5 (IRQ5) Address: 0F01DH Access: R/W Access size: 8 bits Initial value: 00H IRQ5 QTMB QTMA Initial value IRQ5 is a special function register (SFR) used to request an interrupt for each interrupt source. Each IRQ5 request flag is set to "1"...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.16 Interrupt Request Register 6 (IRQ6) Address: 0F01EH Access: R/W Access size: 8 bits Initial value: 00H IRQ6 QLTBC1 QLTBC0 QPW7 QPW6 QPW5 QPW4 Initial value IRQ6 is a special function register (SFR) used to request an interrupt for each interrupt source. Each IRQ6 request flag is set to "1"...
Page 87
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts [Note] When an interrupt is generated by the write instruction to the interrupt request register (IRQ6) or to the interrupt enable register (IE6), the interrupt shift cycle starts after the next 1 instruction is executed. FEUL620Q150A 5-22...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.17 Interrupt Request Register 7 (IRQ7) Address: 0F01FH Access: R/W Access size: 8 bits Initial value: 00H IRQ7 QLTBC2 Initial value IRQ7 is a special function register (SFR) used to request an interrupt for each interrupt source. Each IRQ7 request flag is set to "1"...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.18 Interrupt Level Control Enable Register (ILENL) Address: 0F020H Access: R/W Access size: 8 bits Initial value: 00H ― ― ― ― ― ― ― ILENL Initial value The interrupt level control enable register (ILENL) is a special function register (SFR) used to control enable/disable for the interrupt level control.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.19 Current Interrupt Request Level Register (CILL) Address: 0F022H Access: R/W Access size: 8 bits Initial value: 00H ― ― ― CILL CILN CILM[3:0] Initial value The current interrupt request level register (CILL) indicates the interrupt level of the interrupt currently being processed by the processor.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.20 Interrupt Level Control Register 01 (ILC01) Address: 0F025H Access: R/W Access size: 8 bits Initial value: 00H ILC01 ILC01[5:4] Initial value The interrupt level control register 01 (ILC01) sets the interrupt level for the specific maskable interrupt source. Access to this register is possible only when the interrupt level control is enabled by the ILENL register.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.21 Interrupt Level Control Register 10 (ILC10) Address: 0F026H Access: R/W Access size: 8 bits Initial value: 00H ILC10 ILC10[7:6] ILC10[5:4] ILC10[3:2] ILC10[1:0] Initial value The interrupt level control register 10 (ILC10) sets the interrupt level for the specific maskable interrupt source. Access to this register is possible only when the interrupt level control is enabled by the ILENL register.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.22 Interrupt Level Control Register 11 (ILC11) Address: 0F027H Access: R/W Access size: 8 bits Initial value: 00H ILC11 ILC11[7:6] ILC11[5:4] ILC11[3:2] ILC11[1:0] Initial value The interrupt level control register 11 (ILC11) sets the interrupt level for the specific maskable interrupt source. Access to this register is possible only when the interrupt level control is enabled by the ILENL register.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.23 Interrupt Level Control Register 20 (ILC20) Address: 0F028H Access: R/W Access size: 8 bits Initial value: 00H ILC20 ILC20[5:4] ILC20[1:0] Initial value The interrupt level control register 20 (ILC20) sets the interrupt level for the specific maskable interrupt source. Access to this register is possible only when the interrupt level control is enabled by the ILENL register.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.24 Interrupt Level Control Register 21 (ILC21) Address: 0F029H Access: R/W Access size: 8 bits Initial value: 00H ILC21 ILC21[7:6] Initial value The interrupt level control register 21 (ILC21) sets the interrupt level for the specific maskable interrupt source. Access to this register is possible only when the interrupt level control is enabled by the ILENL register.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.25 Interrupt Level Control Register 30 (ILC30) Address: 0F02AH Access: R/W Access size: 8 bits Initial value: 00H ILC30 ILC30[7:6] ILC30[5:4] ILC30[3:2] ILC30[1:0] Initial value The interrupt level control register 30 (ILC05) sets the interrupt level for the specific maskable interrupt source. Access to this register is possible only when the interrupt level control is enabled by the ILENL register.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.26 Interrupt Level Control Register 31 (ILC31) Address: 0F02BH Access: R/W Access size: 8 bits Initial value: 00H ILC31 ILC31[5:4] Initial value The interrupt level control register 31 (ILC31) sets the interrupt level for the specific maskable interrupt source. Access to this register is possible only when the interrupt level control is enabled by the ILENL register.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.27 Interrupt Level Control Register 40 (ILC40) Address: 0F02CH Access: R/W Access size: 8 bits Initial value: 00H ILC40 ILC40[3:2] ILC40[1:0] Initial value The interrupt level control register 40 (ILC40) sets the interrupt level for the specific maskable interrupt source. Access to this register is possible only when the interrupt level control is enabled by the ILENL register.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.28 Interrupt Level Control Register 51 (ILC51) Address: 0F02FH Access: R/W Access size: 8 bits Initial value: 00H ILC51 ILC51[3:2] ILC51[1:0] Initial value The interrupt level control register 51 (ILC51) sets the interrupt level for the specific maskable interrupt source. Access to this register is possible only when the interrupt level control is enabled by the ILENL register.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.29 Interrupt Level Control Register 60 (ILC60) Address: 0F030H Access: R/W Access size: 8 bits Initial value: 00H ILC60 ILC60[7:6] ILC60[5:4] ILC60[3:2] ILC60[1:0] Initial value The interrupt level control register 60 (ILC60) sets the interrupt level for the specific maskable interrupt source. Access to this register is possible only when the interrupt level control is enabled by the ILENL register.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.30 Interrupt Level Control Register 61 (ILC61) Address: 0F031H Access: R/W Access size: 8 bits Initial value: 00H ILC61 ILC61[7:6] ILC61[3:2] Initial value The interrupt level control register 61 (ILC61) sets the interrupt level for the specific maskable interrupt source. Access to this register is possible only when the interrupt level control is enabled by the ILENL register.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.2.31 Interrupt Level Control Register 70 (ILC70) Address: 0F032H Access: R/W Access size: 8 bits Initial value: 00H ILC70 ILC70[7:6] Initial value The interrupt level control register 70 (ILC70) sets the interrupt level for the specific maskable interrupt source. Access to this register is possible only when the interrupt level control is enabled by the ILENL register.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.3 Description of Operation With the exceptions of the watchdog timer interrupt (WDTINT) and clock backup interrupt (CKCINT), interrupt enable/disable for 28 sources is controlled by the master interrupt enable flag (MIE) and the individual interrupt enable registers (IE1 to 7).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.3.1 Maskable Interrupt Processing When an interrupt is generated with the MIE flag set to "1", the following processing is executed by hardware and the processing of program shifts to the interrupt destination. (1) Transfer the program counter (PC) to ELR1 (2) Transfer PSW to EPSW1 (3) Set the MIE flag to "0"...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.3.4 Notes on Interrupt Routine (When Interrupt Level Control Disabled) If ILE of the interrupt level control enable register (ILENL) is set to disable the interrupt level control, notes are different in programming depending on whether a subroutine is called or not by the program in executing an interrupt routine, whether multiple interrupts are enabled or disabled, and whether such interrupts are maskable or non-maskable.
Page 106
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts A-2: When a subroutine is called by the program in executing an interrupt routine A-2-1: When multiple interrupts are disabled • Processing immediately after the start of interrupt routine execution Specify the "PUSH LR" instruction to save the subroutine return address in the stack. •...
Page 107
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts Status B: Non-maskable interrupt is being processed B-1: When a subroutine is not called • Processing immediately after the start of interrupt routine execution No specific notes. • Processing at the end of interrupt routine execution Specify the RTI instruction to return the contents of the ELR register to the PC and those of the EPSW register to PSW.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.3.5 Interrupt Processing When Interrupt Level Control Enabled Interrupt processing The interrupt handler carries out the following processing. i. The following processing is made when multiple interrupts are enabled. When a higher level interrupt request occurs, that request should be processed with priority. For this reason, the general-purpose registers are saved to memory and the EPW and EPSW registers are pushed in order to retain the processor state at return.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.3.6 Flow Chart When Interrupt Level Control Enabled The figure below shows the flow chart of the software processing of a maskable interrupt when the interrupt level control is enabled. The EI and DI instructions allow the execution of multiple interrupts by a higher-level maskable interrupt request during the "execution of the desired processing".
Page 110
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts Non-maskable interrupt Save general-purpose registers to memory Execute desired processing Write access to current interrupt level register (CILL) Restore general-purpose registers from memory RTI instruction Interrupt processing FEUL620Q150A 5-45...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts 5.3.7 How To Write Interrupt Processing When Interrupt Level Control Enabled When ILE of the interrupt level control enable register (ILENL) is set to enable the interrupt level control, the interrupt function should be written as below. For more details and notes on how to write the interrupt processing, refer to "CCU8 Programming Guide".
Page 112
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts push push func(); _func CILL = 0; #00h 0f022h When calling other functions from an interrupt function, the output code becomes more redundant, which results in a longer interrupt processing time. This is because CCU8 does not know which register is used by func and thus saves all possible registers that may be changed by calling the func function in the stack.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 5 Interrupts CILL = 0; #00h 0f022h psw, pc An interrupt function enabling multiple interrupts should save ELR and EPSW in the stack so that ELR and EPSW are not destroyed by multiple interrupts. This is different from the case for interrupt functions disabling multiple interrupts.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 6 Clock Generation Circuit 6 Clock Generation Circuit 6.1 General Description The clock generation circuit generates and provides the low-speed clock (LSCLK), the high-speed clock (HSCLK), the system clock (SYSCLK), and the high-speed output clock (OUTCLK). LSCLK and HSCLK are time base clocks for the peripheral circuits, SYSCLK is a basic operation clock of CPU, and OUTCLK is a clock that is output from a port.
Page 116
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 6 Clock Generation Circuit [Note] After power-on or system reset, the operation starts by the clock supplied from the built-in high-speed clock generation circuit with the frequency divided by 8. Change it as needed by setting the FCON0, FCON1 and FCON2 register. FEUL620Q150A...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 6 Clock Generation Circuit 6.1.3 List of Pins Pin Name Function P12/XT0 Pin for connecting a crystal for low-speed clock. P13/XT1 Pin for connecting a crystal for low-speed clock. 6.1.4 Clock Configuration Diagram Figure 6-2 shows the clock system diagram. System clock(SYSCLK) Register access LSCLK...
Page 118
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 6 Clock Generation Circuit 6.2 Description of Registers 6.2.1 List of Registers Address Name Symbol (Byte) Symbol (Word) Size Initial value 0F002H Frequency control register 0 FCON0 8/16 FCON01 0F003H Frequency control register 1 FCON1 0F005H Frequency control register 3 FCON3 0F00AH...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 6 Clock Generation Circuit 6.2.2 Frequency Control Register 0 (FCON0) Address: 0F002H (FCON0) Access: R/W Access size: 8/16 bit Initial value: 33H FCON0 OUTC1 OUTC0 OSCM1 OSCM0 SYSC1 SYSC0 Initial value FCON0 is a special function register (SFR) used to control the high-speed clock generation circuit and to select system clock.
Page 120
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 6 Clock Generation Circuit [Note] •To switch the high-speed clock mode using the OSCM1 and OSCM0 bits, stop the high-speed oscillation and set the system clock to the low-speed clock (set the ENOSC and SYSCLK bits of the FCON1 register to "0"). •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 6 Clock Generation Circuit 6.2.3 Frequency Control Register 1 (FCON1) Address: 0F003H (FCON1) Access: R/W Access size: 8 bit Initial value: 03H FCON1 LPLL ENOSC SYSCLK Initial value FCON01 is a special function register (SFR) used to control the high-speed clock generation circuit and to select system clock.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 6 Clock Generation Circuit 6.2.4 Frequency Control Register 3(FCON3) Address: 0F005H(FCON3) Access: R/W Access size: 8 bits Initial Value: 00H FCON3 LOSCB HOSCB Initial value FCON3 is a special function register (SFR) to control the high-speed clock generation circuit and to select system clock. FCON3 works only when the low-speed crystal oscillation circuit is selected by Code-Option.
Page 123
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 6 Clock Generation Circuit • HOSCB (bit 1) The HOSCB bit shows the high-speed clock backup mode, and it is used to cancel the backup mode by clearing the HOSCB bit(by writing “1” to the HOSCB bit). The HOSCB bit works only when the low-speed crystal oscillation circuit is selected by Code-Option and PLL oscillation is selected as the high-speed clock by FCON registers.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 6 Clock Generation Circuit 6.2.5 Frequency Status Register (FSTAT) Address: 0F00AH Access: R Access size: 8 bits Initial value: 06H FSTAT LOSCS HOSCS Initial value FSTAT is a special function register (SFR) used to show the clock generation circuit state. Description of Bits •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 6 Clock Generation Circuit 6.3 Description of Operation 6.3.1 Low-Speed Clock 6.3.1.1 Low-Speed Crystal Oscillation Circuit Figure 6-3 shows the low-speed clock generation circuit configuration. The low-speed clock generation circuit requires an external 32.768 kHz crystal to work. To match the oscillation frequency by using a trimmer capacitor, connect external capacitors (C and C ) as required.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 6 Clock Generation Circuit 6.3.1.3 Operation of Low-Speed Clock Generation Circuit The low-speed clock generation circuit is activated by the occurrence of power ON reset. After the power-on, it waits for the low-speed oscillation start time (T ) and the low-speed clock (LSCLK) oscillation stabilization time (8192 counts).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 6 Clock Generation Circuit 6.3.2 High-Speed Clock For the high-speed clock generation circuit, the built-in RC oscillation mode or the PLL (Phase Locked Loop) oscillation mode can be selected. 6.3.2.1 High-Speed Built-in RC Oscillation Circuit Figure 6-6 shows the block diagram of high-speed built-in RC oscillation circuit. When the RC oscillation clock is counted to 16, the high-speed oscillation clock (HSCLK) starts to be supplied.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 6 Clock Generation Circuit 6.3.2.3 Operation of High-Speed Clock The high-speed clock generation circuit is activated in the built-in RC oscillation mode (2.097MHz) by power-on reset generation. As a result of the occurrence of power-on reset, the circuit goes into system reset mode and then shifts to program operating mode after the elapse of the high-speed oscillation start time (T ) and the oscillation stabilization time (Count: 32,768) of the high-speed RC oscillation clock (OSCLK) and at the same time, a high-speed clock (HSCLK) is...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 6 Clock Generation Circuit 6.3.3 Switching of System Clock The system clock can be switched between high-speed clock (HSCLK) and low-speed clock (LSCLK) by using the frequency control registers (FCON0, FCON1). Figure 6-11 shows the flow chart of the system clock switching processing (HSCLK→LSCLK), and Figure 6-12 shows the flow chart of the system clock switching processing (LSCLK→HSCLK).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 6 Clock Generation Circuit 6.4 Specifying Port Registers To enable the clock output function, each related port register bit needs to be set. See Chapter 17, "Port 2" and Chapter 18, "Port 3" for detail about the port registers. 6.4.1 Functioning P21(OUTCLK) as the high-speed clock output Set P21MD bit (bit1 of P2MOD register) to “1”...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 6 Clock Generation Circuit 6.4.2 Functioning P20 (LSCLK) as the low-speed clock output Set P20MD bit (bit0 of P2MOD register) to “1” for specifying the low-speed clock output as the secondary function of P20. Register name P2MOD register (Address: 0F214H) P23MD P22MD...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 6 Clock Generation Circuit 6.4.3 Functioning P36 (LSCLK) as the low-speed clock output Set P36MD1 bit (bit6 of P3MOD1 register) to “0” and Set P36MD0 bit (bit6 of P3MOD0 register) to “1”for specifying the low-speed clock output as the secondary function of P36. Register name P3MOD1 register (Address: 0F21DH) Bit name...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 7 Time Base Counter Time Base Counter 7.1 General Description This LSI includes a low-speed time base counter (LTBC) that generate base clocks for peripheral circuits and periodical interrupts. For the input clock, see Chapter 6, “Clock Generation Circuit”. For interrupt permission, interrupt request flags, etc.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 7 Time Base Counter 7.2 Description of Registers 7.2.1 List of Registers Address Name Symbol (Byte) Symbol (Word) Size Initial value Low-speed time base counter ⎯ 0F060H LTBR register Low-speed time base counter 0F062H LTBADJL 8/16 frequency adjustment register 0 LTBADJ Low-speed time base counter...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 7 Time Base Counter 7.2.2 Low-Speed Time Base Counter (LTBR) Address: 0F060H Access: R/W Access size: 8 bits Initial value: 00H LTBR T1HZ T2HZ T4HZ T8HZ T16HZ T32HZ T64HZ T128HZ Initial value LTBR is a special function register (SFR) to read the T128HZ-T1HZ outputs of the low-speed time base counter. The T128HZ-T1HZ outputs are set to “0”...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 7 Time Base Counter 7.2.3 Low-Speed Time Base Counter Frequency Adjustment Registers (LTBADJ) Address: 0F062H(LTBADJL), 0F063H(LTBADJH) Access: R/W Access size: 8/16 bits Initial value: 0000H LTBADJL LADJ7 LADJ6 LADJ5 LADJ4 LADJ3 LADJ2 LADJ1 LADJ0 Initial value ⎯...
Page 139
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 7 Time Base Counter The adjustment values (LADJ10 to LADJ0) to be set in LTBADJH and LTBADJL can be obtained by using the following equations: Adjustment value = Frequency adjustment ratio × 2097152 (decimal) = Frequency adjustment ratio × 200000h (hexadecimal) Example 1: When adjusting +15.0ppm (gaining time) Adjustment value = +15.0ppm ×...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 7 Time Base Counter 7.3 Description of Operation 7.3.1 Low-Speed Time Base Counter The low-speed time base counter (LTBC) starts counting from 0000H on the LSCLK falling edge after system reset. The T128HZ, T64HZ, T32HZ, T16HZ, T8HZ, T4HZ, T2HZ, and T1HZ outputs of LTBC are used as time base interrupts and an interrupt is requested on the falling edge of each output.
Page 142
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 7 Time Base Counter Figure 7-4 shows interrupt generation timing and reset timing of the time base counter output by writing to LTBR. LTBR Write T256HZ T128HZ T64HZ T32HZ T16HZ T16HZ T8HZ T4HZ T2HZ T1HZ Indicates interrupt timing Figure 7-4 Interrupt Timing and Reset Timing by Writing to LTBR FEUL620Q150A...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 8 8bit Timer 8bit Timer 8.1 General Description This LSI includes two channels of 8-bit timers. For the input clock, see Chapter 6, “Clock Generation Circuit”. 8.1.1 Features • The timer interrupt (TMnINT, n=0 to 7) is generated when the values of timer counter register (TMnC) and timer data register (TMnD) coincide.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 8 8bit Timer 8.2.2 Timer n Data Register (TM0D) Address: 0F300H Access: R/W Access size: 8 bits Initial value: 0FFH TM0D T0D7 T0D6 T0D5 T0D4 T0D3 T0D2 T0D1 T0D0 Initial value TM0D is a special function register (SFR) to set the value to be compared with the timer n counter register (TM0C) value. [Note] Set TM0D when the timer stops(when T0STAT bit of TMSTAT0 register is “0”).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 8 8bit Timer 8.2.3 Timer n Data Register (TM1D) Address: 0F300H Access: R/W Access size: 8 bits Initial value: 0FFH TM1D T1D7 T1D6 T1D5 T1D4 T1D3 T1D2 T1D1 T1D0 Initial value TM1D is a special function register (SFR) to set the value to be compared with the timer n counter register (TM1C) value. [Note] Set TM1D when the timer stops(when T1STAT bit of TMSTAT0 register is “0”).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 8 8bit Timer 8.2.4 Timer 0 Counter Register (TM0C) Address: 0F308H Access: R/W Access size: 8 bits Initial value: 00H TM0C T0C7 T0C6 T0C5 T0C4 T0C3 T0C2 T0C1 T0C0 Initial value TM0C is a special function register (SFR) that functions as an 8-bit binary counter. When write operation to TM0C is performed, TM0C is set to “00H”.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 8 8bit Timer 8.2.5 Timer 1 Counter Register (TM1C) Address: 0F309H Access: R/W Access size: 8 bits Initial value: 00H TM1C T1C7 T1C6 T1C5 T1C4 T1C3 T1C2 T1C1 T1C0 Initial value TM1C is a special function register (SFR) that functions as an 8-bit binary counter. When write operation to TM1C is performed, TM0C is set to “00H”.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 8 8bit Timer 8.2.6 Timer 0 Control Register Address: 0F320H Access: R/W Access size: 8 bits Initial value: 00H ― ― TM0CON T0OST T01M16 T0DIV2 T0DIV1 T0DIV0 T0CS0 Initial value TM0CON is a special function register (SFR) to control timer 0. Write the TM0CON after clearing the TM0C when the timer stops(when the T0STAT bit of TMSTAT0 register is “0”).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 8 8bit Timer 8.2.7 Timer 1 Control Register Address: 0F321H Access: R/W Access size: 8 bits Initial value: 00H ― ― ― TM1CON T1OST T1DIV2 T1DIV1 T1DIV0 T10CS0 Initial value TM1CON is a special function register (SFR) to control timer 1. Write the TM1CON after clearing the TM1C when the timer stops(when the T1STAT bit of TMSTAT0 register is “0”).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 8 8bit Timer 8.2.8 Timer Start Register 0 (TMSTR0) Address: 0F330H Access: W Access size: 8 bits Initial value: 00H ― ― ― ― ― ― TMSTR0 T1RUN T0RUN Initial value TMSTR0 is a special function register (SFR) to control starting the count-up of timer 0 and timer 1. [Description of Bits] •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 8 8bit Timer 8.2.9 Timer Stop Register 0 (TMSTP0) Address: 0F332H Access: W Access size: 8 bits Initial value: 00H ― ― ― ― ― ― TMSTP0 T1STP T0STP Initial value TMSTP0 is a special function register (SFR) to control stopping the count-up of timer 0 and timer 1. [Description of Bits] •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 8 8bit Timer 8.2.10 Timer Status Register 0 (TMSTAT0) Address: 0F334H Access: R Access size: 8 bits Initial value: 00H ― ― ― ― ― ― TMSTAT0 T1STAT T0STAT Initial value TMSTAT0 is a special function register (SFR) that shows the status of timer 0 and timer 1. [Description of Bits] •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 8 8bit Timer 8.3 Description of operation The timer counters(TMnC) starts the falling edge of the timer clock(TnCK) that are selected by the Timer control register(TMnCON) when the TnRUN bit of timer n register0(TMSTR0) are set to 1. When the count value of TMnC and the timer data register (TMnD) coincide, timer interrupt (TMnINT) occurs on the next timer clock falling edge, TMnC are reset to “00H”...
Page 156
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 8 8bit Timer Figure 8-3 shows the one-shot timer mode operation timing diagram TnCK TnRUN TnSTP TnSTAT Write TMnC TMnC TMnD TMnINT (n=0〜1) Figure 8-3 One-Shot Timer Mode Operation Timing Diagram [Note] TnSTAT bit is automatically cleared when the data of TMnC and TMnD matches. FEUL620Q150A 8-13...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 9 16bit Timer 9 16bit Timer 9.1 General Description This LSI includes four channels of 16-bit timers. For the input clock, see Chapter 6, “Clock Generation Circuit”. 9.1.1 Features • The timer interrupt (TMnINT, n=0 to 7) is generated when the values of timer counter register (TMHnCH,TMHnCL n=8,9,A,B) and timer data register (TMHnDH,TMHnDL) coincide.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 9 16bit Timer 9.2 Description of Registers 9.2.1 List of Registers Address Name Symbol (Byte) Symbol (Word) Size Initial value 0F340H 16bit timer 8 data register L TMH8DL 0FFH TMH8D 0F341H 16bit timer 8 data register H TMH8DH 8/16 0FFH...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 9 16bit Timer 9.2.10 16bit timer 8 control register (TMH8CON) Address: 0F360H Access: R/W Access size: 8 bits Initial value: 00H - - TMH8CON TH8OST TH8DIV2 TH8DIV1 TH8DIV0 TH8CS1 TH8CS0 Initial value TMH8CON is a special function (SFR) to control the 16bit timer 8. Write the TMH8CON after clearing the TMH8CON when the timer stops(when the TH8STAT bit of TMHSTAT0 register is “0”).
Page 169
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 9 16bit Timer 9.2.11 16bit timer 9 control register (TMH9CON) Address: 0F362H Access: R/W Access size: 8 bits Initial value: 00H - - TMH9CON TH9OST TH9DIV2 TH9DIV1 TH9DIV0 TH9CS1 TH9CS0 Initial value TMH9CON is a special function (SFR) to control the 16bit timer 9. Write the TMH9CON after clearing the TMH9CON when the timer stops(when the TH9STAT bit of TMHSTAT0 register is “0”).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 9 16bit Timer 9.2.12 16bit timer A control register (TMHACON) Address: 0F364H Access: R/W Access size: 8 bits Initial value: 00H - TMHACON THAOST THANEG THADIV2 THADIV1 THADIV0 THACS1 THACS0 Initial value TMHACON is a special function (SFR) to control the 16bit timer A. Write the TMHACON after clearing the TMHACON when the timer stops(when the THASTAT bit of TMHSTAT0 register is “0”).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 9 16bit Timer 9.2.13 16bit timer B control register (TMHBCON) Address: 0F366H Access: R/W Access size: 8 bits Initial value: 00H - TMHBCON THBOST THBNEG THBDIV2 THBDIV1 THBDIV0 THBCS1 THBCS0 Initial value TMHBCON is a special function (SFR) to control the 16bit timer B. Write the TMHBCON after clearing the TMHBCON when the timer stops(when the THBSTAT bit of TMHSTAT0 register is “0”).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 9 16bit Timer 9.2.14 16bit timer start register 0 (TMHSTR0) Address: 0F370H Access: R/W Access size: 8 bits Initial value: 00H - - - - TMHSTR0 THBRUN THARUN TH9RUN TH8RUN Initial value TMHSTR0 is a special function (SFR) to control starting count of 16bit timer 8, 9, A and B. [Description of Bits] •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 9 16bit Timer 9.2.15 16bit timer stop register 0 (TMHSTP0) Address: 0F372H Access: R/W Access size: 8 bits Initial value: 00H - - - - TMHSTP0 THBSTP THASTP TH9STP TH8STP Initial value TMHSTR0 is a special function (SFR) to control stopping count of 16bit timer 8, 9, A and B. [Description of Bits] •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 9 16bit Timer 9.2.16 16bit timer status register 0 (TMHSTAT0) Address: 0F374H Access: R/W Access size: 8 bits Initial value: 00H - - - - TMHSTAT0 THBSTAT THASTAT TH9STAT TH8STAT Initial value TMHSTAT0 is a special function (SFR) that shows status of 16bit timer 8, 9, A and B. [Description of Bits] •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 9 16bit Timer 9.3 Description of operation The timer counters(TMHnC) starts the falling edge of the timer clock(THnCK) that are selected by the Timer control register(TMHnCON) when the THnRUN bit of timer n register0(TMHSTR0) are set to 1. When the count value of TMHnC and the timer data register (TMHnD) coincide, timer interrupt (TMHnINT) occurs on the next timer clock falling edge, TMHnC are reset to “0000H”...
Page 176
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 9 16bit Timer THnCK THnRUN THnSTP THnSTAT Write TMHnC TMMnCH,L XXXX 0000 0001 0002 0087 0088 0000 0001 TMHnDH,L 0088 TMHnINT (n=8,9,A,B) TMHmOUT (m=A,B) Reverse by starting Stopping the timer returns the logic of output the timer signal to the initial value.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 10 Watchdog Timer 10 Watchdog Timer 10.1 General Description This LSI incorporates a watchdog timer (WDT) that operates at a system reset unconditionally (free-run operation) in order to detect an undefined state of the MCU and return from that state. If the WDT counter overflows due to the failure of clearing of the WDT counter within the WDT overflow period, the watchdog timer requests a WDT interrupt (non-maskable interrupt).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 10 Watchdog Timer 10.2 Description of Registers 10.2.1 List of Registers Address Name Symbol (Byte) Symbol (Word) Size Initial value ⎯ Watchdog timer control register 0F00EH WDTCON ⎯ 0F00FH Watchdog timer mode register WDTMOD FEUL620Q150A 10-2...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 10 Watchdog Timer 10.2.2 Watchdog Timer Control Register (WDTCON) Address: 0F00EH Access: R/W Access size: 8 bits Initial value: 00H WDTCON WDP/d0 Initial value WDTCON is a special function register (SFR) to control the WDT counter. When WDTCON is read, the value of the internal pointer (WDP) is read from bit 0.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 10 Watchdog Timer 10.2.3 Watchdog Timer Mode Register (WDTMOD) Address: 0F00FH Access: R/W Access size: 8 bits Initial value: 02H ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ WDTMOD WDT1 WDT0 Initial value WDTMOD is a special function register to set the overflow period of the watchdog timer. [Description of Bits] •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 10 Watchdog Timer 10.3 Description of operation The WDT counter starts counting after the system reset has been released and the low-speed clock oscillation start. Write "5AH" when the internal pointer (WDP) is "0"and then the WDT counter is cleared by writing "0A5H" when WDP is "1".
Page 183
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 10 Watchdog Timer Figure 10-2 shows an example of watchdog timer operation. Program Low-Speed Occurrence of Clock Start abnormality Oscillation RESET_S WDTMOD WDTMOD Setting Setting System reset Data: WDTCON Write WDTP Internal pointer Overflow WDT counter Occurrence of WDTINT WDTINT Occurrence of WDT reset...
Page 184
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 10 Watchdog Timer 10.3.1 Handling example when not using the watch dog timer WDT counter is a free-run counter that starts count-up automatically after the system reset released and the low-speed clock (LSCLK) starts oscillating. If the WDT counter gets overflow, the WDT non-maskable interrupt occurs and then a system reset occurs.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11 PWM 11.1 General Description This LSI includes four channels of 16-bit PWM (Pulse Width Modulation). The PWM4 output (PWM4) is assigned to P20(Port 2), P34(Port 3), P43(Port 4), P64(Port 6) and P87(Port 8) as the tertiary function.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.1.3 List of Pins Pin name Function P44/T0P4CK Used for an external clock input for PWM4. P45/T1P5CK Used for an external clock input for PWM5. P46/ T16CK0 Used for an external clock input for PWM6. P47/ T16CK1 Used for an external clock input for PWM7.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.2 Description of Registers 11.2.1 List of Registers Address Name Symbol (Byte) Size Initial Symbol (Word) value 0F4A0H PWM4 period register L PW4PL 8/16 0FFH PW4P 0F4A1H PWM4 period register H PW4PH 0FFH 0F4A2H PWM4 duty register L PW4DL 8/16...
Page 193
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 0F4D5H PWM7 counter register H PW7CH 0F4D6H PWM7 control register 0 PW7CON0 8/16 PW7CON0W 0F4D7H PWM7 control register 1 PW7CON1 - 0F4D8H PWM7 control register 2 PW7CON2 0F4DAH PWM7 control register 3 PW7CON4 8/16 PW7CON4W 0F4DBH PWM7 control register 4...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.2.5 PWM4 control register 0 (PW4CON0) Address: 0F4A6H Access: R/W Access size: 8/16 bits Initial value: 00H PW4CON0 P4CLIG P4STPSEL P4INI P4NEG P4IS1 P4IS0 P4CS1 P4CS0 Initial value PW4CON0 is a special function register (SFR) to control the PWM4. [Description of Bits] •...
Page 198
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM • P4CS1, P4CS0 (bits 1, 0) The P4CS1 and P4CS0 bits are used to select the PWM4 operation clocks. LSCLK, OSCLK, or the external clock (P44/T0P4CK) can be selected. When the OSCLK is selected for the PWM4 clock, external triggers (external input start or clear) are sampled by the OSCLK.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.2.7 PWM4 control register 2 (PW4CON2) Address: 0F4A8H Access: R/W Access size: 8/16 bits Initial value: 00H - PW4CON2 P45MD P4MD P4TGSEL P4STM1 P4STM0 P4TGE1 P4TGE0 Initial value PW4CON2 is a special function register (SFR) to control PWM4. [Description of Bits] •...
Page 201
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM • P4TGE1、P4TGE0 (bit 1, bit 0) P4TGE1 and P4TGE0 are used to select the trigger edge of PWM4 external input control. In the coupled mode (P45MD=1), this setting is also applied to the PWM5. P4TGE1 P4TGE0 Description...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.2.15 PWM5 control register 0 (PW5CON0) Address: 0F4B6H Access: R/W Access size: 8/16 bits Initial value: 00H PW5CON0 P5CLIG P5STPSEL P5INI P5NEG P5IS1 P5IS0 P5CS1 P5CS0 Initial value PW5CON0 is a special function register (SFR) to control the PWM5. [Description of Bits] •...
Page 210
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM • P5CS1, P5CS0 (bits 1, 0) The P5CS1 and P5CS0 bits are used to select the PWM5 operation clocks. LSCLK, OSCLK, or the external clock (P45/T1P5CK) can be selected. When the OSCLK is selected for the PWM5 clock, external triggers (external input start or clear) are sampled by the OSCLK.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.2.17 PWM5 control register 2 (PW5CON2) Address: 0F4B8H Access: R/W Access size: 8/16 bits Initial value: 00H - - PW5CON2 P5MD P5TGSEL P5STM1 P5STM0 P5TGE1 P5TGE0 Initial value PW5CON2 is a special function register (SFR) to control PWM5. [Description of Bits] •...
Page 213
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM • P5TGE1、P5TGE0 (bit 1, bit 0) P5TGE1 and P5TGE0 are used to select the trigger edge of PWM5 external input control. In the coupled mode (P45MD=1), this bit is ignored. P5TGE1 P5TGE0 Description During the external input start mode During the external input clear mode (P5STM1,P5STM0 = ”01”...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.2.24 PWM6 control register 0 (PW6CON0) Address: 0F4C6H Access: R/W Access size: 8/16 bits Initial value: 00H PW6CON0 P6CLIG P6STPSEL P6INI P6NEG P6IS1 P6IS0 P6CS1 P6CS0 Initial value PW6CON0 is a special function register (SFR) to control the PWM6. [Description of Bits] •...
Page 221
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM • P6CS1, P6CS0 (bits 1, 0) The P6CS1 and P6CS0 bits are used to select the PWM6 operation clocks. LSCLK, OSCLK, or the external clock (P46/T16CK0) can be selected. When the OSCLK is selected for the PWM6 clock, external triggers (external input start or clear) are sampled by the OSCLK.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.2.26 PWM6 control register 2 (PW6CON2) Address: 0F4C8H Access: R/W Access size: 8/16 bits Initial value: 00H - PW6CON2 P67MD P6MD P6TGSEL P6STM1 P6STM0 P6TGE1 P6TGE0 Initial value PW6CON2 is a special function register (SFR) to control PWM6. [Description of Bits] •...
Page 224
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM • P6TGE1、P6TGE0 (bit 1, bit 0) P6TGE1 and P6TGE0 are used to select the trigger edge of PWM6 external input control. In the coupled mode (P67MD=1), this setting is also applied to the PWM7. P6TGE1 P6TGE0 Description...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.2.34 PWM7 control register 0 (PW7CON0) Address: 0F4D6H Access: R/W Access size: 8/16 bits Initial value: 00H PW7CON0 P7CLIG P7STPSEL P7INI P7NEG P7IS1 P7IS0 P7CS1 P7CS0 Initial value PW7CON0 is a special function register (SFR) to control the PWM7. [Description of Bits] •...
Page 233
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM • P7CS1, P7CS0 (bits 1, 0) The P7CS1 and P7CS0 bits are used to select the PWM7 operation clocks. LSCLK, OSCLK, or the external clock (P47/T16CK1) can be selected. When the OSCLK is selected for the PWM7 clock, external triggers (external input start or clear) are sampled by the OSCLK.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.2.36 PWM7 control register 2 (PW7CON2) Address: 0F4D8H Access: R/W Access size: 8/16 bits Initial value: 00H - - PW7CON2 P7MD P7TGSEL P7STM1 P7STM0 P7TGE1 P7TGE0 Initial value PW7CON2 is a special function register (SFR) to control PWM7. [Description of Bits] •...
Page 236
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM • P7TGE1、P7TGE0 (bit 1, bit 0) P7TGE1 and P7TGE0 are used to select the trigger edge of PWM7 external input control. In the coupled mode (P67MD=1), this bit is ignored. P7TGE1 P7TGE0 Description During the external input start mode During the external input clear mode (P7STM1,P7STM0 = ”01”...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.3 Description of Operation The operation of PWM4 and PWM5 are categorized into six modes. For more details about each operation mode, see the section 11.3.1 to 11.3.6. P45MD P4DTMD PnMD Operation mode Description Repeat mode PWM4 and PWM5 repeats working independently.
Page 241
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM The Start/Stop/Clear controls of PWM4 and PWM5 are categorized into eleven modes. “P00 or P32/PW45EV0” and “P30 or P62/PW45EV1” are selectable for the external hardware control. For more details about each mode, see the section 11.3.7. PnSTM1 PnSTM0 PnTGE1...
Page 242
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM The operation of PWM6 and PWM7 are categorized into six modes. For more details about each operation mode, see the section 11.3.9 to 11.3.14. P67MD P7DTMD PnMD Operation mode Description Repeat mode PWM6 and PWM7 repeats working independently. in Single mode One shot mode PWM6 and PWM7 works in one shot (one period...
Page 243
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM The Start/Stop/Clear controls of PWM6 and PWM7 are categorized into eleven modes. “P01 or P33/PW67EV0” and “P31 or P63/PW67EV1” are selectable for the external hardware control. For more details about each mode, see the section 11.3.15. Operation mode Description PnSTM1...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.3.1 PWM4 and PWM5, Single mode / Repeat mode (P45MD=”0”, PnMD=”0”) The PWM counter registers (PWnCH, PWnCL) are set to an operating state (PnSTAT is set to “1”) on the first falling edge of the PWM clock (PnCK) that are selected by the PWMn control register 0 (PWnCON0) when the PnRUN bit of PWMn control register 1 (PWnCON1) is set to “1”...
Page 245
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM After the PnRUN bit is set to “1”, counting starts in synchronization with the PWM clock. This causes an error of up to 1 clock pulse to the time the first PWM interrupt is issued. The PWM interrupt period from the second time is fixed. Figure 11-3 shows the operation timing of PWMn on the condition of single mode and repeat mode (P45MD=”0”, PnMD=”0”).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.3.2 PWM4 and PWM5, Single mode / One shot mode (P45MD=”0”, PnMD=”1”) The PWM counter registers (PWnCH, PWnCL) are set to an operating state (PnSTAT is set to “1”) on the first falling edge of the PWM clock (PnCK) that are selected by the PWMn control register 0 (PWnCON0) when the PnRUN bit of PWMn control register 1 (PWnCON1) is set to “1”...
Page 247
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM After the PnRUN bit is set to “1”, counting starts in synchronization with the PWM clock. This causes an error of up to 1 clock pulse to the time the first PWM interrupt is issued. Figure 11-4 shows the operation timing of PWMn on the condition of single mode and repeat mode (P45MD=”0”, PnMD=”1”).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.3.3 PWM4 and PWM5, Coupled mode (with no dead-time specified) / Repeat mode (P45MD=”1”, P4DTMD=”0”, P4MD=”0”) The PWM4 counter registers (PW4CH, PW4CL) are set to an operating state (P4STAT is set to “1”) on the first falling edge of the PWM clock (P4CK) that are selected by the PWM4 control register 0 (PW4CON0) and the PWM4 control register 6 (PW4CON6) when the P4RUN bit of PWM4 control register 1 (PW4CON1) is set to “1”...
Page 249
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM After the P4RUN bit is set to “1”, counting starts in synchronization with the PWM clock. This causes an error of up to 1 clock pulse to the time the first PWM interrupt is issued. The PWM interrupt period from the second time is fixed. Figure 11-5 shows the operation timing of PWM4 and PWM5 on the condition of coupled mode with no dead-time specified (P45MD=”1”, P4DTMD=”0”) and repeat mode (P4MD=”0”).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.3.4 PWM4 and PWM5, Coupled mode (with no dead-time specified) / One shot mode (P45MD=”1”, P4DTMD=”0”, P4MD=”1”) The PWM4 counter registers (PW4CH, PW4CL) are set to an operating state (P4STAT is set to “1”) on the first falling edge of the PWM clock (P4CK) that are selected by the PWM4 control register 0 (PW4CON0) and the PWM4 control register 6 (PW4CON6) when the P4RUN bit of PWM4 control register 1 (PW4CON1) is set to “1”...
Page 251
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM After the P4RUN bit is set to “1”, counting starts in synchronization with the PWM clock. This causes an error of up to 1 clock pulse to the time the first PWM interrupt is issued. The PWM interrupt period from the second time is fixed. Figure 11-6 shows the operation timing of PWM4 and PWM5 on the condition of coupled mode with no dead-time specified (P45MD=”1”, P4DTMD=”0”) and one shot mode (P4MD=”1”).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.3.5 PWM4 and PWM5, Coupled mode (with dead-time specified) / Repeat mode (P45MD=”1”, P4DTMD=”1”, P4MD=”0”) The PWM4 counter registers (PW4CH, PW4CL) are set to an operating state (P4STAT is set to “1”) on the first falling edge of the PWM clock (P4CK) that are selected by the PWM4 control register 0 (PW4CON0) and the PWM4 control register 6 (PW4CON6) when the P4RUN bit of PWM4 control register 1 (PW4CON1) is set to “1”...
Page 253
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM The period of the PWM4 signal (T ), the first half duration (T ) of the duty, the duration of the PWM5 dead-time ) and the delay2(T ), are expressed by the following equations. PWD2 PW4P + 1 P4CK (Hz)
Page 254
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM After the P4RUN bit is set to “1”, counting starts in synchronization with the PWM clock. This causes an error of up to 1 clock pulse to the time the first PWM interrupt is issued. The PWM interrupt period from the second time is fixed. Figure 11-7 shows the operation timing of PWM4 and PWM5 on the condition of coupled mode with dead-time specified (P45MD=”1”, P4DTMD=”1”) and repeat mode (P4MD=”0”).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.3.6 PWM4 and PWM5, Coupled mode (with dead-time specified) / One shot mode (P45MD=”1”, P4DTMD=”1”, P4MD=”1”) The PWM4 counter registers (PW4CH, PW4CL) are set to an operating state (P4STAT is set to “1”) on the first falling edge of the PWM clock (P4CK) that are selected by the PWM4 control register 0 (PW4CON0) and the PWM4 control register 6 (PW4CON6) when the P4RUN bit of PWM4 control register 1 (PW4CON1) is set to “1”...
Page 256
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM The period of the PWM4 signal (T ), the first half duration (T ) of the duty, the duration of the PWM5 dead-time ) and the delay2(T ), are expressed by the following equations. PWD2 PW4P + 1 P4CK (Hz)
Page 257
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM After the P4RUN bit is set to “1”, counting starts in synchronization with the PWM clock. This causes an error of up to 1 clock pulse to the time the first PWM interrupt is issued. The PWM interrupt period from the second time is fixed. Figure 11-8 shows the operation timing of PWM4 and PWM5 on the condition of coupled mode with dead-time specified (P45MD=”1”, P4DTMD=”1”) and one shot mode (P4MD=”1”).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.3.7 PWM4/PWM5 start/stop/clear operation by the external control The PWM counter registers (PWnCH, PWnCL) can be enabled to start, stop and clear with external triggering inputs, by setting PnSTM1 bit, PnSTM0 bit and PnTGSEL bit of PWMn control register 2 (PWnCON2). The external input is sampled with a clock to eliminate one clock or less pulse of noise.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.3.7.1 Software Start Mode With the setting of PnSTM1="0" and PnSTM0="0", the PWM counter operates being controlled by the PnRUN bit only. The operation timing is similar to the ones shown in 11.3.1 to 11.3.6. 11.3.7.2 Software Start Mode or External Start Mode With the setting of PnSTM1="0"...
Page 260
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM PnTGE1=1, PnTGE0=0 When "L" level start and "H" level stop & clear are selected PnRUN P00, P32/PW45EV0 P30, P62/PW45EV1 The PnINI bit allows selection of the "H/L" level for the PWM initial value. PWMn output The PnSTPSEL bit allows selection of whether or not to output the initial value while being paused When the initial value is output, the PnINI bit allows...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.3.7.3 External Input Start Mode With the setting of PnSTM1="1" and PnSTM0="0" on the PWMn control register 2 (PWnCON2), the PWM counter operates being controlled by the edge of the external input that is selected by the PnTGSEL bit of the PWMn control register 2 (PWnCON2).
Page 262
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM PnTGE1=1, PnTGE0=0 When falling-edge start and rising-edge stop & clear are selected PnRUN P00, P32/PW45EV0 P30, P62/PW45EV1 The PnINI bit allows selection of the "H/L" level for the PWM initial value. PWMn output Count up PWnCH/L 0000 0000...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.3.7.4 Software Start or External Input Clear Mode With the setting of PnSTM1="1" and PnSTM0="1" on the PWMn control register 2 (PWnCON2), the PWM counter operates being controlled by the PnRUN bit. When there is no edge input on the external input selected by the PnTGSEL bit of the PWMn control register 2 (PWnCON2), the counter operates in the same way as the software start.
Page 264
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM PnTGE1=1, PnTGE0=0 When rising-edge clear is selected PnRUN P00, P32/PW45EV0 The PnINI bit allows selection of P30, P62/PW45EV1 the "H/L" level for the PWM initial value. PWMn output The PnSTPSEL bit allows selection of whether or not to output the initial value while being paused When the initial value is output, the PnINI bit allows selection of the "H/L"...
Page 265
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM PnTGE1=1, PnTGE0=1 Both-edge clear selected PnRUN P00, P32/PW45EV0 P30, P62/PW45EV1 The PnINI bit allows selection of the "H/L" level for the PWM initial value. PWMn output Count up Count up Count up 0000 0000 0000 PWnCH/L 0000...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.3.8 Emergency Stop Operation Setting the P4SDE1 and P4SDE0 bits of the PWM4 control register 3 (PW4CON3) enables the emergency stop function with the external input that is selected by P4TGSEL. Note that the emergency stop function is valid only in the cooperation mode (P45MD=“1”).
Page 267
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM Emergency stop by P4SDE1=1, P4SDE0=1 (Both edges) P00, P32/PW45EV0 P30, P62/PW45EV1 PnRUN P4SDST PW4INT PnFLG PWnCH/L 0000 0000 Count up 0000 Count up 0000 Count up 0000 0000 stop & clear stop & clear Emergency Emergency The PnINI bit allows selection of...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.3.9 PWM6 and PWM7, Single mode / Repeat mode (P67MD=”0”, PnMD=”0”) The PWM counter registers (PWnCH, PWnCL) are set to an operating state (PnSTAT is set to “1”) on the first falling edge of the PWM clock (PnCK) that are selected by the PWMn control register 0 (PWnCON0) when the PnRUN bit of PWMn control register 1 (PWnCON1) is set to “1”...
Page 269
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM After the PnRUN bit is set to “1”, counting starts in synchronization with the PWM clock. This causes an error of up to 1 clock pulse to the time the first PWM interrupt is issued. The PWM interrupt period from the second time is fixed. Figure 11-13 shows the operation timing of PWMn on the condition of single mode and repeat mode (P67MD=”0”, PnMD=”0”).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.3.10 PWM6 and PWM7, Single mode / One shot mode (P67MD=”0”, PnMD=”1”) The PWM counter registers (PWnCH, PWnCL) are set to an operating state (PnSTAT is set to “1”) on the first falling edge of the PWM clock (PnCK) that are selected by the PWMn control register 0 (PWnCON0) when the PnRUN bit of PWMn control register 1 (PWnCON1) is set to “1”...
Page 271
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM After the PnRUN bit is set to “1”, counting starts in synchronization with the PWM clock. This causes an error of up to 1 clock pulse to the time the first PWM interrupt is issued. Figure 11-14 shows the operation timing of PWMn on the condition of single mode and repeat mode (P67MD=”0”, PnMD=”1”).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.3.11 PWM6 and PWM7, Coupled mode (with no dead-time specified) / Repeat mode (P67MD=”1”, P6DTMD=”0”, P6MD=”0”) The PWM6 counter registers (PW6CH, PW6CL) are set to an operating state (P6STAT is set to “1”) on the first falling edge of the PWM clock (P6CK) that are selected by the PWM6 control register 0 (PW6CON0) and the PWM6 control register 6 (PW6CON6) when the P6RUN bit of PWM6 control register 1 (PW6CON1) is set to “1”...
Page 273
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM After the P6RUN bit is set to “1”, counting starts in synchronization with the PWM clock. This causes an error of up to 1 clock pulse to the time the first PWM interrupt is issued. The PWM interrupt period from the second time is fixed. Figure 11-15 shows the operation timing of PWM6 and PWM7 on the condition of coupled mode with no dead-time specified (P67MD=”1”, P6DTMD=”0”) and repeat mode (P6MD=”0”).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.3.12 PWM6 and PWM7, Coupled mode (with no dead-time specified) / One shot mode (P67MD=”1”, P6DTMD=”0”, P6MD=”1”) The PWM6 counter registers (PW6CH, PW6CL) are set to an operating state (P6STAT is set to “1”) on the first falling edge of the PWM clock (P6CK) that are selected by the PWM6 control register 0 (PW6CON0) and the PWM6 control register 6 (PW6CON6) when the P6RUN bit of PWM6 control register 1 (PW6CON1) is set to “1”...
Page 275
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM After the P6RUN bit is set to “1”, counting starts in synchronization with the PWM clock. This causes an error of up to 1 clock pulse to the time the first PWM interrupt is issued. The PWM interrupt period from the second time is fixed. Figure 11-16 shows the operation timing of PWM6 and PWM7 on the condition of coupled mode with no dead-time specified (P67MD=”1”, P6DTMD=”0”) and one shot mode (P6MD=”1”).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.3.13 PWM6 and PWM7, Coupled mode (with dead-time specified) / Repeat mode (P67MD=”1”, P6DTMD=”1”, P6MD=”0”) The PWM6 counter registers (PW6CH, PW6CL) are set to an operating state (P6STAT is set to “1”) on the first falling edge of the PWM clock (P6CK) that are selected by the PWM6 control register 0 (PW6CON0) and the PWM6 control register 6 (PW6CON6) when the P6RUN bit of PWM6 control register 1 (PW6CON1) is set to “1”...
Page 277
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM The period of the PWM6 signal (T ), the first half duration (T ) of the duty, the duration of the PWM7 dead-time ) and the delay2(T ), are expressed by the following equations. PWD2 PW6P + 1 P6CK (Hz)
Page 278
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM After the P6RUN bit is set to “1”, counting starts in synchronization with the PWM clock. This causes an error of up to 1 clock pulse to the time the first PWM interrupt is issued. The PWM interrupt period from the second time is fixed. Figure 11-17 shows the operation timing of PWM6 and PWM7 on the condition of coupled mode with dead-time specified (P67MD=”1”, P6DTMD=”1”) and repeat mode (P6MD=”0”).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.3.14 PWM6 and PWM7, Coupled mode (with dead-time specified) / One shot mode (P67MD=”1”, P6DTMD=”1”, P6MD=”1”) The PWM6 counter registers (PW6CH, PW6CL) are set to an operating state (P6STAT is set to “1”) on the first falling edge of the PWM clock (P6CK) that are selected by the PWM6 control register 0 (PW6CON0) and the PWM6 control register 6 (PW6CON6) when the P6RUN bit of PWM6 control register 1 (PW6CON1) is set to “1”...
Page 280
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM The period of the PWM6 signal (T ), the first half duration (T ) of the duty, the duration of the PWM7 dead-time ) and the delay2(T ), are expressed by the following equations. PWD2 PW6P + 1 P6CK (Hz)
Page 281
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM After the P6RUN bit is set to “1”, counting starts in synchronization with the PWM clock. This causes an error of up to 1 clock pulse to the time the first PWM interrupt is issued. The PWM interrupt period from the second time is fixed. Figure 11-18 shows the operation timing of PWM6 and PWM7 on the condition of coupled mode with dead-time specified (P67MD=”1”, P6DTMD=”1”) and one shot mode (P6MD=”1”).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.3.15 PWM6/PWM7 start/stop/clear operation by the external control The PWM counter registers (PWnCH, PWnCL) can be enabled to start, stop and clear with external triggering inputs, by setting PnSTM1 bit, PnSTM0 bit and PnTGSEL bit of PWMn control register 2 (PWnCON2). The external input is sampled with a clock to eliminate one clock or less pulse of noise.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.3.15.1 Software Start Mode With the setting of PnSTM1="0" and PnSTM0="0", the PWM counter operates being controlled by the PnRUN bit only. The operation timing is similar to the ones shown in 11.3.9 to 11.3.14. 11.3.15.2 Software Start Mode or External Start Mode With the setting of PnSTM1="0"...
Page 284
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM PnTGE1=1, PnTGE0=0 When "L" level start and "H" level stop & clear are selected PnRUN P01, P33/PW67EV0 P31, P63/PW67EV1 The PnINI bit allows selection of the "H/L" level for the PWM initial value. PWMn output The PnSTPSEL bit allows selection of whether or not to output the initial value while being paused When the initial value is output, the PnINI bit allows...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.3.15.3 External Input Start Mode With the setting of PnSTM1="1" and PnSTM0="0" on the PWMn control register 2 (PWnCON2), the PWM counter operates being controlled by the edge of the external input that is selected by the PnTGSEL bit of the PWMn control register 2 (PWnCON2).
Page 286
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM PnTGE1=1, PnTGE0=0 When falling-edge start and rising-edge stop & clear are selected PnRUN P01, P33/PW67EV0 P31, P63/PW67EV1 The PnINI bit allows selection of the "H/L" level for the PWM initial value. PWMn output Count up PWnCH/L 0000 0000...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.3.15.4 Software Start or External Input Clear Mode With the setting of PnSTM1="1" and PnSTM0="1" on the PWMn control register 2 (PWnCON2), the PWM counter operates being controlled by the PnRUN bit. When there is no edge input on the external input selected by the PnTGSEL bit of the PWMn control register 2 (PWnCON2), the counter operates in the same way as the software start.
Page 288
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM PnTGE1=1, PnTGE0=0 When rising-edge clear is selected PnRUN P01, P33/PW67EV0 The PnINI bit allows selection of P31, P63/PW67EV1 the "H/L" level for the PWM initial value. PWMn output The PnSTPSEL bit allows selection of whether or not to output the initial value while being paused When the initial value is output, the PnINI bit allows selection of the "H/L"...
Page 289
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM PnTGE1=1, PnTGE0=1 Both-edge clear selected PnRUN P01, P33/PW67EV0 P31, P63/PW67EV1 The PnINI bit allows selection of the "H/L" level for the PWM initial value. PWMn output Count up Count up Count up 0000 0000 0000 PWnCH/L 0000...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM 11.3.16 Emergency Stop Operation Setting the P6SDE1 and P6SDE0 bits of the PWM6 control register 3 (PW6CON3) enables the emergency stop function with the external input that is selected by P6TGSEL. Note that the emergency stop function is valid only in the cooperation mode (P67MD=“1”).
Page 291
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 11 PWM Emergency stop by P6SDE1=1, P6SDE0=1 (Both edges) P01, P33/PW67EV0 P31, P63/PW67EV1 PnRUN Set PnRUN bit again Set PnRUN bit again P6SDST PW6INT PnFLG PWnCH/L 0000 0000 Count up 0000 Count up 0000 Count up 0000 0000 stop &...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 12 Synchronous Serial Port (SSIO) 12 Synchronous Serial Port (SSIO) 12.1 General Description This LSI includes one channel of 8/16-bit synchronous serial ports (SSIO). It can also be used to control the device incorporated with the SPI interface by using one GPIO as the chip enable pin. When the synchronous serial port is used, the tertiary functions of Port must be set.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 12 Synchronous Serial Port (SSIO) 12.1.3 List of Pins Pin name Function Received data input. P40/SIN0 Used for the tertiary function of the P40 pins. Synchronous clock input/output. P41/SCK0 Used for the tertiary function of the P41 pins Transmitted data output.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 12 Synchronous Serial Port (SSIO) 12.2 Description of Registers 12.2.1 List of Registers Initial Address Name Symbol (Byte) Symbol (Word) Size value 0F700H Serial port 0 transmit/receive buffer L SIO0BUFL 8/16 SIO0BUF 0F701H Serial port 0 transmit/receive buffer H SIO0BUFH -...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 12 Synchronous Serial Port (SSIO) 12.2.3 Serial Port 0 Control Register (SIO0CON) Address: 0F702H Access: R/W Access size: 8-bit Initial value: 00H SIO0CON — — — — — — — S0EN Initial value SIO0CON is a special function register (SFR) to control the synchronous serial port 0. [Description of Bits] •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 12 Synchronous Serial Port (SSIO) 12.2.4 Serial Port 0 Mode Register 0 (SIO0MOD0) Address: 0F704H Access: R/W Access size: 8-bit Initial value: 00H SIO0MOD0 — — — — S0LG S0MD1 S0MD0 S0DIR Initial value SIO0MOD0 is a special function register (SFR) to set mode of the synchronous serial port 0. [Description of Bits] •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 12 Synchronous Serial Port (SSIO) 12.2.5 Serial Port 0 Mode Register 1 (SIO0MOD1) Address: 0F705H Access: R/W Access size: 8-bit Initial value: 00H SIO0MOD1 — — — S0CKT S0CK3 S0CK2 S0CK1 S0CK0 Initial value SIO0MOD1 is a special function register (SFR) to set mode of the synchronous serial port 0. [Description of Bits] •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 12 Synchronous Serial Port (SSIO) 12.3 Description of Operation 12.3.1 Transmit Operation When “1” is written to the S0MD1 bit and "0" is written to the S0MD0 bit of the serial port mode register (SIO0MOD0), this LSI is set to the transmit mode. When transmitted data is written to the serial port transmit/receive buffer (SIO0BUFL, "H") and the S0EN bit of the serial port control register (SIO0CON) is set to “1”, transmission starts.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 12 Synchronous Serial Port (SSIO) 12.3.2 Receive Operation When “0” is written to the S0MD1 bit and “1” is written to the S0MD0 bit of the serial port mode register (SIO0MOD0), this LSI is set to a receive mode. When the S0EN bit of the serial port control register (SIO0CON) is set to “1”, reception starts.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 12 Synchronous Serial Port (SSIO) 12.3.3 Transmit/Receive Operation When “1” is written to the S0MD1 bit and "1" is written to the S0MD0 bit of the serial port mode register (SIO0MOD0), this LSI is set to the transmit/receive mode. When the S0EN bit of the serial port control register (SIO0CON) is set to “1”, transmission/reception starts.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 12 Synchronous Serial Port (SSIO) 12.4 Specifying port registers To enable the SSIO0 function, the applicable bit of each related port register needs to be set. See Chapter 19, "Port 4", Chapter 20, "Port 5", Chapter 22, "Port 7" and Chapter 23, "Port 8" for detail about the port registers. 12.4.1 Functioning P42 (SOUT0: Output), P41 (SCK0: Input/output), and P40 (SIN0: Input) as the SSIO0/ “Master mode”...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 12 Synchronous Serial Port (SSIO) 12.4.2 Functioning P42 (SOUT0: Output), P41 (SCK0: Input/output), and P40 (SIN0: Input) as the SSIO0/ ”Slave mode” Set the P42MD1 to P40MD1 bits (P4MOD1 register bits 2 to 0) to “1” and the P42MD0 to P40MD0 bits (P4MOD0 register bits 2 to 0) to “0”...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART 13 UART 13.1 General Description This LSI includes one channel of UART (Universal Asynchronous Receiver Transmitter), a full-duplex communication start-stop synchronous serial interface. This one full-duplex communication channel can be used as two independent half-duplex communication channels.
Page 307
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART 13.1.3 List of Pins Pin name Function UART0 data input pin P02/RXD0 Used as the primary function of the P02 pin. UART0 data input pin P42/RXD0 Used as the secondary function of the P42 pin. UART0/1 data output pin P43/TXD0/TXD1 Used as the secondary or quartic function of the P43 pin.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART 13.2.2 UART0 Transmit/Receive Buffer (UA0BUF) Address: 0F710H Access: R/W Access size: 8 bits Initial value: 00H UA0BUF U0B7 U0B6 U0B5 U0B4 U0B3 U0B2 U0B1 U0B0 Initial value UA0BUF is a special function register (SFR) used to store the receive data in the full-duplex communication. It functions as a receive buffer in the full-duplex communication.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART 13.2.3 UART1 Transmit/Receive Buffer (UA1BUF) Address: 0F718H Access: R/W Access size: 8 bits Initial value: 00H UA1BUF U1B7 U1B6 U1B5 U1B4 U1B3 U1B2 U1B1 U1B0 Initial value UA1BUF is a special function register (SFR) used to store the transmit data in the full-duplex communication. It functions as a transmit buffer in the full-duplex communication.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART 13.2.4 UART0 Control Register (UA0CON) Address: 0F711H Access: R/W Access size: 8 bits Initial value: 00H UA0CON — — — — — — — U0EN Initial value UA0CON is a special function register (SFR) used to start/stop communication of the UART. Description of bits •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART 13.2.6 UART0 Mode Register 0 (UA0MOD0) Address: 0F712H Access: R/W Access size: 8/16 bit Initial value: 00H UA0MOD0 U01HD U0RSS U0RSEL1 U0RSEL0 U0CK1 U0CK0 U0IO Initial value UA0MOD0 is a special function register (SFR) used to set the transfer mode of the UART. Description of bits •...
Page 312
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART • U0IO (bit 0) The U0IO bit is used to select transmit or receive mode. Be sure to set this bit to "1" in full-duplex communication. U0IO Description Transmit mode (initial value) Receive mode Enable/disable of registers depending on full/half-duplex communication mode setting Name Symbol (Byte)
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART 13.2.7 UART1 Mode Register 0 (UA1MOD0) Address: 0F71AH Access: R/W Access size: 8/16 bit Initial value: 00H UA1MOD0 U1RSS U1RSEL1 U1RSEL0 U1CK1 U1CK0 U1IO Initial value UA1MOD0 is a special function register (SFR) used to set the transfer mode of the UART. In full-duplex communication, this register is disabled.
Page 314
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART [Note] • Always set UA1MOD0 while communication is stopped, and do not rewrite it during communication. • When selecting the P52 pin as the received data input pin, it is necessary to configure settings for the Port 5 secondary functions.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART 13.2.8 UART0 Mode Register 1 (UA0MOD1) Address: 0F713H Access: R/W Access size: 8/16 bit Initial value: 00H UA0MOD1 U0DIR U0NEG U0STP U0PT1 U0PT0 U0LG1 U0LG0 Initial value UA0MOD1 is a special function register (SFR) used to set the transfer mode of the UART. Description of bits •...
Page 316
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART [Note] Always set UA0MOD1 while communication is stopped, and do not rewrite it during communication. FEUL620Q150A 13-1...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART 13.2.9 UART1 Mode Register 1 (UA1MOD1) Address: 0F71BH Access: R/W Access size: 8/16 bit Initial value: 00H UA1MOD1 U1DIR U1NEG U1STP U1PT1 U1PT0 U1LG1 U1LG0 Initial value UA1MOD1 is a special function register (SFR) used to set the transfer mode of the UART. In full-duplex communication, this register is disabled.
Page 318
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART [Note] Always set UA1MOD1 while communication is stopped, and do not rewrite it during communication. FEUL620Q150A 13-1...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART 13.2.12 UART0 Status Register (UA0STAT) Address: 0F716H Access: R/W Access size: 8 bits Initial value: 00H UA0STAT U0FUL U0PER U0OER U0FER Initial value UA0STAT is a special function register (SFR) used to indicate the UART state in receive operations. When any data is written to UA0STAT, all the flags are initialized to "0".
Page 322
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART • U0FER (bit 0) The U0FER bit is used to indicate occurrence of a framing error of the UART. When an error occurs in the start or stop bit, this bit is set to "1". U0FER is updated each time reception is completed.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART 13.2.13 UART1 Status Register (UA1STAT) Address: 0F71EH Access: R/W Access size: 8 bits Initial value: 00H UA1STAT U1FUL U1PER U1OER U1FER Initial value UA1STAT is a special function register (SFR) used to indicate the UART state in receive operations. When any data is written to UA1STAT, all the flags are initialized to "0".
Page 324
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART • U1FER (bit 0) The U1FER bit is used to indicate occurrence of a framing error of the UART. When an error occurs in the start or stop bit, this bit is set to "1". U1FER is updated each time reception is completed.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART 13.3 Description of Operation 13.3.1 Transfer Data Format In the transfer data format, one frame contains a start bit, a data bit, a parity bit, and a stop bit. In this format, 5 to 8 bits can be selected as data bit.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART 13.3.2 Baud Rate Baud rates are generated by the baud rate generator. The baud rate generator generates a baud rate by counting the clock selected by the baud rate clock selection bits (UnCK1, UnCK0) of the UARTn mode register 0 (UAnMOD0). The count value of the baud rate generator can be set by writing it in the UARTn baud rate register H or L (UAnBRTH, UAnBRTL).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART 13.3.4 Transmit Operation Transmission is started by setting the UnIO bit of the UARTn mode register 0 (UAnMOD0) to "0" to select the transmit mode and setting the UnEN bit of the UARTn control register (UAnCON) to "1". Figure 13-5 shows the operation timing for transmission.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART 13.3.5 Receive Operation Select the receive data pin using the UnRSEL bit of the UARTn mode register 0 (UAnMOD0). Reception is started by setting the UnIO bit of the UARTn mode register 0 (UAnMOD0) to "1" to select the receive mode and setting the UnEN bit of the UARTn control register (UAnCON) to "1".
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART 13.3.5.1 Detection of Start Bit The start bit is sampled with the baud rate generator clock (HSCLK). Therefore, the start bit detection may be delayed for one cycle of the baud rate generator clock at the maximum. Figure 13-7 shows the start bit detection timing.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART 13.3.5.3 Receive Margin If there is an error between the sender baud rate and the baud rate generated by the baud rate generator of this LSI, the error accumulates until the last stop bit loading in one frame, decreasing the receive margin. Figure 13-9 shows the baud rate errors and receive margin waveforms.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART 13.4 Specifying Port Registers To enable the UART function, the applicable bit of each related port register needs to be set. See Chapter 15, "Port 0", Chapter 19, "Port 4", Chapter 20, "Port 5", Chapter 22, "Port 7", and Chapter 23, "Port 8" for details about the port registers.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART 13.4.2 Functioning P43 (TXD1: Output) and P02 pins (RXD0: Input) as the UART (Full-duplex) Set the P43MD1 bit (bit 3 of P4MOD1 register) to "1" and set the P43MD0 bit (bit 3 of P4MOD0 register) to "1", to specify the UART as the quartic function of P43.
Page 336
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART The P02 pin is an input-only pin and does not need input/output selection by the register. The set value ($) is arbitrary for the P02C1 and P02C0 bits. Select an arbitrary input mode depending on the state of the external circuit to which the P02 pin is connected.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART 13.4.3 Functioning P85 (TXD1: Output) and P86 pins (RXD0: Input) as the UART (Full-duplex) Set the P86MD1 to P85MD1 bits (bits 6 to 5 of P8MOD1 register) to "0", and set the P86MD0 to P85MD0 bits (bits 6 to 5 of P8MOD0 register) to "1", for specifying the UART as the secondary function of P86 and P85.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART 13.4.4 Functioning P53 (TXD1: Output) and P03 pins (RXD1: Input) as the UART (Half-duplex) Set the P53MD1 bit (bit 3 of P5MOD1 register) to "0" and set the P53MD0 bit (bit 3 of P5MOD0 register) to "1", to specify the UART as the secondary function of P53.
Page 339
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART The P03 pin is an input-only pin and does not need input/output selection by the register. The set value ($) is arbitrary for the P03C1 and P03C0 bits. Select an arbitrary input mode depending on the state of the external circuit to which the P03 pin is connected.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART 13.4.5 Functioning P55 (TXD0: Output) and P42 pins (RXD0: Input) as the UART (Half-duplex) Set the P55MD1 bit (bit 5 of P5MOD1 register) to "1" and set the P55MD0 bit (bit 5 of P5MOD0 register) to "1", to specify the UART as the secondary function of P55.
Page 341
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART Set the P42MD1 bit (bit 2 of P4MOD1 register) to "0" and set the P42MD0 bit (bit 2 of P4MOD0 register) to "1", to specify the UART as the secondary function of P42. Register name P4MOD1 register (Address: 0F249H) P47MD1 P46MD1...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART 13.4.6 Functioning P43 (TXD0: Output) and P54 pins (RXD0: Input) as the UART (Half-duplex) Set the P43MD1 bit (bit 3 of P4MOD1 register) to "0" and set the P43MD0 bit (bit 3 of P4MOD0 register) to "1", to specify the UART as the secondary function of P43.
Page 343
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART Set the P54MD1 bit (bit 4 of P5MOD1 register) to "0" and set the P54MD0 bit (bit 4 of P5MOD0 register) to "1", to specify the UART as the secondary function of P54. Register name P5MOD1 register (address: 0F257H) P57MD1 P56MD1...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART 13.4.7 Functioning P85 (TXD1: Output) and P72 pins (RXD1: Input) as the UART (Half-duplex) Set the P85MD1 bit (bit 5 of P8MOD1 register) to "0", and set the P85MD0 bit (bit 5 of P8MOD0 register) to "1", for specifying the UART as the secondary function of P85.
Page 345
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 13 UART Set the P72MD1 bit (bit 2 of P7MOD1 register) to "0" and set the P72MD0 bit (bit 2 of P7MOD0 register) to "1", to specify the UART as the secondary function of P72. Register name P7MOD1 register (Address: 0F273H) P74MD1 P73MD1...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 14 I2C Bus Interface 14 I C Bus Interface 14.1 General Description This LSI includes 1 channel of I2C bus interface (master). The I C bus interface data I/O pin and the I C bus interface clock I/O pin are assigned as the secondary function of the ports 4, 5, 6, and port 8.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 14 I2C Bus Interface 14.1.3 List of Pins Pin name Description C bus interface data input/output pin. P40/SDA Used for the secondary function of the P40 pin. C bus interface clock input/output pin. P41/SCL Used for the secondary function of the P41 pin. C bus interface data input/output pin.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 14 I2C Bus Interface 14.2 Description of Registers 14.2.1 List of Registers Initial Address Name Symbol (Word) Symbol (Byte) Size value 0F740H I2C0RD 0000H - C bus 0 receive register - - - 0F741H 0F742H I2C0SA 0000H...
Page 350
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 14 I2C Bus Interface 14.2.2 I C Bus 0 Receive Data Register (I2C0RD) Address: 0F740H Access: R Access size: 8 bits Initial value: 00H I2C0RD I20R7 I20R6 I20R5 I20R4 I20R3 I20R2 I20R1 I20R0 Initial value - -...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 14 I2C Bus Interface 14.2.3 I C Bus 0 Slave Address Register (I2C0SA) Address: 0F742H Access: R/W Access size: 8 bits Initial value: 0000H I2C0SA I20A6 I20A5 I20A4 I20A3 I20A2 I20A1 I20A0 I20RW Initial value I2C0SA is a special function register (SFR) to set the address and the transmit/receive mode of the slave device. [Description of Bits] •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 14 I2C Bus Interface 14.2.4 I C Bus 0 Transmit Data Register (I2C0TD) Address: 0F744H Access: R/W Access size: 8 bits Initial value: 00H I2C0TD0 I20T7 I20T6 I20T5 I20T4 I20T3 I20T2 I20T1 I20T0 Initial value I2C0TD is a special function register (SFR) used to set the transmitted data. [Description of Bits] •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 14 I2C Bus Interface 14.2.5 I C Bus 0 Control Register (I2C0CON) Address: 0F746H Access: R/W Access size: 16/8 bits Initial value: 0000H I2C0CON0 I20ACT I20RS I20SP I20ST Initial value I2C0CON1 Initial value I2C0CON is a special function register (SFR) to control transmit and receive operations. [Description of Bits] •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 14 I2C Bus Interface 14.2.6 I C Bus 0 Mode Register (I2C0MOD) Address: 0F748H Access: R/W Access size: 16/8 bits Initial value: 0200H I2C0MODL — — — — I20DW1 I20DW0 I20MD I20EN Initial value I2C0MODH I20CD1 I20CD0 Initial value I2C00MOD is a special function register (SFR) used to set the operation mode.
Page 355
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 14 I2C Bus Interface I20MD Description Standard mode (initial value)/100 kbps Fast mode/400 kbps • I20EN (bit 0) The I20EN bit is used to enable the operation of the I C bus interface. Only when I20EN is “1”, the I20ST bit can be set and the I2C0 bus becomes available.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 14 I2C Bus Interface 14.2.7 I C Bus 0 Status Register (I2C0STAT) Address: 0F74AH Access: R Access size: 16/8 bits Initial value: 0000H I2C0STAL I20ER I20ACR I20BB Initial value Initial value I2C0STAT is a read-only special function register (SFR) to indicate the state of the I C bus interface.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 14 I2C Bus Interface 14.3 Description of Operation 14.3.1 Communication Operation Mode Communication is started when communication mode is selected by using the I C bus 0 mode register (I2C0MOD), the C function is enabled by using the I20EN bit, a slave address and a data communication direction are set in the I C bus 0 slave address register (I2C0SA), and “1”...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 14 I2C Bus Interface 14.3.2 Communication Operation Timing Figures 14-2 to 14-4 show the operation timing and control method for each communication mode. Start Stop Restart Reception of Reception of Transmission of condition condition condition acknowledg acknowledg acknowledgment ment...
Page 359
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 14 I2C Bus Interface Figure 14-5 shows the operation timing and control method when an acknowledgment error occurs. Acknowledge error Register I2C0SA=”xxxxxxx0B” setting I2C0CON=”01H” I2C0CON=”02H” Value of I2C0SA I2C0INT I2nST Value of I2C0RD I2C0SA I2nACR Figure 14-5 Operation Suspend Timing at Occurrence of Acknowledgment Error When the values of the transmitted bit and the SDA pin do not coincide, the I2nER bit of the I C bus n status register (I2C0STAT) is set to “1”...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 14 I2C Bus Interface 14.3.3 Operation Waveforms Figure 14-7 shows the operation waveforms of the SDA and SCL signals and the I2nBB flag. Table 15-2 shows the relationship between communication speeds and 1/m OSCLK clock counts. Start Restart Stop...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 14 I2C Bus Interface 14.4 Specifying port registers When you want to make sure the I2C bus interface function is working, please check related port registers are specified. See Chapter 19, “Port 4” , Chapter 20, “Port 5” and Chapter 21, “Port 6” for detail about the port registers. 14.4.1 Functioning P41(SCL) and P40(SDA) as the I2C Set P41MD1-P40MD1 bits(bit1-bit0 of P4MOD1 register) to “0”...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 15 Port 0 15 Port 0 15.1 General Description ML620Q151A/ML620Q152A/ML620Q153A includes a 5-bit input/output port, Port 0 (P00 to P04). ML620Q154A/ML620Q155A/ML620Q156A includes a 6-bit input/output port, Port 0 (P00 to P05). ML620Q157A/ML620Q158A/ML620Q159A includes a 6-bit input/output port, Port 0 (P00 to P05). For details, see Section 1.3.2, "List of Pins".
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 15 Port 0 15.2 Description of Registers 15.2.1 List of Registers Address Name Symbol Symbol Size Initial value (Byte) (Word) Port 0 data register Depends on pin 0F20CH state 0F20EH Port 0 control register 0 P0CON0 8/16 P0CON 0F20FH...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 15 Port 0 15.2.2 Port 0 Data Register (P0D) Address: 0F20CH Access: R Access size: 8 bits Initial value: Depends on pin state — — P05D P04D P03D P02D P01D P00D Initial value P0D is a read-only special function register (SFR) used to read the pin level of Port 0. Description of bits •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 15 Port 0 15.2.5 External Interrupt Control Register 2 (EXICON2) Address: 0F03AH Access: R/W Access size: 8 bits Initial value: 00H EXICON2 P31SM P30SM P05SM P04SM P03SM P02SM P01SM P00SM Initial value EXICON2 is a special function register (SFR) to select whether the Port 0 interrupt is with sampling or without sampling.
Page 370
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 15 Port 0 P00SM Description Detects the input signal edge for P00 interrupt without sampling (initial value). Detects with sampling [Note] • In STOP mode, no sampling is performed regardless of the value set in P31SM to P30SM and P05SM to P00SM since the sampling clock of 16 kHz stops.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 15 Port 0 15.3 Description of Operation For the pins of Port 00 to 05, the setting of port 0 control registers 0, 1 (P0CON0, P0CON1) allows selection of high-impedance input mode, input mode with a pull-down resistor, or input mode with a pull-up resistor. High-impedance input mode is selected at system reset.
Page 372
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 15 Port 0 When rising-edge interrupt mode with sampling is selected, the input level of P0n and P3m pins is checked at falling edges of T16KHz. If it is "H" twice consecutively, the interrupt condition is satisfied, and an interrupt request occurs at the timing of falling edge of SYSCLK after the second falling edge of T16KHz.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 16 Port 1 16 Port 1 16.1 General Description This LSI includes a 3-bit input port, Port 1 (P12, P13, P14). Port 1 can have a low-speed crystal oscillation pin (32.768 kHz) as a secondary function. To use it as a low-speed crystal oscillation pin, it can be selected in Code-Option.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 16 Port 1 16.2 Description of Registers 16.2.1 List of Registers Address Name Symbol Symbol Size Initial value (Byte) (Word) Port 1 data register Depends on pin 0F21AH state 0F21BH Port 1 direction register P1DIR 0F21CH Port 1 control register 0 P1CON0 8/16...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 16 Port 1 16.2.2 Port 1 Data Register (P1D) Address: 0F21AH Access: R/W Access size: 8 bits Initial value: Depends on pin state — — — P14D P13D P12D — — Initial value P1D is a read-only special function register (SFR) used to read the input level of the port 1 pin. Description of bits •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 16 Port 1 16.2.3 Port 1 Direction Register (P1DIR) Address: 0F21BH Access: R/W Access size: 8 bits Initial value: 18H — — — — P1DIR — P14DIR P13DIR — Initial value P1DIR is a special function register (SFR) to select the input/output mode of Port 1 (P14). The P12 pin is an input-only port, and the P13 pin is an I/O port.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 16 Port 1 16.2.4 Port 1 Control Registers 0, 1 (P1CON0, P1CON1) Address: 0F21CH Access: R/W Access size: 8/16 bit Initial value: 10H P1CON0 — — — P14C0 P13C0 P12C0 — — Initial value Address: 0F21DH Access: R/W Access size: 8 bits Initial value: 00H...
Page 379
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 16 Port 1 [Note] • Do not program ML620Q150A series with an application program code that sets P14IDR bit of P1DIR register to”0”. Because the program code is executed before µEASE accesses to ML620Q150A series, P14/TEST0 pin gets output mode and from then on, the LSI cannot enter the on-chip debug mode.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 16 Port 1 16.3 Description of Operation 16.3.1 Input Port Function For each pin of Port 1, one of high-impedance input mode, input mode with a pull-down resistor, and input mode with a pull-up resistor can be selected by setting the Port 1 control registers 0, 1 (P1CON0, P1CON1). At a system reset, high-impedance input mode is selected as the initial status.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 17 Port 2 17 Port 2 17.1 General Description This LSI includes a 4-bit output-only port, Port 2 (P20 to P23). Port 2 can output the low-speed clock (LSCLK) and high-speed clock (OUTCLK) as the secondary function, the PWM4 output (PWM4), PWM5 output (PWM5), timer A out (TMHAOUT), and timer B out (TMHBOUT) as the tertiary function, and the PWM6 output (PWM6) and PWM7 output (PWM7) as the quartic function.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 17 Port 2 17.2 Description of Registers 17.2.1 List of Registers Address Name Symbol Symbol Size Initial value (Byte) (Word) 0F228H Port 2 data register 0F22AH Port 2 control register 0 P2CON0 8/16 P2CON 0F22BH Port 2 control register 1 P2CON1 0F22CH Port 2 mode register 0...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 17 Port 2 17.2.2 Port 2 Data Register (P2D) Address: 0F228H Access: R/W Access size: 8 bits Initial value: 00H — — — — P23D P22D P21D P20D Initial value P2D is a special function register (SFR) to set the output value of the Port 2. The value of this register is output to the Port 2 pin.
Page 388
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 17 Port 2 • P21MD0, P21MD1 (bit 1) The P21MD0 and P21MD1 bits are used to select the primary, secondary, or tertiary function of the P21 pin. Description P21MD1 P21MD0 General-purpose output port function/LED drive mode (initial value) High-speed clock output function (OUTCLK) PWM5 output (PWM5) Do not use...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 17 Port 2 17.3 Description of Operation 17.3.1 Output Port Function For each pin of Port 2, any one of high-impedance output mode, P-channel open drain output mode, N-channel open drain output mode, and CMOS output mode can be selected by setting the Port 2 control registers 0, 1 (P2CON0, P2CON1).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 18 Port 3 18 Port 3 18.1 General Description ML620Q151A/ML620Q152A/ML620Q153A includes a 6-bit input/output port, Port 3 (P30 to P35). ML620Q154A/ML620Q155A/ML620Q156A includes a 7-bit input/output port, Port 3 (P30 to P36). ML620Q157A/ML620Q158A/ML620Q159A includes a 8-bit input/output port, port 3 (P30 to P37). For details, see Section 1.3.2, "List of Pins".
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 18 Port 3 18.2 Description of Registers 18.2.1 List of Registers Address Name Symbol Symbol Size Initial value (Byte) (Word) 0F236H Port 3 data register 0F237H Port 3 direction register P3DIR 0F238H Port 3 control register 0 P3CON0 8/16 P3CON...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 18 Port 3 18.2.2 Port 3 Data Register (P3D) Address: 0F236H Access: R/W Access size: 8 bits Initial value: 00H P37D P36D P35D P34D P33D P32D P31D P30D Initial value P3D is a special function register (SFR) to set the value to be output to the Port 3 pin or to read the input level of the Port 3.
Page 396
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 18 Port 3 P30D Description Output or input level of the P30 pin: "L" Output or input level of the P30 pin: "H" FEUL620Q150A 18-6...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 18 Port 3 18.2.3 Port 3 Direction Register (P3DIR) Address: 0F237H Access: R/W Access size: 8 bits Initial value: 00H P3DIR P37DIR P36DIR P35DIR P34DIR P33DIR P32DIR P31DIR P30DIR Initial value P3DIR is a special function register (SFR) to select the input/output mode of Port 3. Description of bits •...
Page 401
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 18 Port 3 • P34MD1, P34MD0 (bits 4) The P34MD1 and P34MD0 bits are used to select the primary or tertiary function of the P34 pin. Description P34MD1 P34MD0 General-purpose output port function (initial value) Do not use PWM4 output pin (PWM4) Do not use •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 18 Port 3 18.3 Description of Operation 18.3.1 Input/Output Port Functions For each pin of Port 3, either output or input is selected by setting the Port 3 direction register (P3DIR). In output mode, high-impedance output mode, P-channel open drain output mode, N-channel open drain output mode, or CMOS output mode can be selected by setting the Port 3 control registers 0, 1 (P3CON0, P3CON1).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 19 Port 4 19 Port 4 19.1 General Description This LSI includes a 8-bit input/output port, Port 4 (P40 to P47). Port 4 can have the PWM output, UART, synchronous serial port, and I C bus functions as the secondary, tertiary, or quartic function.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 19 Port 4 19.1.3 List of Pins Pin name Primary function Secondary function Tertiary function Quartic function I/O port, P40/CMP0M/ C bus 0 data SSIO0 data Analogue comparator SDA/SIN0 I/O pin input pin 0 non-inverting input I/O port, P41/CMP0P/ C bus 0 clock...
Page 406
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 19 Port 4 19.2 Description of Registers 19.2.1 List of Registers Address Name Symbol Symbol Size Initial value (Byte) (Word) 0F244H Port 4 data register 0F245H Port 4 direction register P4DIR 0F246H Port 4 control register 0 P4CON0 8/16 P4CON...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 19 Port 4 19.2.2 Port 4 Data Register (P4D) Address: 0F244H Access: R/W Access size: 8 bits Initial value: 00H P47D P46D P45D P44D P43D P42D P41D P40D Initial value P4D is a special function register (SFR) to set the value to be output to the Port 4 pin or to read the input level of the Port 4.
Page 408
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 19 Port 4 P40D Description Output or input level of the P40 pin: "L" Output or input level of the P40 pin: "H" FEUL620Q150A 19-5...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 19 Port 4 19.2.3 Port 4 Direction Register (P4DIR) Address: 0F245H Access: R/W Access size: 8 bits Initial value: 00H P4DIR P47DIR P46DIR P45DIR P44DIR P43DIR P42DIR P41DIR P40DIR Initial value P4DIR is a special function register (SFR) to select the input/output mode of Port 4. Description of bits •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 19 Port 4 19.2.4 Port 4 Control Registers 0, 1 (P4CON0, P4CON1) Address: 0F246H Access: R/W Access size: 8/16 bit Initial value: 00H P4CON0 P47C0 P46C0 P45C0 P44C0 P43C0 P42C0 P41C0 P40C0 Initial value Address: 0F247H Access: R/W Access size: 8 bits Initial value: 00H...
Page 411
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 19 Port 4 Setting of P45 pin When output mode is selected (P45DIR When input mode is selected (P45DIR bit = bit = "0") "1") P45C1 P45C0 Description High-impedance output (initial value) High-impedance input P-channel open drain output Input with a pull-down resistor N-channel open drain output Input with a pull-up resistor...
Page 413
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 19 Port 4 • P45MD1, P45MD0 (bit 5) The P45MD1 and P45MD0 bits are used to select the primary or tertiary function of the P45 pin. Description P45MD1 P45MD0 General-purpose input/output mode (initial value) Do not use SIO0 clock I/O pin (SCK0) Do not use •...
Page 414
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 19 Port 4 • P40MD1, P40MD0 (bit 0) The P40MD1 and P40MD0 bits are used to select the primary, secondary, or tertiary function of the P40 pin. P40MD1 P40MD0 Description General-purpose input/output mode (initial value) C bus 0 data I/O pin (SDA) SIO0 data input pin (SIN0) Do not use [Note]...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 19 Port 4 19.3 Description of Operation 19.3.1 Input/Output Port Functions For each pin of Port 4, either output or input is selected by setting the Port 4 direction register (P4DIR). In output mode, high-impedance output mode, P-channel open drain output mode, N-channel open drain output mode, or CMOS output mode can be selected by setting the Port 4 control registers 0, 1 (P4CON0, P4CON1).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 20 Port 5 20 Port 5 20.1 General Description ML620Q151A/ML620Q152A/ML620Q153A includes a 4-bit input/output port, Port 5 (P54 to P57). ML620Q154A/ML620Q155A/ML620Q156A includes a 5-bit input/output port, Port 5 (P53 to P57). ML620Q157A/ML620Q158A/ML620Q159A includes a 8-bit input/output port, port 5 (P50 to P57). For details, see Section 1.3.2, "List of Pins".
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 20 Port 5 20.1.3 List of Pins Pin name Primary function Secondary Tertiary function Quartic function function P50/SDA/SIN0 I/O port C data SSIO0 data I/O (SDA) input pin P51/SCL/SCK0 I/O port C clock SSIO0 clock I/O (SCL) I/O pin P52/RXD1/SOUT0 I/O port...
Page 419
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 20 Port 5 20.2 Description of Registers 20.2.1 List of Registers Address Name Symbol Symbol Size Initial value (Byte) (Word) 0F252H Port 5 data register 0F253H Port 5 direction register P5DIR 0F254H Port 5 control register 0 P5CON0 8/16 P5CON...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 20 Port 5 20.2.2 Port 5 Data Register (P5D) Address: 0F252H Access: R/W Access size: 8 bits Initial value: 00H P57D P56D P55D P54D P53D P52D P51D P50D Initial value P5D is a special function register (SFR) to set the value to be output to the Port 5 pin or to read the input level of the Port 5.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 20 Port 5 20.2.3 Port 5 Direction Register (P5DIR) Address: 0F253H Access: R/W Access size: 8 bits Initial value: 00H P5DIR P57DIR P56DIR P55DIR P54DIR P53DIR P52DIR P51DIR P50DIR Initial value P5DIR is a special function register (SFR) to select the input/output mode of Port 5. Description of bits •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 20 Port 5 20.2.4 Port 5 Control Registers 0, 1 (P5CON0, P5CON1) Address: 0F254H Access: R/W Access size: 8/16 bit Initial value: 00H P5CON0 P57C0 P56C0 P55C0 P54C0 P53C0 P52C0 P51C0 P50C0 Initial value Address: 0F255H Access: R/W Access size: 8 bits Initial value: 00H...
Page 423
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 20 Port 5 Setting of P54 pin When output mode is selected (P54DIR When input mode is selected (P54DIR bit = bit = "0") "1") P54C1 P54C0 Description High-impedance output (initial value) High-impedance input P-channel open drain output Input with a pull-down resistor N-channel open drain output Input with a pull-up resistor...
Page 425
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 20 Port 5 • P54MD1, P54MD0 (bit 4) The P54MD1 and P54MD0 bits are used to select the primary or secondary function of the P54 pin. P54MD1 P54MD0 Description General-purpose input/output mode (initial value) UART0 data input pin (RXD0) Do not use Do not use •...
Page 426
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 20 Port 5 [Note] When the pin is set to "Do not use" and the output mode is selected (by the Port 5 control register), the Port 5 output pin state is fixed as follows regardless of the data of the port data register P5D: When high-impedance output is selected: Output pin is high-impedance When P-channel open drain output is selected: Output pin is high-impedance When N-channel open drain output is selected: Output pin is fixed to "L"...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 20 Port 5 20.3 Description of Operation 20.3.1 Input/Output Port Functions For each pin of Port 5, either output or input is selected by setting the Port 5 direction register (P5DIR). In output mode, high-impedance output mode, P-channel open drain output mode, N-channel open drain output mode, or CMOS output mode can be selected by setting the Port 5 control registers 0, 1 (P5CON0, P5CON1).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 21 Port 6 21 Port 6 21.1 General Description ML620Q151A/ML620Q152A/ML620Q153A includes a 4-bit input/output port, Port 6 (P60 to P63). ML620Q154A/ML620Q155A/ML620Q156A includes a 5-bit input/output port, Port 6 (P60 to P64). ML620Q157A/ML620Q158A/ML620Q159A includes a 8-bit input/output port, port 6 (P60 to P67). For details, see Section 1.3.2, "List of Pins".
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 21 Port 6 21.1.3 List of Pins Pin name Primary function Secondary Tertiary function Quartic function function P60/SDA/ C data Timer A out I/O port PWM6 output TMHAOUT/PWM6 I/O (SDA) (TMHAOUT) P61/SCL/ C clock Timer B out I/O port PWM7 output TMHBOUT/PWM7...
Page 431
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 21 Port 6 21.2 Description of Registers 21.2.1 List of Registers Address Name Symbol Symbol Size Initial value (Byte) (Word) 0F260H Port 6 data register 0F261H Port 6 direction register P6DIR 0F262H Port 6 control register 0 P6CON0 8/16 P6CON...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 21 Port 6 21.2.2 Port 6 Data Register (P6D) Address: 0F260H Access: R/W Access size: 8 bits Initial value: 00H P67D P66D P65D P64D P63D P62D P61D P60D Initial value P6D is a special function register (SFR) to set the value to be output to the Port 6 pin or to read the input level of the Port 6. In output mode, the value of this register is output to the Port 6 pin.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 21 Port 6 21.2.3 Port 6 Direction Register (P6DIR) Address: 0F261H Access: R/W Access size: 8 bits Initial value: 00H P6DIR P67DIR P66DIR P65DIR P64DIR P63DIR P62DIR P61DIR P60DIR Initial value P6DIR is a special function register (SFR) to select the input/output mode of Port 6. Description of bits •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 21 Port 6 21.2.4 Port 6 Control Registers 0, 1 (P6CON0, P6CON1) Address: 0F262H Access: R/W Access size: 8/16 bit Initial value: 00H P6CON0 P67C0 P66C0 P65C0 P64C0 P63C0 P62C0 P61C0 P60C0 Initial value Address: 0F263H Access: R/W Access size: 8 bits Initial value: 00H...
Page 435
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 21 Port 6 Setting of P65 pin When output mode is selected (P65DIR When input mode is selected (P65DIR bit bit = "0") = "1") P65C1 P65C0 Description High-impedance output (initial value) High-impedance input P-channel open drain output Input with a pull-down resistor N-channel open drain output Input with a pull-up resistor...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 21 Port 6 21.2.5 Port 6 Mode Registers 0, 1 (P6MOD0, P6MOD1) Address: 0F264H Access: R/W Access size: 8/16 bit Initial value: 00H P6MOD0 P66MD0 P65MD0 P64MD0 P61MD0 P60MD0 Initial value Address: 0F265H Access: R/W Access size: 8/16 bit Initial value: 00H P6MOD1 P66MD1...
Page 437
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 21 Port 6 • P61MD1, P61MD0 (bit 1) The P61MD1 and P61MD0 bits are used to select the primary, secondary, tertiary, or quartic function of the P61 pin. Description P61MD1 P61MD0 General-purpose input/output mode (initial value) C communication clock I/O pin (SCL) Timer B out output function (TMHBOUT) PWM7 output pin (PWM7)
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 21 Port 6 21.3 Description of Operation 21.3.1 Input/Output Port Functions For each pin of Port 6, either output or input is selected by setting the Port 6 direction register (P6DIR). In output mode, high-impedance output mode, P-channel open drain output mode, N-channel open drain output mode, or CMOS output mode can be selected by setting the Port 6 control registers 0, 1 (P6CON0, P6CON1).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 22 Port 7 22 Port 7 22.1 General Description ML620Q157A/ML620Q158A/ML620Q159A includes a 5-bit input/output port, port 7 (P70 to P74). ML620Q151A/ML620Q152A/ML620Q153A/ML620Q154A/ML620Q155A/ML620Q156A do not include the port 7. For details, see Section 1.3.2, "List of Pins". 22.1.1 Features •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 22 Port 7 22.1.3 List of Pins Pin name Primary function Secondary function Tertiary function Quartic function P70/PWM6 I/O port PWM6 output P71/PWM7 I/O port PWM7 output P72/RXD1/SIN0 I/O port UART1 data input SSIO0 data input P73/TXD1/SCK0/TXD0 I/O port UART1 data output...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 22 Port 7 22.2 Description of Registers 22.2.1 List of Registers Address Name Symbol Symbol Size Initial value (Byte) (Word) 0F26EH Port 7 data register 0F26FH Port 7 direction register P7DIR 0F270H Port 7 control register 0 P7CON0 8/16 P7CON...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 22 Port 7 22.2.2 Port 7 Data Register (P7D) Address: 0F26EH Access: R/W Access size: 8 bits Initial value: 00H P74D P73D P72D P71D P70D Initial value P7D is a special function register (SFR) to set the value to be output to the Port 7 pin or to read the input level of the Port 7. In output mode, the value of this register is output to the Port 7 pin.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 22 Port 7 22.2.3 Port 7 Direction Register (P7DIR) Address: 0F26FH Access: R/W Access size: 8 bits Initial value: 00H P7DIR P74DIR P73DIR P72DIR P71DIR P70DIR Initial value P7DIR is a special function register (SFR) to select the input/output mode of Port 7. Description of bits •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 22 Port 7 22.2.4 Port 7 Control Registers 0, 1 (P7CON0, P7CON1) Address: 0F270H Access: R/W Access size: 8/16 bit Initial value: 00H P7CON0 P74C0 P73C0 P72C0 P71C0 P70C0 Initial value Address: 0F271H Access: R/W Access size: 8 bits Initial value: 00H P7CON1 P74C1...
Page 446
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 22 Port 7 Setting of P71 pin When output mode is selected (P71DIR When input mode is selected (P71DIR bit bit = "0") = "1") P71C1 P71C0 Description High-impedance output (initial value) High-impedance input P-channel open drain output Input with a pull-down resistor N-channel open drain output Input with a pull-up resistor...
Page 448
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 22 Port 7 • P71MD1, P71MD0 (bit 1) The P71MD1 and P71MD0 bits are used to select the primary, secondary, or tertiary function of the P71 pin. Description P71MD1 P71MD0 General-purpose output port function (initial value) Do not use PWM7 output (PWM7) Do not use...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 22 Port 7 22.3 Description of Operation 22.3.1 Input/Output Port Functions For each pin of Port 7, either output or input is selected by setting the Port 7 direction register (P7DIR). In output mode, high-impedance output mode, P-channel open drain output mode, N-channel open drain output mode, or CMOS output mode can be selected by setting the Port 7 control registers 0, 1 (P7CON0, P7CON1).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 23 Port 8 23 Port 8 23.1 General Description This LSI includes a 8-bit input/output port, Port 8 (P80 to P87). 23.1.1 Features • Allows selection of high-impedance output, P-channel open drain output, N-channel open drain output, or CMOS output for each bit in output mode.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 23 Port 8 23.1.3 List of Pins Pin name Primary function Secondary function Tertiary function C data P80/SDA/SIN0 I/O port SSIO0 data input I/O (SDA) C clock P81/SCL/SCK0 I/O port SSIO0 clock I/O I/O (SCL) P82/SOUT0 I/O port SSIO0 data output P83/PWM5...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 23 Port 8 23.2 Description of Registers 23.2.1 List of Registers Address Name Symbol Symbol Size Initial value (Byte) (Word) 0F2DEH Port 8 data register 0F2DFH Port 8 direction register P8DIR 0F2E0H Port 8 control register 0 P8CON0 8/16 P8CON...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 23 Port 8 23.2.2 Port 8 Data Register (P8D) Address: 0F2DEH Access: R/W Access size: 8 bits Initial value: 00H P87D P86D P85D P84D P83D P82D P81D P80D Initial value P8D is a special function register (SFR) to set the value to be output to the Port 8 pin or to read the input level of the Port 8. In output mode, the value of this register is output to the Port 8 pin.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 23 Port 8 23.2.3 Port 8 Direction Register (P8DIR) Address: 0F2DFH Access: R/W Access size: 8 bits Initial value: 00H P8DIR P87DIR P86DIR P85DIR P84DIR P83DIR P82DIR P81DIR P80DIR Initial value P8DIR is a special function register (SFR) to select the input/output mode of Port 8. Description of bits •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 23 Port 8 23.2.4 Port 8 Control Registers 0, 1 (P8CON0, P8CON1) Address: 0F2E0H Access: R/W Access size: 8/16 bit Initial value: 00H P8CON0 P87C0 P86C0 P85C0 P84C0 P83C0 P82C0 P81C0 P80C0 Initial value Address: 0F2E1H Access: R/W Access size: 8 bits Initial value: 00H...
Page 457
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 23 Port 8 Setting of P84 pin When output mode is selected (P84DIR When input mode is selected (P84DIR bit bit = "0") = "1") P84C1 P84C0 Description High-impedance output (initial value) High-impedance input P-channel open drain output Input with a pull-down resistor N-channel open drain output Input with a pull-up resistor...
Page 459
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 23 Port 8 • P84MD1, P84MD0 (bit 4) The P84MD1 and P84MD0 bits are used to select the primary, secondary, or tertiary function of the P84 pin. Description P84MD1 P84MD0 General-purpose output port function (initial value) UART1 data input pin (RXD1) SSIO0 data input pin (SIN0) Do not use...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 23 Port 8 23.3 Description of Operation 23.3.1 Input/Output Port Functions For each pin of Port 8, either output or input is selected by setting the Port 8 direction register (P8DIR). In output mode, high-impedance output mode, P-channel open drain output mode, N-channel open drain output mode, or CMOS output mode can be selected by setting the Port 8 control registers 0, 1 (P8CON0, P8CON1).
Page 461
Chapter 24 Successive Approximation Type A/D Converter...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 24 Successive Approximation Type A/D Converter 24 Successive Approximation Type A/D Converter (SA-ADC) 24.1 General Description This LSI has an internal 12-channel successive approximation type A/D converter (SA-ADC). The successive approximation type A/D converter works only when the DSAD bit of the block control register 4 (BLKCON4) is set to "0".
Page 463
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 24 Successive Approximation Type A/D Converter 24.1.3 List of Pins Pin name Function Positive power supply pin for the successive approximation type A/D converter Reference power supply pin for the successive approximation type A/D converter Negative power supply pin for the successive approximation type A/D converter P30/EXI6/AIN0/P I/O port, External interrupt, PW45EV1 input, Successive approximation type A/D W45EV1...
Page 464
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 24 Successive Approximation Type A/D Converter 24.2 Description of Registers 24.2.1 List of Registers Address Name Symbol (Byte) Symbol (Word) Size Initial value 0F8D0H SA-ADC result register 0L SADR0L 8/16 SADR0 0F8D1H SA-ADC result register 0H SADR0H 0F8D2H SA-ADC result register 1L...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 24 Successive Approximation Type A/D Converter 24.2.2 SA-ADC Result Register 0L (SADR0L) Address: 0F8D0H Access: R Access size: 8/16 bit Initial value: 00H SADR0L SAR01 SAR00 Initial value SADR0L is a special function register (SFR) used to store SA-ADC conversion results on channel 0. SADR0L is updated after A/D conversion.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 24 Successive Approximation Type A/D Converter 24.2.4 SA-ADC Result Register 1L (SADR1L) Address: 0F8D2H Access: R Access size: 8/16 bit Initial value: 00H SADR1L SAR11 SAR10 Initial value SADR1L is a special function register (SFR) used to store SA-ADC conversion results on channel 1. SADR1L is updated after A/D conversion.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 24 Successive Approximation Type A/D Converter 24.2.6 SA-ADC Result Register 2L (SADR2L) Address: 0F8D4H Access: R Access size: 8/16 bit Initial value: 00H SADR2L SAR21 SAR20 Initial value SADR2L is a special function register (SFR) used to store SA-ADC conversion results on channel 2. SADR2L is updated after A/D conversion.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 24 Successive Approximation Type A/D Converter 24.2.8 SA-ADC Result Register 3L (SADR3L) Address: 0F8D6H Access: R Access size: 8/16 bit Initial value: 00H SADR3L SAR31 SAR30 Initial value SADR3L is a special function register (SFR) used to store SA-ADC conversion results on channel 3. SADR3L is updated after A/D conversion.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 24 Successive Approximation Type A/D Converter 24.2.10 SA-ADC Result Register 4L (SADR4L) Address: 0F8D8H Access: R Access size: 8/16 bit Initial value: 00H SADR4L SAR41 SAR40 Initial value SADR4L is a special function register (SFR) used to store SA-ADC conversion results on channel 4. SADR4L is updated after A/D conversion.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 24 Successive Approximation Type A/D Converter 24.2.12 SA-ADC Result Register 5L (SADR5L) Address: 0F8DAH Access: R Access size: 8/16 bit Initial value: 00H SADR5L SAR51 SAR50 Initial value SADR5L is a special function register (SFR) used to store SA-ADC conversion results on channel 5. SADR5L is updated after A/D conversion.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 24 Successive Approximation Type A/D Converter 24.2.14 SA-ADC Result Register 6L (SADR6L) Address: 0F8DCH Access: R Access size: 8/16 bit Initial value: 00H SADR6L SAR61 SAR60 Initial value SADR6L is a special function register (SFR) used to store SA-ADC conversion results on channel 6. SADR6L is updated after A/D conversion.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 24 Successive Approximation Type A/D Converter 24.2.16 SA-ADC Result Register 7L (SADR7L) Address: 0F8DEH Access: R Access size: 8/16 bit Initial value: 00H SADR7L SAR71 SAR70 Initial value SADR7L is a special function register (SFR) used to store SA-ADC conversion results on channel 7. SADR7L is updated after A/D conversion.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 24 Successive Approximation Type A/D Converter 24.2.18 SA-ADC Result Register 8L (SADR8L) Address: 0F8E0H Access: R Access size: 8/16 bit Initial value: 00H SADR8L SAR81 SAR80 Initial value SADR8L is a special function register (SFR) used to store SA-ADC conversion results on channel 8. SADR8L is updated after A/D conversion.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 24 Successive Approximation Type A/D Converter 24.2.20 SA-ADC Result Register 9L (SADR9L) Address: 0F8E2H Access: R Access size: 8/16 bit Initial value: 00H SADR9L SAR91 SAR90 Initial value SADR9L is a special function register (SFR) used to store SA-ADC conversion results on channel 9. SADR9L is updated after A/D conversion.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 24 Successive Approximation Type A/D Converter 24.2.22 SA-ADC Result Register AL (SADRAL) Address: 0F8E4H Access: R Access size: 8/16 bit Initial value: 00H SADRAL SARA1 SARA0 Initial value SADRAL is a special function register (SFR) used to store SA-ADC conversion results on channel A. SADRAL is updated after A/D conversion.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 24 Successive Approximation Type A/D Converter 24.2.24 SA-ADC Result Register BL (SADRBL) Address: 0F8E6H Access: R Access size: 8/16 bit Initial value: 00H SADRBL SARB1 SARB0 Initial value SADRBL is a special function register (SFR) used to store SA-ADC conversion results on channel B. SADRBL is updated after A/D conversion.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 24 Successive Approximation Type A/D Converter 24.2.26 SA-ADC Control Register 0 (SADCON0) Address: 0F8F0H Access: R/W Access size: 8/16 bit Initial value: 00H SADCON0 SACK SALP Initial value SADCON0 is a special function register (SFR) used to control the operation of the SA-ADC. Description of bits •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 24 Successive Approximation Type A/D Converter 24.2.27 SA-ADC Control Register 1 (SADCON1) Address: 0F8F1H Access: R/W Access size: 8 bits Initial value: 00H SADCON1 SARUN Initial value SADCON1 is a special function register (SFR) used to control the operation of the SA-ADC. Description of bits •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 24 Successive Approximation Type A/D Converter 24.2.28 SA-ADC Mode Register 0 (SADMOD0) Address: 0F8F2H Access: R/W Access size: 8 bits Initial value: 00H SADMOD0 SACH7 SACH6 SACH5 SACH4 SACH3 SACH2 SACH1 SACH0 Initial value SADMOD0 is a special function register (SFR) used to choose A/D conversion channel(s). Description of bits •...
Page 480
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 24 Successive Approximation Type A/D Converter • SACH0 (bit 0) SACH0 Description Stops conversion on channel 0 (initial value) Performs conversion on channel 0. The SACH7 to SACH0 bits are used to select channel(s) on which A/D conversion is performed. If both channel 1 and channel 0 are set to "1", A/D conversion is performed on channel 0 first, and then channel [Note] Do not start A/D conversion in the state in which all of the SACHB to SACH0 bits of SA-ADC mode register 0, 1...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 24 Successive Approximation Type A/D Converter 24.3 Description of Operation 24.3.1 Setting of A/D Conversion Channels According to the setting of SA-ADC mode register (SADMOD), A/D conversion is performed as shown below and A/D conversion results are stored in the SA-ADC result register. SA-ADC SA-ADC Remarks...
Page 483
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 24 Successive Approximation Type A/D Converter 24.3.2 Operation of the Successive Approximation Type A/D Converter For direct input, operate SA-ADC in the following procedure. 1. Before starting SA-ADC, start oscillation of the high-speed clock (OSCLK) and wait until the oscillator settles. 2....
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 25 Analogue Comparator 25 Analogue Comparator 25.1 General Description This LSI includes 1 channels of analogue comparator. Voltage comparison between two pins (CMP0P, CMP0M) that are input to the comparator is available. 25.1.1 Features • The comparator output can generate an interrupt. •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 25 Analogue Comparator 25.2 Description of Registers 25.2.1 List of Registers Address Name Symbol (Byte) Symbol Size Initial (Word) value 0F950H Comparator 0 control register 0 CMP0CON0 8/16 CMP0CON 0F951H Comparator 0 control register 1 CMP0CON1 FEUL620Q150A 25-2...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 25 Analogue Comparator 25.2.2 Comparator 0 Control Register 0 (CMP0CON0) Address: 0F950H Access: R/W Access size: 8/16 bit Initial value: 00H — — — — — — CMP0D CMP0EN CMP0CON0 Initial value CMP0CON0 is a special function register (SFR) to control the comparator. Description of bits •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 25 Analogue Comparator 25.3 Description of Operation 25.3.1 Comparator Functions The comparator compares the input voltages of the CMP0P and CMP0M pins to output the result to the CMP0D bit of the comparator n control register 0 (CMP0CON0). To use the comparator, set the port as high-impedance output in advance.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 25 Analogue Comparator 25.3.2 Interrupt Request When an interrupt edge selected by the comparator control register 1 (CMP0CON1) occurs on the comparison result of the comparator, a comparator interrupt (CMP0INT) is generated. For the comparator interrupt, the edge can be selected. Figure 25-3 shows the interrupt generation timing in rising-edge interrupt mode, in falling-edge interrupt mode, and in both-edge interrupt mode without sampling, and in rising-edge interrupt mode with sampling.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 26 LLD Circuit 26 LLD (Low Level Detector) 26.1 General Description This LSI includes a Low Level Detector (LLD). Four levels of threshold voltage can be selected by setting Code-Option. The operation (reset or interrupt) to be performed when the voltage drops below the threshold can be selected by setting Code-Option.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 26 LLD Circuit 26.2 Description of Registers 26.2.1 List of Registers Address Name Symbol (Byte) Symbol Size Initial (Word) value 0F8C1H LLD circuit control register 1 LLDCON1 FEUL620Q150A 26-2...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 26 LLD Circuit 26.2.2 LLD Circuit Control Register 1 (LLDCON1) Address: 0F8C1H Access: R/W Access size: 8 bits Initial value: 00H LLDCON1 — — — — — — LLDF ENBL Initial value LLDCON1 is a special function register (SFR) used to control the LLD circuit. Description of bits •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 26 LLD Circuit 26.3 Description of Operation 26.3.1 Threshold Voltage The value of the threshold voltage (V ) can be selected by Code-Option. Table 26-1 shows the threshold voltages and hysteresis width, and Table 26-2 shows the LLD operation selection. Table 26-1 Threshold Voltages and Accuracy Code option (FLASH address: *)
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 26 LLD Circuit 26.3.2 Operation of LLD Circuit Activation (ON) and deactivation (OFF) of LLD circuit are controlled by setting the ENBL bit of the LLD circuit control register 1 (LLDCON1), and the result of comparison of the power supply voltage (V ) to the threshold voltage is output to the LLDF bit of LLDCON1.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 27 Power Supply Circuit 27 Power Supply Circuit 27.1 General Description This LSI includes a voltage regulator circuit for internal logic (VRL). The VRL outputs the operating voltage, V , of the internal logic circuit, program memory, RAM, etc. 27.1.1 Features •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 27 Power Supply Circuit 27.2 Description of Operation After power-on, the V voltage becomes approximately 1.5 V in any operation mode. Figure 27-2 shows the operation waveforms of the power supply circuit. RESET_N pin Oscillation stabilization time Oscillation stabilization time System reset RESET_N...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 10 Watchdog Timer 28 On-chip Debug Function 28.1 General Description This LSI has an on-chip debug function allowing Flash memory rewriting. The on-chip debug emulator (µEASE) is connected to this LSI to perform the on-chip debug function. 28.2 How to connect the On-Chip Debug Emulator Figure 28-1 shows connection to the on-chip debug emulator (µEASE).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 29 Flash Memory Rewrite Function 29 FLASH Memory Rewrite Function 29.1 General Description This LSI includes the ISP (In System Programming) function and boot area remap function that rewrite the content of the flash memory (program memory space) using a special function register (SFR) programmatically. ...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 29 Flash Memory Rewrite Function 29.2 Description of Registers 29.2.1 List of Registers Address Name Symbol Symbol Size Initial (Byte) (Word) value 0F0E0H Flash address register L FLASHAL 8/16 FLASHA 0F0E1H Flash address register H FLASHAH 0F0E2H Flash data register L FLASHDL...
Page 506
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 29 Flash Memory Rewrite Function Table 29-1 Address Setting Values for Block Erase (ML620Q151A/ML620Q154A/ML620Q157A) Area for block erase FLASHSEG FLASHAH Segment Address 0:0000H 0:1FFFH 0:2000H 0:3FFFH Segment 0 0:4000H 0:5FFFH 0:6000H 0:7FFFH Segment 7 7:0000H 7:07FFH The unit of block is 8 KB for the segment 0 and 2 KB for the segment 7.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 29 Flash Memory Rewrite Function 29.2.4 Flash Control Register (FLASHCON) Address: 0F0E4H Access: W Access size: 8 bits Initial value: 00H FLASHCON — — — — — — FSERA FERS Initial value FLASHCON is a write-only special function register (SFR) to control the block erase and sector erase for the flash memory rewrite.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 29 Flash Memory Rewrite Function 29.2.5 Flash Acceptor (FLASHACP) Address: 0F0E6H Access: W Access size: 8 bits Initial value: 00H FLASHACP fac7 fac6 fac5 fac4 fac3 fac2 fac1 fac0 Initial value FLASHACP is a write-only special function register (SFR) to control the block erase for the flash memory rewrite or enable/disable the 1-word write operation.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 29 Flash Memory Rewrite Function 29.2.7 Flash Self Register (FLASHSLF) Address: 0F0EAH Access: R/W Access size: 8 bits Initial value: 00H FLASHSLF — — — — — — — FSELF Initial value FLASHSLF is a special function register (SFR) used to control the flash memory self-rewrite function. Description of bits •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 29 Flash Memory Rewrite Function 29.2.8 Flash Remap Register (REMAPADD) Address: 0F0ECH Access: R/W Access size: 8 bits Initial value: 00H REMAPADD RBTA RES2 RES1 RES0 REA15 REA14 REA13 REA12 Initial value REMAPADD is a special function register (SFR) used to specify the remap area. In REMAPADD, the following two types of remapping can be specified.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 29 Flash Memory Rewrite Function 29.3 Description of Operation When using the self-rewrite function, prepare the program for self-rewrite in advance on a program code area with addresses that are not used for block/sector erase or 1-word write. The self-rewrite function includes the block erase function that erases by 8 K words (16 Kbytes), the sector erase function that erases by 512 words (1 Kbyte), and the 1-word write function that writes by 1 word (2 bytes).
Page 515
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 29 Flash Memory Rewrite Function 8.192 MHz, 4.096 MHz, 2.048 MHz, and 1.024 MHz is used as the system clock.) For details of clock modes and settings, see Chapter 6, "Clock Generation Circuit". Note on debugging flash self-write code using the U16 development environment are described below. Table 29-8 Cautions When Debugging Flash Self-Write Code State of use Cautions...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 29 Flash Memory Rewrite Function 29.3.1 Block Erase Function This function erases the flash memory data by block (8 Kbytes). Writing "01H" to the flash self register starts voltage multiplying in the LSI, and rewrite operation becomes enabled. Write "0FAH"...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 29 Flash Memory Rewrite Function 29.3.2 Sector Erase Function This function erases the flash memory data by sector (1 Kbytes). Writing "01H" to the flash self register starts voltage multiplying in the LSI, and rewrite operation becomes enabled. After checking the completion of voltage multiplying with the flash status register, write "0FAH"...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 29 Flash Memory Rewrite Function 29.3.3 1-word Write Function This function writes data to the flash memory by 1 word (2 bytes). Writing "01H" to the flash self register starts voltage multiplying in the LSI, and rewrite operation becomes enabled. After checking the completion of voltage multiplication with the flash status register, write "0FAH"...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 29 Flash Memory Rewrite Function 29.3.4 Boot Area Remap Function by Software This function can remap the area from 0000H to 0FFFH (4 KB) to the area of the same size (4 KB or less) starting from the address set in the REMAPADD register.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 29 Flash Memory Rewrite Function 29.3.5 Notes in Use When the power is down or the operation is terminated forcibly during block/sector erase or 1-word write, retry the block erase and rewrite the block area of 8K words. If the self-rewrite program does not work, write the program by using the on-chip debug emulator (µEASE).
Page 522
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 30 Code-Option 30 Code-Option 3.1 General Description This LSI has the code-option function. The code-option function can select the low-speed oscillation clock (External crystal oscillation or Internal RC oscillation), LLD circuit operation (Interrupt of Reset) and the LLD threshold voltage level. 3.1.1 Features •...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 30 Code-Option 30.2.2 Code-Option Register 0 (CODEOP0) Address: 0F3D8H Access: R Access size: 8 bits Initial value: 00H ―* ―* ―* ―* CODEOP0 COLOSC LLDSEL LLD1 LLD0 Initial value CODEOP0 is a special function register (SFR) that can read Code-Option data. CODEOP0 is read only register and is not waritable by the software.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Chapter 30 Code-Option 30.3 The Setting Method of the Code-Option Data 30.3.1 Code-Option Data Format ML620Q151A/ML620Q154A/ML620Q157A : The code-option data is set on address 0:7DE0H which is in writable test data area of program memory. ML620Q152A/ML620Q155A/ML620Q158A : The code-option data is set on address 0:BDE0H which is in writable test data area of program memory.
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Appendix A Registers Contents of Registers Address Symbol Symbol 8/16 Initial name Byte Word value - 0F000H Data segment register - - - - - 0F001H Reserve 0F002H Frequency control register 0 FCON0 8/16 FCON 0F003H Frequency control register 1 FCON1 0F005H Frequency control register 3...
Page 527
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Appendix A Registers Address Symbol Symbol 8/16 Initial name Byte Word value 0F02EH Interrupt level control register 50 ILC50 8/16 ILC5W 0F02FH Interrupt level control register 51 ILC51 0F030H Interrupt level control register 60 ILC60 8/16 ILC6W 0F031H Interrupt level control register 61 ILC61...
Page 528
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Appendix A Registers Address Symbol Symbol 8/16 Initial name Byte Word value - 0F21BH Port 1 direction register P1DIR 0F21CH Port 1 control register 0 P1CON0 8/16 P1CON 0F21DH Port1 control register 1 P1CON1 - 0F228H Port 2 data register -...
Page 529
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Appendix A Registers Address Symbol Symbol 8/16 Initial name Byte Word value 0F310H Timer 0 counter register TM0C 8/16 TM01C Timer 1 counter register 0F311H TM1C 0F320H Timer 0 control register TM0CON 8/16 TM01CO 0F321H Timer 1 control register TM1CON -...
Page 530
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Appendix A Registers 0F4A7H PWM4 control register 1 PW4CON1 Address Symbol Symbol 8/16 Initial name Byte Word value 0F4A8H PWM4 control register 2 PW4CON2 8/16 PW4CON 0F4A9H PWM4 control register 3 PW4CON3 0F4AAH PWM4 control register 4 PW4CON4 8/16 PW4CON...
Page 531
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Appendix A Registers Address Symbol Symbol 8/16 Initial name Byte Word value 0F700H Serial port 0 transmit/receive buffer L SIO0BUFL SIO0BUF 8/16 0F701H Serial port 0 transmit/receive buffer H SIO0BUFH - 0F702H Serial port 0 control register SIO0CON 0F704H Serial port 0 mode register 0...
Page 532
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Appendix A Registers Address Symbol Symbol 8/16 Initial name Byte Word value 0F8DCH SA-ADC result register 6L SADR6L SADR6 8/16 SA-ADC result register 6H 0F8DDH SADR6H 0F8DEH SA-ADC result register 7L SADR7L SADR7 8/16 0F8DFH SA-ADC result register 7H SADR7H 0F8E0H SA-ADC result register 8L...
The surface mount type packages are very susceptible to heat in reflow mounting and humidity absorbed in storage. Therefore, before you perform reflow mounting, contact a ROHM sales office for the product name, package name, pin number, package code and desired mounting conditions (reflow method, temperature and times).
The surface mount type packages are very susceptible to heat in reflow mounting and humidity absorbed in storage. Therefore, before you perform reflow mounting, contact a ROHM sales office for the product name, package name, pin number, package code and desired mounting conditions (reflow method, temperature and times).
The surface mount type packages are very susceptible to heat in reflow mounting and humidity absorbed in storage. Therefore, before you perform reflow mounting, contact a ROHM sales office for the product name, package name, pin number, package code and desired mounting conditions (reflow method, temperature and times).
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Appendix C Electrical Characteristics Appendix C Electrical Characteristics Absolute Maximum Ratings = 0V) Parameter Symbol Condition Rating Unit −0.3 to +6.5 Power supply voltage 1 Ta = 25°C −0.3 to +2.0 Power supply voltage 2 Ta = 25°C −0.3 to V Reference voltage Ta = 25°C...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Appendix C Electrical Characteristics Flash Memory Operating Conditions = 0V) Parameter Symbol Condition Range Unit Data flash memory, At write/erase -40 to +105 °C Operating temperature Flash ROM, At write/erase 0 to +40 Operating voltage At write/erase 1.8 to 5.5 Data Flash 10,000...
Page 540
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Appendix C Electrical Characteristics DC Characteristics (LLD) =2.2 to 5.5V, V =0V, Ta=−40 to +105°C, unless otherwise specified) Meas Parameter Symbol Condition Min. Typ. Max. Unit uring circuit LD1 to 0 = 0H LD1 to 0 = 1H 2.45 2.55 2.65...
Page 541
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Appendix C Electrical Characteristics DC Characteristics (VOHL, IOHL) =1.8 to 5.5V, V =0V, Ta=−40 to +105°C, unless otherwise specified) Measuring Parameter Symbol Condition Min. Typ. Max. Unit circuit Output voltage 1 (P20 to P23) IOH1 = −0.5mA ―...
Page 542
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Appendix C Electrical Characteristics DC Characteristics (VIHL) =1.8 to 5.5V, V =0V, Ta=−40 to +105°C, unless otherwise specified) Measuring Parameter Symbol Condition Min. Typ. Max. Unit circuit Input voltage 1 (RESET_N) (P14/TEST0) 0.7× ― ― VIH1 (TEST1_N) (P00 to P05)* (P12, P13) (P30 to P37)*...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Appendix C Electrical Characteristics AC Characteristics (Synchronous Serial Port) =1.8 to 5.5V, V =0V, Ta=−40 to +105°C, unless otherwise specified) Parameter Symbol Condition Min. Typ. Max. Unit µs ― ― High-speed oscillation stopped SCK input cycle SCYC ―...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Appendix C Electrical Characteristics AC Characteristics (I C Bus Interface: Standard Mode 100kHz) =1.8 to 5.5V, V =0V, Ta=−40 to +105°C, unless otherwise specified) Rating Parameter Symbol Condition Unit Min. Typ. Max. ⎯ ⎯ SCL clock frequency SCL hold time ⎯...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Appendix C Electrical Characteristics Electrical Characteristics of Successive Approximation Type A/D Converter =1.8 to 5.5V, V =0V, Ta=−40 to +105°C, unless otherwise specified) Parameter Symbol Condition Min. Typ. Max. Unit ― ― ― Resolution bits 2.7V ≤ V ≤...
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Appendix E Check List Appendix E Check List This Check List has notes to prevent commonly-made programming mistakes and frequently overlooked or misunderstood hardware features of the MCU. Check each note listed up chapter by chapter while coding the program or evaluating it using the MCU. Chapter 1 Overview •About unused pins [ ] Please confirm how to handle the unused pins(Refer to Section 1.3.4 in the user’s manual).
Page 553
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Appendix E Check List (*) ML620Q150A series have a different pin configuration for each package. See the section 1.3.2 “LIST OF PINS” for more details. Chapter 7 Time Base Counter •How to read LTBC [ ] Read consecutively LTBC(Low-speed Time Base Counter) twice until the last data coincides the previous data to prevent reading of uncertain data while counting up the clock (Refer to Section 7.3.1 in the user's manual).
Page 554
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Appendix E Check List (*) ML620Q150A series have a different pin configuration for each package. See the section 1.3.2 “LIST OF PINS” for more details. •Port function setting [ ] Specify the secondary function for the port (Refer to Section 14.4 in the user’s manual). Chapters 15 to 23 Port •Pin Handling [ ] Don’t leave Hi-impedance Input ports in floating state.
Page 556
ML620Q151A/2A/3A/4A/5A/6A/7A/8A/9A User's Manual Revision of History Revision History Page Document No. Date Description Previous Current Edition Edition FEU620Q150A-01 May 7, 2015 – – Fromal 1 Revision 16-1, 16-1, 16-4, 16-4, FEU620Q150A-02 May 25, 2015 Add a notice about P14DIR bit. 16-6, 16-6, 28-1...
Need help?
Do you have a question about the LAPIS ML620Q150A Series and is the answer not in the manual?
Questions and answers