US Export Administration Regulations and the Foreign Exchange and Foreign Trade Act. 13) This document, in part or in whole, may not be reprinted or reproduced without prior consent of LAPIS Semiconductor. Copyright 2013-2016 LAPIS Semiconductor Co., Ltd.
ML610Q111/ML610Q112 User’s Manual Preface This manual describes the operation of the hardware of the 8-bit microcontroller ML610Q111 / ML610Q112. The following manuals are also available. Read them as necessary. nX-U8/100 Core Instruction Manual Description on the basic architecture and the each instruction of the nX-U8/100 Core ...
ML610Q111/ML610Q112 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 ♦...
Page 7
ML610Q111/ML610Q112 User’s Manual Contents 7.2.1 List of Registers ..........................7-3 7.2.2 Low-Speed Time Base Counter (LTBR) ..................7-4 7.2.3 High-Speed Time Base Counter Divide Register (HTBDR) ............7-5 Description of Operation ........................7-6 7.3.1 Low-Speed Time Base Counter ....................7-6 7.3.2...
Page 8
ML610Q111/ML610Q112 User’s Manual Contents 9.1.2 Configuration ..........................9-1 9.2 Description of Registers ......................... 9-2 9.2.1 List of Registers ..........................9-2 9.2.2 Watchdog Timer Control Register (WDTCON) ................9-3 9.2.3 Watchdog Timer Mode Register (WDTMOD) ................9-4 9.3 Description of Operation ........................9-5 9.3.1...
Page 9
ML610Q111/ML610Q112 User’s Manual Contents Chapter 11 11 Synchronous Serial Port ..........................11-1 11.1 Overview .............................. 11-1 11.1.1 Features ............................11-1 11.1.2 Configuration ..........................11-1 11.1.3 List of Pins..........................11-2 11.2 Description of Registers ........................11-3 11.2.1 List of Registers .......................... 11-3 11.2.2...
Page 10
ML610Q111/ML610Q112 User’s Manual Contents Chapter 13 13 I2C Bus Interface Master ........................... 13-1 13.1 Overview .............................. 13-1 13.1.1 Features ............................13-1 13.1.2 Configuration ..........................13-1 13.1.3 List of Pins..........................13-1 13.2 OverviewDescription of Registers ....................... 13-2 13.2.1 List of Registers .......................... 13-2 13.2.2...
Page 11
ML610Q111/ML610Q112 User’s Manual Contents 15.1.2 Configuration ..........................15-2 15.1.3 List of Pins..........................15-3 15.2 Description of Registers ........................15-4 15.2.1 List of Registers .......................... 15-4 15.2.2 Port A Data Register (PAD) ......................15-5 15.2.3 Port A Direction Register (PADIR) .................... 15-6 15.2.4...
Page 12
ML610Q111/ML610Q112 User’s Manual Contents 18.3 Description of Operation ........................18-8 18.3.1 Input/Output Port Functions ....................... 18-8 Chapter 19 19 Port AB Interrupts ............................19-1 19.1 Overview .............................. 19-1 19.1.1 Features ............................19-1 19.1.2 Configuration ..........................19-1 19.2 Description of Registers ........................19-1 19.2.1...
Page 13
ML610Q111/ML610Q112 User’s Manual Contents Chapter 22 22 Analog Comparator ........................... 22-1 22.1 Overview .............................. 22-1 22.1.1 Features ............................22-1 22.1.2 Configuration ..........................22-1 22.1.3 List of Pins..........................22-2 22.2 Description of Registers ........................22-2 22.2.1 List of Registers .......................... 22-2 22.2.2...
ML610Q111/ML610Q112 User’s Manual Chapter 1 Overview 1 Overview Features This LSI is a high-performance 8-bit CMOS microcontroller into which rich peripheral circuits, such as timers, PWM, UART, I C bus interface (master/slave), synchronous serial port, voltage level supervisor (VLS) function, and 10-bit successive approximation type A/D converter, are incorporated around 8-bit CPU nX-U8/100.
Page 16
Internal reference voltage : 0.1-0.8V (Selectable in 50mV increments) − Hysteresis (Comparator0 only): 20mV(Typ.) − Allows selection of with/without interrupt sampling and interrupt edge. • General-purpose ports (GPIO) − ML610Q111 : Input/output port × 15 channels − ML610Q112 : Input/output port × 25 channels FEUL610Q111...
ML610Q111/ML610Q112 User’s Manual Chapter 1 Overview 1.3.2 List of Pins Table 1-1 shows list of pins. In the I/O column, “—” denotes a power supply pin, “I” an input pin, “O” an output pin, and “I/O” an input/output pin. Table 1-1 List of pins PIN No.
Page 21
ML610Q111/ML610Q112 User’s Manual Chapter 1 Overview PIN No. Primary function Secondary function Tertiary function quaternary function Descrip Descrip Descript Description LQFP TSSOP name name tion name tion name PWMF PWMF TM9O timer 9 Input/output port 0output output...
ML610Q111/ML610Q112 User’s Manual Chapter 1 Overview 1.3.3 Description of Pins Table 1-2 shows description of pins. Table 1-2 (1/3) Description of pins Primary/ Secondary/ Pin name Description Logic Tertiary/ Quaternary System Reset input pin. When this pin is set to a “L” level, system reset mode is set and the internal section is initialized.
Page 23
ML610Q111/ML610Q112 User’s Manual Chapter 1 Overview Table 1-2 (2/3) Description of pins Primary/ Secondary/ Pin name Description Logic Tertiary/ Quaternary Timer TETG, External clock input pin used for both Timer E and Timer F. These pins Primary — TFTG are used as the primary function of the PA0-PA2, PB0-PB7 pins.
Page 24
ML610Q111/ML610Q112 User’s Manual Chapter 1 Overview Table 1-2 (3/3) Description of pins Primary/ Secondary/ Pin name Description Logic Tertiary/ Quaternary For testing I/O Input/output pin for testing. A pull-down resistor is internally connected. TEST — Positive Test pin for flash memory. A pull-down resistor is internally connected.
ML610Q111/ML610Q112 User’s Manual Chapter 1 Overview 1.3.4 Termination 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 TEST Open TESTF Open PA0 to PA2 Open PB0 to PB7...
The vector table, which has 16-bit long data, can be used as reset vectors, hardware interrupt vectors, and software interrupt vectors. The unused software interrupt vector can use as a program code area. The program memory space consists of 1 segment and ML610Q111 has 24-Kbyte (12-Kword) capacity, ML610Q112 has 32-Kbyte (16-Kword) capacity.
Page 28
ML610Q111/ML610Q112 User’s Manual Chapter 2 CPU and Memory Space CSR:PC Segment 0 0:0000H Vector Table Area Program Code 0:00FFH ROM Window Area 0:0100H Program Code Area ROM Window Area 0:7FDFH 0:7FE0H Test Data Area 0:7FFFH 8bit Figure 2-2 Configuration of Program Memory Space of the ML610Q112 Notes: −...
Data Memory Space The data memory space of this LSI consists of the ROM window area, 2-Kbyte RAM area(ML610Q111), 4-Kbyte RAM area(ML610Q112) and SFR area and 4-Kbyte Segment 2 of the data flash area and the ROM reference areas of the Segment 8 and the data flash reference areas of the Segment A.
Page 30
ML610Q111/ML610Q112 User’s Manual Chapter 2 CPU and Memory Space DSR: Data Segment 2 Segment 0 address DSR: Data address 2:0000H 0:0000H Data Flash Area ROM Window Area 2:0FFFH 2:1000H 0:5FFFH 0:6000H Unused Area 0:0DFFFH 0:0E000H Unused Area RAM Area 4 KB...
ML610Q111/ML610Q112 User’s Manual Chapter 2 CPU and Memory Space Instruction Length The length of an instruction is 16 bits. Data Type The data types supported include byte (8 bits) and word (16 bits). FEUL610Q111...
ML610Q111/ML610Q112 User’s Manual Chapter 2 CPU and Memory Space Description of Registers 2.6.1 List of Registers Address Name Symbol (Byte) Symbol (Word) Size Initial value 0F000H Data segment register FEUL610Q111...
ML610Q111/ML610Q112 User’s Manual Chapter 2 CPU and Memory Space 2.6.2 Data Segment Register (DSR) Address: 0F000H Access: R/W Access size: 8 bits Initial value: 00H DSR3 DSR2 DSR1 DSR0 Initial value DSR is a special function register (SFR) to retain a data segment address. For details of DSR, see “nX-U8/100 Core Instruction Manual”.
ML610Q111/ML610Q112 User’s Manual Chapter 3 Reset Function 3 Reset Function Overview This LSI has the five reset functions shown below. If any of the five reset conditions is satisfied, this LSI enters system reset mode. • Reset by the RESET_N pin •...
ML610Q111/ML610Q112 User’s Manual Chapter 3 Reset Function Description of Registers 3.2.1 List of Registers Address Name Symbol (Byte) Symbol (Word) Size Initial value 0F001H Reset status register RSTAT Undefined 3.2.2 Reset Status Register (RSTAT) Address: 0F001H Access: R/W Access size: 8 bits Initial value: Undefined ―...
ML610Q111/ML610Q112 User’s Manual Chapter 3 Reset Function Description of Operation 3.3.1 Operation of System Reset Mode System reset has the highest priority among all the processing and any other processing being executed up to then is cancelled. The system reset mode is set by any of the following causes.
ML610Q111/ML610Q112 User’s Manual Chapter 4 MCU Control Function 4 MCU Control Function Overview The operating states of this LSI are classified into the following 4 modes including system reset mode: • System reset mode • Program run mode • HALT mode •...
ML610Q111/ML610Q112 User’s Manual Chapter 4 MCU Control Function Description of Registers 4.2.1 List of Registers Address Name Symbol (Byte) Symbol (Word) Size Initial value 0F008H Stop code acceptor STPACP 0F009H Standby control register SBYCON 0F02AH Block control register 2 BLKCON2 ...
ML610Q111/ML610Q112 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) which enables for entering a STOP mode.
ML610Q111/ML610Q112 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 ― ― ― ― ― ― Initial value SBYCON is a special function register (SFR) to control operating mode of MCU.
ML610Q111/ML610Q112 User’s Manual Chapter 4 MCU Control Function 4.2.4 Block Control Register 2 (BLKCON2) Address: 0F02AH Access: R/W Access size: 8 bits Initial value: 00H BLKCON2 DI2C0 DI2C1 DUA1 DUA0 DSIO0 Initial value BLKCON2 is a special function register (SFR) that controls the operation of the relevant block.
ML610Q111/ML610Q112 User’s Manual Chapter 4 MCU Control Function 4.2.6 Block Control Register 6 (BLKCON6) Address: 0F02EH Access: R/W Access size: 8 bits Initial value: 00H BLKCON6 DTMF DTME DTMB DTMA DTM9 DTM8 Initial value BLKCON6 is a special function register (SFR) that controls the operation of the relevant block.
Page 46
ML610Q111/ML610Q112 User’s Manual Chapter 4 MCU Control Function Note: − If the appropriate bit is set to “1” (operation disabled), the relevant block will be reset (all registers are initialized), and the clock of the relevant block will stop. When this bit is set to "1", the writing to all the registers of the relevant block will be invalid, an initial value is read when a register is read.
ML610Q111/ML610Q112 User’s Manual Chapter 4 MCU Control Function 4.2.7 Block Control Register 7 (BLKCON7) Address: 0F02FH Access: R/W Access size: 8 bits Initial value: 00H BLKCON7 DPWF DPWE DPWD DPWC Initial value BLKCON7 is a special function register (SFR) that controls the operation of the relevant block.
ML610Q111/ML610Q112 User’s Manual Chapter 4 MCU Control Function Description of Operation 4.3.1 Program Run Mode The program run mode is the state where the CPU executes instructions sequentially. At power-on reset, RESET_N pin reset, low level detection reset, VLS reset, or WDT overflow 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.
ML610Q111/ML610Q112 User’s Manual Chapter 4 MCU Control Function 4.3.3 STOP Mode The STOP mode is the state where low-speed oscillation and high-speed oscillation stop and the CPU and peripheral circuits stop the operation. When the entering the STOP mode is enabled by writing “5nH” (n: an arbitrary value) and “0AnH” (n: an arbitrary value) to the stop code acceptor (STPACP) sequentially and the STP bit of the standby control register (SBYCON) is set to “1”,...
ML610Q111/ML610Q112 User’s Manual Chapter 4 MCU Control Function 4.3.3.2 STOP Mode When CPU Operates with High-Speed Clock When the CPU is operating with a high-speed clock and the STP bit of SBYCON is set to “1” with the entering the STOP mode enabled (by using the stop code acceptor(STPACP)), the STOP mode is entered and high-speed oscillation and low-speed oscillation stop.
ML610Q111/ML610Q112 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 mode and HALT mode varies according to the interrupt level (ELEVEL) of the program status word (PSW), master interrupt enable flag (MIE), the contents of the interrupt enable register (IE0 to IE7), and whether the interrupt is a non-maskable interrupt or a maskable interrupt.
ML610Q111/ML610Q112 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. When certain bits of block control registers are set to “1”, corresponding peripherals are reset (all registers are reset) and operating clocks for the peripherals stop.
ML610Q111/ML610Q112 User’s Manual Chapter 5 Interrupts (INTs) 5 Interrupts (INTs) Overview This LSI has 31 interrupt sources (External interrupts: 7 sources, Internal interrupts: 24 sources) and a software interrupt (SWI). For details of each interrupt, see the following chapters: Chapter 7, “Time Base Counter”...
ML610Q111/ML610Q112 User’s Manual Chapter 5 Interrupts (INTs) 5.2.3 Interrupt Enable Register 1 (IE1) Address: 0F011H Access: R/W Access size: 8 bits Initial value: 00H EPB3 EPB2 EPB1 EPB0 EPA2 EPA1 EPA0 Initial value IE1 is a special function register (SFR) to control enable/disable for each interrupt request.
Page 58
ML610Q111/ML610Q112 User’s Manual Chapter 5 Interrupts (INTs) • EPB2 (bit 6) EPB2 is the enable flag for the input/output port PB2 pin interrupt (PB2INT). EPB2 Description Disabled (initial value) Enabled • EPB3 (bit 7) EPB3 is the enable flag for the input/output port PB3 pin interrupt (PB3INT).
ML610Q111/ML610Q112 User’s Manual Chapter 5 Interrupts (INTs) 5.2.11 Interrupt Request Register 1 (IRQ1) Address: 0F019H Access: R/W Access size: 8 bits Initial value: 00H IRQ1 QPB3 QPB2 QPB1 QPB0 QPA2 QPA1 QPA0 Initial value IRQ1 is a special function register (SFR) to request an interrupt for each interrupt source.
Page 67
ML610Q111/ML610Q112 User’s Manual Chapter 5 Interrupts (INTs) • QPB1 (bit 5) QPB1 is the request flag for the input port PB1 pin interrupt (PB1INT). QPB1 Description No request (initial value) Request • QPB2 (bit 6) QPB2 is the request flag for the input port PB2 pin interrupt (PB2INT).
ML610Q111/ML610Q112 User’s Manual Chapter 5 Interrupts (INTs) 5.2.16 Interrupt Request Register 6 (IRQ6) Address: 0F01EH Access: R/W Access size: 8 bits Initial value: 00H IRQ6 Q32H Q128H QPWF QPWE QPWD QPWC Initial value IRQ6 is a special function register (SFR) to request an interrupt for each interrupt source.
Page 73
ML610Q111/ML610Q112 User’s Manual Chapter 5 Interrupts (INTs) • Q32H (bit 7) Q32H is the request flag for the time base counter 32 Hz interrupt (T32HINT). Q32H Description No request (initial value) Request 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.
ML610Q111/ML610Q112 User’s Manual Chapter 5 Interrupts (INTs) Description of Operation With the exception of the watchdog timer interrupt (WDTINT), interrupt enable/disable for 30 sources is controlled by the master interrupt enable flag (MIE) and the individual interrupt enable registers (IE0 to 7). WDTINT is non-maskable interrupts.
ML610Q111/ML610Q112 User’s Manual Chapter 5 Interrupts (INTs) 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.
ML610Q111/ML610Q112 User’s Manual Chapter 5 Interrupts (INTs) 5.3.4 Notes on Interrupt Routine 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 78
ML610Q111/ML610Q112 User’s Manual Chapter 5 Interrupts (INTs) 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 79
ML610Q111/ML610Q112 User’s Manual Chapter 5 Interrupts (INTs) State B: Non-maskable interrupt is being processed B-1: When a subroutine is not called • Processing immediately after the start of interrupt routine execution Specify the RTI instruction to return the contents of the ELR register to PC and those of the EPSW register to PSW.
ML610Q111/ML610Q112 User’s Manual Chapter 5 Interrupts (INTs) 5.3.5 Interrupt Disable State Even if the interrupt conditions are satisfied, an interrupt may not be accepted depending on the operating state. This is called an interrupt disabled state. See below for the interrupt disabled state and the handling of interrupts in this state.
ML610Q111/ML610Q112 User’s Manual Chapter 6 Clock Generation Circuit 6.1.3 List of Pins Pin name Description High-speed clock output pin PA0/OUTCLK Used for the tertiary function of the PA0 pin High-speed clock output pin PB0/OUTCLK Used for the tertiary function of the PB0 pin...
Page 84
ML610Q111/ML610Q112 User’s Manual Chapter 6 Clock Generation Circuit 6.2.2 Frequency Control Register 0 (FCON0) Address: 0F002H Access: R/W Access size: 8/16 bits Initial value: 3BH FCON0 OUTC1 OUTC0 OSCM1 OSCM0 SYSC1 SYSC0 Initial value FCON0 is a special function register (SFR) to control the high-speed clock generation circuit and to select system clock.
Page 85
ML610Q111/ML610Q112 User’s Manual Chapter 6 Clock Generation Circuit 6.2.3 Frequency Control Register 1 (FCON1) Address: 0F003H Access: R/W Access size: 8 bits Initial value: 00H FCON1 LPLL ENOSC SYSCLK Initial value FCON1 is a special function register (SFR) to control the high-speed clock generation circuit and to select system clock.
ML610Q111/ML610Q112 User’s Manual Chapter 6 Clock Generation Circuit Description of Operation 6.3.1 Low-Speed Clock 6.3.1.1 Low-Speed Clock Generation Circuit (built-in RC oscillating circuit) Figure 6-2 shows the circuit configuration of the low-speed clock generation circuit. The 32.768kHz RC oscillation clock generation circuit is activated by the occurrence of power ON reset or port reset or WDT reset or VLS reset.
ML610Q111/ML610Q112 User’s Manual Chapter 6 Clock Generation Circuit 6.3.1.2 Operation of Low-Speed Clock Generation Circuit The low-speed clock generation circuit is activated by the occurrence of power-on reset. The low-speed clock (LSCLK) is supplied to the peripheral circuits after a lapse of the low-speed clock oscillation stabilization period (256 counts) after power-on.
ML610Q111/ML610Q112 User’s Manual Chapter 6 Clock Generation Circuit 6.3.2 High-Speed Clock For the high-speed clock generation circuit, built-in PLL oscillation mode or external clock input mode can be selected by the OSCM1 bit and OSCM0 bit of the frequecy control register0 (FCON0).
ML610Q111/ML610Q112 User’s Manual Chapter 6 Clock Generation Circuit 6.3.2.2 High-Speed External Clock Input Mode In high-speed external clock input mode, an external clock is input from the PA2 or PB6/CLKIN pin. When set as external clock input mode(OSCM0=”1”), supply of OSCLK is started after permitting an oscillation(ENOSC is set to "1.") and counting an external input clock 128 times.
ML610Q111/ML610Q112 User’s Manual Chapter 6 Clock Generation Circuit 6.3.2.3 Operation of High-Speed Clock Generation Circuit For the high-speed clock generation circuit, starting/stopping oscillation can be controlled by the frequency control register 0,1 (FCON0,1). After selecting high-speed oscillation mode and its frequency in FCON0, the oscillation will be started if the ENOSC bit of FCON1 is set to "1."...
ML610Q111/ML610Q112 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-7 shows a flow of system clock switching processing (HSCLK→LSCLK) and Figure 6-8 shows a flow of system clock switching processing (LSCLK→HSCLK).
ML610Q111/ML610Q112 User’s Manual Chapter 6 Clock Generation Circuit Specifying port registers For enable a clock output function, each related port register needs to be set up. Refer to the Chapter 15, “Port A” and the Chapter 16 “Port B” for details of each register.
ML610Q111/ML610Q112 User’s Manual Chapter 6 Clock Generation Circuit 6.4.2 Functioning PB0 (OUTCLK) as the High speed clock output Set PB0MD1 bit (bit0 of PBMOD1 register) to “1” for specifying the low speed clock output as the tertiary function of PB0.
ML610Q111/ML610Q112 User’s Manual Chapter 6 Clock Generation Circuit 6.4.3 Functioning PA2 (CLKIN) as the External clock input Set PA2MD1 bit (bit2 of PAMOD1 register) to “1” as the tertiary function of PA2. Reg. name PAMOD1 register (Address: 0F255H) ...
ML610Q111/ML610Q112 User’s Manual Chapter 7 Time Base Counter 7 Time Base Counter Overview This LSI includes a low-speed time base counter (LTBC) and a high-speed time base counter (HTBC) that generate base clocks for peripheral circuits. By using the time base counter, it is possible to generate events periodically.
Page 97
ML610Q111/ML610Q112 User’s Manual Chapter 7 Time Base Counter HSCLK HTBDR HTBCLK (8.192MHz) 1/n-Counter 8.192MHz to 512kHz RESET Data bus HTBDR: High-speed time base counter frequency divide register Figure 7-2 Configuration of High-Speed Time Base Counter Note: The frequency of HSCLK is changed by setting of SYSC1 bit and SYSC0 bit in the frequency control register 0 (FCON0).
ML610Q111/ML610Q112 User’s Manual Chapter 7 Time Base Counter Description of Registers 7.2.1 List of Registers Initial Address Name Symbol (Byte) Symbol (Word) Size value Low-speed time base counter register 0F00AH LTBR High-speed time base counter 0F00BH HTBDR frequency divide register...
ML610Q111/ML610Q112 User’s Manual Chapter 7 Time Base Counter 7.2.2 Low-Speed Time Base Counter (LTBR) Address: 0F00AH 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.
ML610Q111/ML610Q112 User’s Manual Chapter 7 Time Base Counter 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, T32HZ, T16HZ, and T2HZ outputs of LTBC are used as interrupts and an interrupt is requested on the falling edge of each output.
ML610Q111/ML610Q112 User’s Manual Chapter 7 Time Base Counter 7.3.2 High-Speed Time Base Counter The high-speed time base counter is configured as a 4-bit 1/n counter (n = 1 to 16). In the 4-bit 1/n counter, the divided clock (1/16×HSCLK to 1/1×HSCLK) selected by the high-speed time base counter divide register (HTBDR) is generated as HTBCLK.
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers 8 Timers Overview This LSI includes 6 channels of 8-bit timers. 8.1.1 Features • The timer interrupt (TMnINT) is generated when the values of timer counter register (TMnC, n=8, 9, A, B, E, F) and timer data register (TMnD) coincide.
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers 8.1.3 List of Pins Pin name Input/output Function External trigger input of timer E/F PA0/TnTG/TM9OUT Timer 9 output pin: Use for the quaternary function of PA0. External trigger input of timer E/F PA1/TnTG/TMFOUT Timer F output pin: Use for the quaternary function of PA1.
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers Description of Registers 8.2.1 List of Registers Address Name Symbol (Byte) Symbol (Word) Size Initial value 0F8E0H Timer 8 data register TM8D 8/16 0FFH TM8DC 0F8E1H Timer 8 counter register TM8C 0F8E2H Timer 8 control register 0...
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers 8.2.2 Timer 8 Data Register (TM8D) Address: 0F8E0H Access: R/W Access size: 8/16 bits Initial value: 0FFH TM8D T8D7 T8D6 T8D5 T8D4 T8D3 T8D2 T8D1 T8D0 Initial value TM8D is a special function register (SFR) to set the value to be compared with the Timer 8 counter register (TM8C) value.
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers 8.2.3 Timer 9 Data Register (TM9D) Address: 0F8E4H Access: R/W Access size: 8/16 bits Initial value: 0FFH TM9D T9D7 T9D6 T9D5 T9D4 T9D3 T9D2 T9D1 T9D0 Initial value TM9D is a special function register (SFR) to set the value to be compared with the value of the Timer 9 counter register (TM9C).
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers 8.2.4 Timer A Data Register (TMAD) Address: 0F8E8H Access: R/W Access size: 8/16 bits Initial value: 0FFH TMAD TAD7 TAD6 TAD5 TAD4 TAD3 TAD2 TAD1 TAD0 Initial value TMAD is a special function register (SFR) to set the value to be compared with the Timer A counter register (TMAC) value.
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers 8.2.5 Timer B Data Register (TMBD) Address: 0F8ECH Access: R/W Access size: 8/16 bits Initial value: 0FFH TMBD TBD7 TBD6 TBD5 TBD4 TBD3 TBD2 TBD1 TBD0 Initial value TMBD is a special function register (SFR) to set the value to be compared with the value of the Timer B counter register (TMBC).
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers 8.2.6 Timer E Data Register (TMED) Address: 0F360H Access: R/W Access size: 8/16 bits Initial value: 0FFH TMED TED7 TED6 TED5 TED4 TED3 TED2 TED1 TED0 Initial value TMED is a special function register (SFR) to set the value to be compared with the Timer E counter register (TMEC) value.
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers 8.2.7 Timer F Data Register (TMFD) Address: 0F368H Access: R/W Access size: 8/16 bits Initial value: 0FFH TMFD TFD7 TFD6 TFD5 TFD4 TFD3 TFD2 TFD1 TFD0 Initial value TMFD is a special function register (SFR) to set the value to be compared with the value of the Timer F counter register (TMFC).
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers 8.2.16 Timer A Control Register 0 (TMACON0) Address: 0F8EAH Access: R/W Access size: 8/16 bits Initial value: 00H TMACON0 TAOST TABM16 TACS2 TACS1 TACS0 Initial value TMACON0 is a special function (SFR) to control the Timer A.
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers 8.2.17 Timer B Control Register 0 (TMBCON0) Address: 0F8EEH Access: R/W Access size: 8/16 bits Initial value: 00H TMBCON0 TBOST TBCS2 TBCS1 TBCS0 Initial value TMBCON0 is a special function (SFR) to control the Timer B.
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers 8.2.18 Timer E Control Register 0 (TMECON0) Address: 0F362H Access: R/W Access size: 8/16 bits Initial value: 00H TMECON0 TECS2 TEFM16 TECS1 TECS0 Initial value TMECON0 is a special function (SFR) to control the Timer E.
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers 8.2.19 Timer F Control Register 0 (TMFCON0) Address: 0F36AH Access: R/W Access size: 8/16 bits Initial value: 00H TMFCON0 TFCS2 TFCS1 TFCS0 Initial value TMFCON0 is a special function (SFR) to control the Timer F.
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers 8.2.22 Timer A Control Register 1 (TMACON1) Address: 0F8EBH Access: R/W Access size: 8 bits Initial value: 00H TMACON1 TASTAT TARUN Initial value TMACON1 is a special function register (SFR) to control the Timer A.
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers 8.2.23 Timer B Control Register 1 (TMBCON1) Address: 0F8EFH Access: R/W Access size: 8 bits Initial value: 00H TMBCON1 TBSTAT TBRUN Initial value TMBCON1 is a special function register (SFR) to control the Timer B.
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers 8.2.24 Timer E Control Register 1 (TMECON1) Address: 0F363H Access: R/W Access size: 8 bits Initial value: 00H TMECON1 TESTAT TETGEN TERUN Initial value TMECON1 is a special function register (SFR) to control the Timer E.
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers 8.2.25 Timer F Control Register 1 (TMFCON1) Address: 0F36BH Access: R/W Access size: 8 bits Initial value: 00H TMFCON1 TFSTAT TFTGEN TFRUN Initial value TMFCON1 is a special function register (SFR) to control the Timer F.
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers 8.2.26 Timer E Control Register 2 (TMECON2) Address: 0F364H Access: R/W Access size: 8 bits Initial value: 00H TMECON2 TEOST TETRM1 TETRM0 TEST1 TEST0 Initial value TMECON2 is a special function (SFR) to control the Timer E.
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers 8.2.27 Timer F Control Register 2 (TMFCON2) Address: 0F36CH Access: R/W Access size: 8 bits Initial value: 00H TMFCON2 TFOST TFNEG TFTRM1 TFTRM0 TFST1 TFST0 Initial value TMFCON2 is a special function (SFR) to control the Timer F.
Page 135
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers • TFOST (bit 7) The TFOST bit is used to select continuous mode/one shot mode of timer E. In cases where the 16-bit timer mode has been selected by setting TEFM16 of TMECON0 to “1”, the value of TFOST is invalid.
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers 8.2.28 Timer E Control Register 3 (TMECON3) Address: 0F365H Access: R/W Access size: 8 bits Initial value: 00H TMECON3 TESTSS TESTS2 TESTS1 TESTS0 Initial value TMECON3 is a special function register (SFR) to control the Timer E.
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers 8.2.29 Timer F Control Register 3 (TMFCON3) Address: 0F36DH Access: R/W Access size: 8 bits Initial value: 00H TMFCON3 TFSTSS TFSTS2 TFSTS1 TFSTS0 Initial value TMFCON3 is a special function register (SFR) to control the Timer F.
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers Description of Operation 8.3.1 Timer basic operation When the TnRUN bit of timer 8 to B,E,F control register 1 (TMnCON1) is set to “1”, the timer counter (TMnC) is set to an operating state (TnSTAT is set to “1”) on the first falling edge of the timer clock (TnCK) being selected by the Timer 8 to B,E,F control register 0 (TMnCON0).
Page 139
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers Figure 8-3 shows one shot mode operation timing of timer 8 to B, E, F. If timer out (TM9OUT and TMFOUT) is started with TnRUN of 1, timer out is inverted. Whenever the value of the count value of TMnC and the preset value of a timer n data register (TMnD) is matched , the output is returned to the initial value.
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers 8.3.2 The external timer start/stop operation For the external timer start/stop operation of the timer E,F, the external timer start/stop is enabled when the external input is selected on timer control register 2(TMnCON2) and the timer control register 3(TMnCON3) and TnTGEN bit of timer control register 1(TMnCON1) is set as “1”.
Page 141
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers TnCK PADn (external trigger input) TnRUN TnSTAT Write TMnC TMnC 87 88 5F 60 TMnD TMnINT (n=E,F) Figure 8-4(b) Continuous mode Operation Timing Diagram of Timer E,F ( timer count is started by the external input falling edge, timer count is stopped by the external input falling edge.
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers Restriction of timer 8.4.1 Restriction 1 When using the 16bit timer configured cascading two 8bit timers, do not write “0FEh” to the lower byte of timer data register(TMnD, n=8, A, E). Set data to any value except for “0FEh”(“00h to 0FDh” or “0FFh”). There is no restriction for the higher byte of timer data register(TMmD, m=9, B, F).
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers Specifying port registers For enable the timer output (TM9OUT, TMFOUT) function, each related port register needs to be set up. Refer to the Chapter 15, “Port A” , the Chapter 16 “Port B” and Chapter 17, “Port C” for details of each register.
ML610Q111/ML610Q112 User’s Manual Chapter 8 Timers 8.5.2 Functioning PC3 (TMFOUT) as the timer output Set PC3MD1 bit (bit3 of PCMOD1 register) to “1” and PC7MD0 bit (bit3 of PCMOD0 register) to “1” for specifying the timer output as the quaternary function of PC3.
ML610Q111/ML610Q112 User’s Manual Chapter 9 Watchdog Timer 9 Watchdog Timer 9.1 Overview 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.
ML610Q111/ML610Q112 User’s Manual Chapter 9 Watchdog Timer 9.2 Description of Registers 9.2.1 List of Registers Address Name Symbol (Byte) Symbol (Word) Size Initial value 0F00EH Watchdog timer control register WDTCON 0F00FH Watchdog timer mode register WDTMOD FEUL610Q111...
ML610Q111/ML610Q112 User’s Manual Chapter 9 Watchdog Timer 9.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 clear the WDT counter.
ML610Q111/ML610Q112 User’s Manual Chapter 9 Watchdog Timer 9.2.3 Watchdog Timer Mode Register (WDTMOD) Address: 0F00FH Access: R/W Access size: 8 bits Initial value: 02H WDTMOD WDT2 WDT1 WDT0 Initial value WDTMOD is a special function register to set the overflow period of the watchdog timer.
ML610Q111/ML610Q112 User’s Manual Chapter 9 Watchdog Timer 9.3 Description of Operation The WDT counter starts counting by using a signal T256Hz of the low-speed time base counter, after the system reset has been released and the low-speed clock oscillation start.
Page 151
ML610Q111/ML610Q112 User’s Manual Chapter 9 Watchdog Timer Figure 9-2 shows an example of watchdog timer operation. Program Occurrence of start Low-speed abnormality oscillation start WDTMOD RESET_S WDTMOD setting setting System reset Data: WDTCON Write WDTP...
ML610Q111/ML610Q112 User’s Manual Chapter 9 Watchdog Timer 9.3.1 Handling example when you do not want to use the watchdog 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.
ML610Q111/ML610Q112 User’s Manual Chapter 10 PWM 10 PWM 10.1 Overview This LSI includes 4 channels of 16-bit PWM (Pulse Width Modulation). The PWM output (PWMC) function is assigned to the secondary function of the PA0(Port A) or the secondary function of the PB0(Port B) or the fourthly function of the PB7(Port B).
ML610Q111/ML610Q112 User’s Manual Chapter 10 PWM 10.1.3 List of Pins Pin name Description PA0/ PnTG/ External trigger input PWMC output pin: Used for the secondary function of the PA0 pin. PWMC PA1/ PnTG/ External trigger input PWMD output pin: Used for the secondary function of the PA1 pin.
Page 157
ML610Q111/ML610Q112 User’s Manual Chapter 10 PWM 10.2 Description of Registers 10.2.1 List of Registers Address Name Symbol (Byte) Symbol (Word) Size Initial value 0F910H PWMC period register L PWCPL 8/16 0FFH PWCP PWMC period register H 0F911H PWCPH 0FFH 0F912H...
ML610Q111/ML610Q112 User’s Manual Chapter 10 PWM 10.3 Description of Operation When the PnRUN bit of the PWMn control register 1 (PWnCON1) is set to “1”, the PWMn counters (PWnCH, PWnCL) are set to an operating state (PnSTAT is set to “1”) on the first falling edge of the PWMn clock (PnCK) that is selected by the PWMn control register 0 (PWnCON0) and increment the count value on the 2nd falling edge.
Page 191
ML610Q111/ML610Q112 User’s Manual Chapter 10 PWM After the PnRUN bit is set to “1”, counting starts in synchronization with the PWMn clock(PnCK). This causes an error of up to 1 clock pulse to the time the first PWMn interrupt is issued. The PWMn interrupt period from the second time is fixed.
ML610Q111/ML610Q112 User’s Manual Chapter 10 PWM 10.3.1 Start, Stop, and Clear Operations of PWM by External Input Control Setting the PnTRM1, PnTRM0, PnST1, PnST0 bits of the PWMn Control Register 2 (PWnCON2) enables the start/stop/clear control of the PWM counters (PWnCH and PWnCL) using the external input that is selected by the PnSTSS, PnSTS2 to PnSTS0 bits of the PWMn Control Register 3 (PWnCON3).
ML610Q111/ML610Q112 User’s Manual Chapter 10 PWM 10.3.3 PWMF Operation PWMF can output three types of wave form with the same period and different duties. Polarity of each wave form can be set individually by the combination of PFNEG and PFnPOL.
Page 194
ML610Q111/ML610Q112 User’s Manual Chapter 10 PWM As PWMF has three duty registers, there is a setting update register to synchronize these changes. If you change the duty during PWMF operation, confirm that PFUD bit of PWFCON5 is “0” and then write “1” to it after setting as desired.
ML610Q111/ML610Q112 User’s Manual Chapter 10 PWM 10.3.4 Interrupt of PWM Interrupts of PWM contain the following four types: • Period match interrupt • Duty match interrupt • Count stop interrupt by external input • Emergency stop interrupt Figure 10-7 shows how to identify these interrupts when continuous mode and one-shot mode. For emergency stop interrupt, confirm that PnSDST bit of the PWnCON1 register is set to “1”...
ML610Q111/ML610Q112 User’s Manual Chapter 10 PWM 10.4 Specifying port registers To enable the PWM function, the applicable bit of each related port register needs to be set. See Chapter 15, “Port A”, Chapter 16, “Port B” and Chapter 17, “Port C” for detail about the port registers.
ML610Q111/ML610Q112 User’s Manual Chapter 10 PWM 10.4.2 Functioning PB0 (PWMC) as the PWM output Set PB0MD1 bit (bit0 of PBMOD1 register) to “0”, and set PB0MD0 bit (bit0 of PBMOD0 register) to ”1” for specifying the PWM output as the secondary function of PB0 Reg.
ML610Q111/ML610Q112 User’s Manual Chapter 10 PWM 10.4.3 Functioning PB7 (PWMC) as the PWM output Set PB7MD1 bit (bit7 of PBMOD1 register) to “1”, and set PB7MD0 bit (bit7 of PBMOD0 register) to ”1” for specifying the PWM output as the fourthly function of PB7 Reg.
User’s Manual ML610Q111/ML610Q112 Chapter 11 Synchronous Serial Port 11 Synchronous Serial Port 11.1 Overview This LSI includes one channel of the 8/16-bit synchronous serial port (SSIO) and can also be used to control the device incorporated with the SPI interface by using one GPIO as the chip enable pin.
User’s Manual ML610Q111/ML610Q112 Chapter 11 Synchronous Serial Port 11.1.3 List of Pins Pin name Description PB3/SIN Receive data input. Used for the secondary function of the PB3 pin. PB5/SCK Synchronous clock input/output. Used for the secondary function of the PB5 pin.
User’s Manual ML610Q111/ML610Q112 Chapter 11 Synchronous Serial Port 11.2 Description of Registers 11.2.1 List of Registers Address Name Symbol (Byte) Symbol (Word) Size Initial value Serial port 0 transmit/receive 0F280H SIO0BUFL 8/16 buffer L SIO0BUF Serial port 0 transmit/receive 0F281H...
User’s Manual ML610Q111/ML610Q112 Chapter 11 Synchronous Serial Port 11.2.4 Serial Port Mode Register 0 (SIO0MOD0) Address: 0F284H Access: R/W Access size: 8 bits 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.
User’s Manual ML610Q111/ML610Q112 Chapter 11 Synchronous Serial Port 11.2.5 Serial Port Mode Register 1 (SIO0MOD1) Address: 0F285H Access: R/W Access size: 8 bits 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.
User’s Manual ML610Q111/ML610Q112 Chapter 11 Synchronous Serial Port 11.3 Description of Operation 11.3.1 Transmit Operation When “1” is written to the S0MD1 bit and “0” is written to the S0MD0 bit of the serial mode register (SIO0MOD0), this LSI is set to a transmit mode.
User’s Manual ML610Q111/ML610Q112 Chapter 11 Synchronous Serial Port 11.3.2 Receive Operation When “0” is written to the S0MD1 bit and “1” is written to the S0MD0 bit of the serial mode register (SIO0MOD0), this LSI is set to a receive mode.
User’s Manual ML610Q111/ML610Q112 Chapter 11 Synchronous Serial Port 11.3.3 Transmit/Receive Operation When “1” is written to the S0MD1 bit and “1” is written to the S0MD0 bit of the serial mode register (SIO0MOD0), this LSI is set to a transmit/receive mode.
User’s Manual ML610Q111/ML610Q112 Chapter 11 Synchronous Serial Port 11.4 Specifying port registers For enable the SSIO function, each related port register needs to be set up. Refer to the Chapter 16, “Port B” for details of each register. 11.4.1 Functioning as the SSIO master mode SSIO is selected as the secondary function of PB5, PB4, and PB3 by setting PB5MD1-PB3MD1 bit (PBMOD1 register: bit5-3) to “0”...
User’s Manual ML610Q111/ML610Q112 Chapter 11 Synchronous Serial Port 11.4.2 Functioning as the SSIO slave mode SSIO is selected as the secondary function of PB5, PB4, and PB3 by setting PB5MD1-PB3MD1 bit (PBMOD1 register: bit5-3) to “0” and setting PB5MD0-PB3MD0 bit (PBMOD0 register: bit5-3) to “1”. It is the same setup as the case of master mode.
ML610Q111/ML610Q112 User’s Manual Chapter 12 UART 12 UART 12.1 Overview This LSI includes 2 channels of UART (Universal Asynchronous Receiver Transmitter) which is an asynchronous serial interface of a half-duplex. (A full-duplex is also possible by using 2 channels.) The use of UART requires setting of the tertiary/fourthly functions of Port B. For the tertiary/fourthly functions of Port B, see Chapter 16, “Port B”.
ML610Q111/ML610Q112 User’s Manual Chapter 12 UART 12.1.3 List of Pins Pin name Function UART0 data input pin PB0/RXD0 Used for the primary function of the PB0 pin. UART0 data input pin PB5/RXD0 Used for the primary function of the PB5 pin.
Page 215
ML610Q111/ML610Q112 User’s Manual Chapter 12 UART 12.2.2 UART0 Transmit/Receive Buffer (UA0BUF) Address: 0F290H 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) to store the transmitted/received data of the UART.
ML610Q111/ML610Q112 User’s Manual Chapter 12 UART 12.2.4 UART0 Control Register (UA0CON) Address: 0F291H Access: R/W Access size: 8 bits Initial value: 00H UA0CON U0EN Initial value UA0CON is a special function register (SFR) to control start/stop communication of the UART.
ML610Q111/ML610Q112 User’s Manual Chapter 12 UART 12.2.6 UART0 Mode Register 0 (UA0MOD0) Address: 0F292H Access: R/W Access size: 8/16 bits Initial value: 00H UA0MOD0 U0RSS U0RSEL U0CK1 U0CK0 U0IO Initial value UA0MOD0 is a special function register (SFR) to set the transfer mode of the UART.
ML610Q111/ML610Q112 User’s Manual Chapter 12 UART 12.2.7 UART1 Mode Register 0 (UA1MOD0) Address: 0F29AH Access: R/W Access size: 8/16 bits Initial value: 00H UA0MOD0 U1RSS U1RSEL U1CK1 U1CK0 U1IO Initial value UA1MOD0 is a special function register (SFR) to set the transfer mode of the UART.
ML610Q111/ML610Q112 User’s Manual Chapter 12 UART 12.2.8 UART0 Mode Register 1 (UA0MOD1) Address: 0F293H Access: R/W Access size: 8/16 bits Initial value: 00H UA0MOD1 U0DIR U0NEG U0STP U0PT1 U0PT0 U0LG1 U0LG0 Initial value UA0MOD1 is a special function register (SFR) to set the transfer mode of the UART.
ML610Q111/ML610Q112 User’s Manual Chapter 12 UART 12.2.9 UART1 Mode Register 1 (UA1MOD1) Address: 0F29BH Access: R/W Access size: 8/16 bits Initial value: 00H UA1MOD1 U1DIR U1NEG U1STP U1PT1 U1PT0 U1LG1 U1LG0 Initial value UA1MOD1 is a special function register (SFR) to set the transfer mode of the UART.
ML610Q111/ML610Q112 User’s Manual Chapter 12 UART 12.2.12 UART0 Status Register (UA0STAT) Address: 0F296H Access: R/W Access size: 8 bits Initial value: 00H UA0STAT U0FUL U0PER U0OER U0FER Initial value UA0STAT is a special function register (SFR) to indicate the state of transmit or receive operation of the UART.
ML610Q111/ML610Q112 User’s Manual Chapter 12 UART 12.2.13 UART1 Status Register (UA1STAT) Address: 0F29EH Access: R/W Access size: 8 bits Initial value: 00H UA1STAT U1FUL U1PER U1OER U1FER Initial value UA1STAT is a special function register (SFR) to indicate the state of transmit or receive operation of the UART.
ML610Q111/ML610Q112 User’s Manual Chapter 12 UART 12.3 Description of Operation 12.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.
ML610Q111/ML610Q112 User’s Manual Chapter 12 UART 12.3.2 Baud rate Baud rates are generated by the baud 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).
ML610Q111/ML610Q112 User’s Manual Chapter 12 UART 12.3.4 Transmit Operation Transmission is started by setting the UnIO bit of the UARTn mode register 0 (UA0MOD0) to “0” to select transmit mode and setting the UnEN bit of the UARTn control register (UAnCON) to “1”.
ML610Q111/ML610Q112 User’s Manual Chapter 12 UART 12.3.5 Receive Operation Select the received data pin using the UnRSEL bit of the UARTn mode register 0 (UAnMOD0). Select the receive mode by setting the UnIO bit of the UARTn mode register 0 (UAnMOD0) to "1". Then, set the UnEN bit of the UARTn control register (UAnCON) to "1"...
ML610Q111/ML610Q112 User’s Manual Chapter 12 UART 12.3.5.1 Detection of Start Bit The Start bit is sampled using the baud rate generator clock (LSCLK, HSCLK) which selected by UnCK1, UnCK0 bits of UARTn mode register 0 (UAnMOD0). Therefore, the start bit detection may be delayed for one cycle of the baud rate generate clock at the maximum.
ML610Q111/ML610Q112 User’s Manual Chapter 12 UART 12.3.5.3 Reception Margin If there are any errors between the baud rate on the transmitter side and the baud rate to be generated by the baud rate generator of the LSI, those errors will be accumulated until the last stop bit in one frame is shifted in, causing the reception margin to be reduced.
ML610Q111/ML610Q112 User’s Manual Chapter 12 UART 12.4 Specifying port registers To enable the UART function, the applicable bit of each related port register needs to be set. See Chapter 16, “Port B” for detail about the port registers. 12.4.1 Functioning PB1(TXD0) and PB0(RXD0) as the UART Set the PB1MD1 bit(bit1 of PBMOD1 register) to “1”...
ML610Q111/ML610Q112 User’s Manual Chapter 12 UART 12.4.2 Functioning PB4(TXD0) and PB5(RXD0) as the UART Set the PB4MD1(bit4 of PBMOD1 register) to “1” and set the PB5MD1 bit (bit5 of PBMOD1 register) to “0”, and set the PB5MD0-PB4MD0 bits(bit5-4 of PBMOD0 register) to “0”, for specifying the UART as the primary function of PB5 and the tertiary function of PB4.
ML610Q111/ML610Q112 User’s Manual Chapter 12 UART 12.4.3 Functioning PB1(TXD1) and PB2(RXD1) as the UART Set the PB1MD1 bit(bit1 of PBMOD1 register) to “1” and set the PB2MD1(bit2 of PBMOD1 register) to “0”, and set the PB1MD0 bit(bit1 of PBMOD0 register) to “1” and set the PB2MD0(bit2 of PBMOD0 register) to “0”, for specifying the UART as the fourthly function of PB1 and the primary function of PB2.
ML610Q111/ML610Q112 User’s Manual Chapter 12 UART 12.4.4 Functioning PB3(TXD1) and PB2(RXD1) as the UART Set the PB3MD1 bit (bit3 of PBMOD1 register) to “1” and set the PB2MD1(bit2 of PBMOD1 register) to “0”, and set the PB3MD0-PB2MD0 bits(bit3-2 of PBMOD0 register) to “0”, for specifying the UART as the tertiary function of PB3 and the primary function of PB2.
ML610Q111/ML610Q112 User’s Manual Chapter 12 UART 12.4.5 Functioning PB4(TXD1) and PB2(RXD1) as the UART Set the PB4MD1 bit(bit4 of PBMOD1 register) to “1” and set the PB2MD1(bit2 of PBMOD1 register) to “0”, and set the PB4MD0 bit(bit4 of PBMOD0 register) to “1” and set the PB2MD0(bit2 of PBMOD0 register) to “0”, for specifying the UART as the fourthly function of PB4 and the primary function of PB2.
ML610Q111/ML610Q112 User’s Manual Chapter 12 UART 12.4.6 Functioning PB1(TXD1) and PB7(RXD1) as the UART Set the PB1MD1 bit (bit1 of PBMOD1 register) to “1” and set the PB7MD1(bit7 of PBMOD1 register) to “0”, and set the PB1MD0 bit(bit1 of PBMOD0 register) to “1” and set the PB7MD0(bit7 of PBMOD0 register) to “0”, for specifying the UART as the fourthly function of PB1 and the primary function of PB7.
ML610Q111/ML610Q112 User’s Manual Chapter 12 UART 12.4.7 Functioning PB3(TXD1) and PB7(RXD1) as the UART Set the PB3MD1 bit(bit3 of PBMOD1 register) to “1” and set the PB7MD1(bit7 of PBMOD1 register) to “0”, and set the PB3MD0, PB7MD0 bits(bit3 and bit7 of PBMOD0 register) to “0”, for specifying the UART as the tertiary function of PB3 and the primary function of PB7.
ML610Q111/ML610Q112 User’s Manual Chapter 12 UART 12.4.8 Functioning PB4(TXD1) and PB7(RXD1) as the UART Set the PB4MD1 bit (bit4 of PBMOD1 register) to “1” and set the PB7MD1(bit7 of PBMOD1 register) to “0”, and set the PB4MD0 bit(bit4 of PBMOD0 register) to “1” and set the PB7MD0(bit7 of PBMOD0 register) to “0”, for specifying the UART as the fourthly function of PB4 and the primary function of PB7.
ML610Q111/ML610Q112 User’s Manual Chapter 13 I C bus Interface Master 13 I C Bus Interface Master 13.1 Overview This LSI includes 1 channel of I C bus interface (master). The tertiary functions of Port B or the secondary functions of Port C are assigned to the I...
ML610Q111/ML610Q112 User’s Manual Chapter 13 I C bus Interface Master 13.2 OverviewDescription of Registers 13.2.1 List of Registers Address Name Symbol (Byte) Symbol (Word) Size Initial value 0F2A0H C bus 0 receive register I2C0RD — 0F2A1H C bus 0 slave address register I2C0SA —...
ML610Q111/ML610Q112 User’s Manual Chapter 13 I C bus Interface Master 13.2.2 C Bus 0 Receive Register (I2C0RD) Address: 0F2A0H Access: R Access size: 8 bits Initial value: 00H I2C0RD I20R7 I20R6 I20R5 I20R4 I20R3 I20R2 I20R1 I20R0 Initial value I2C0RD is a read-only special function register (SFR) to store receive data.
ML610Q111/ML610Q112 User’s Manual Chapter 13 I C bus Interface Master 13.2.3 C Bus 0 Slave Address Register (I2C0SA) Address: 0F2A1H Access: R/W Access size: 8 bits Initial value: 00H I2C0SA I20A6 I20A5 I20A4 I20A3 I20A2 I20A1 I20A0 I20RW Initial value I2C0SA is a special function register (SFR) to set the address and the data direction bit of the slave device.
ML610Q111/ML610Q112 User’s Manual Chapter 13 I C bus Interface Master 13.2.4 C Bus 0 Transmit Data Register (I2C0TD) Address: 0F2A2H Access: R/W Access size: 8 bits Initial value: 00H I2C0TD I20T7 I20T6 I20T5 I20T4 I20T3 I20T2 I20T1 I20T0 Initial value I2C0TD is a special function register (SFR) to set transmit data.
ML610Q111/ML610Q112 User’s Manual Chapter 13 I C bus Interface Master 13.3 Description of Operation 13.3.1 Communication Operating Mode Communication is started when communication mode is selected by using the I C bus 0 mode register (I2C0MOD), the I function is enabled by using the I20EN bit, a slave address and a data direction bit are set in the I C bus 0 slave address register, and “1”...
ML610Q111/ML610Q112 User’s Manual Chapter 13 I C bus Interface Master 13.3.2 Communication Operation Timing Figures 13-2 to 13-4 show the operation timing and control method for each communication mode. Reception Transmission Start Stop Repeated start Reception of Transmission of Transmission of...
Page 251
ML610Q111/ML610Q112 User’s Manual Chapter 13 I C bus Interface Master Figure 13-5 shows the operation timing and control method when an acknowledgment error occurs. Acknowledgment error Register I2C0SA=”xxxxxxx0B” setting I2C0CON=”01H” I2C0CON=”02H” Value of I2C0SA I2CMINT I20ST I2C0RD Value of I2C0SA...
ML610Q111/ML610Q112 User’s Manual Chapter 13 I C bus Interface Master 13.3.3 Operation Waveforms Figure 13-7 shows the operation waveforms of the SDA and SCL signals and the I20BB flag. Table 13-1 shows the relationship between communication speeds and HSCLK clock counts.
ML610Q111/ML610Q112 User’s Manual Chapter 13 I C bus Interface Master 13.4 Specifying port registers To enable the I C function, the applicable bit of each related port register needs to be set. See Chapter 16, “Port B” and Chapter 17, “Port C” for detail about the port registers.
ML610Q111/ML610Q112 User’s Manual Chapter 14 I C bus Interface Slave 14 I C Bus Interface Slave 14.1 Overview This LSI includes 1 channel of I C bus interface (slave). The tertiary functions of Port B or the secondary functions of Port C are assigned to the I...
ML610Q111/ML610Q112 User’s Manual Chapter 14 I C bus Interface Slave 14.1.3 List of Pins Pin name Description C bus interface data input/output pin. PB6/SDA Used for the tertiary function of the PB6 pin. C bus interface clock input/output pin. PB5/SCL Used for the tertiary function of the PB5 pin.
Page 257
ML610Q111/ML610Q112 User’s Manual Chapter 14 I C bus Interface Slave 14.2 Description of Registers 14.2.1 List of Registers Address Name Symbol (Byte) Symbol (Word) Size Initial value 0F2A8H C bus 1 receive register I2C1RD — 0F2A9H C bus 1 slave address register I2C1SA —...
ML610Q111/ML610Q112 User’s Manual Chapter 14 I C bus Interface Slave 14.2.2 C Bus 1 Receive Register (I2C1RD) Address: 0F2A8H Access: R Access size: 8 bits Initial value: 00H I2C1RD I21R7 I21R6 I21R5 I21R4 I21R3 I21R2 I21R1 I21R0 Initial value I2C1RD is a read-only special function register (SFR) to store receive data.
ML610Q111/ML610Q112 User’s Manual Chapter 14 I C bus Interface Slave 14.2.3 C Bus 1 Slave Address Register (I2C1SA) Address: 0F2A9H Access: R/W Access size: 8 bits Initial value: 00H I2C1SA I21A6 I21A5 I21A4 I21A3 I21A2 I21A1 I21A0 — — Initial value I2C1SA is a special function register (SFR) to set the slave address.
ML610Q111/ML610Q112 User’s Manual Chapter 14 I C bus Interface Slave 14.2.4 C Bus 1 Transmit Data Register (I2C1TD) Address: 0F2AAH Access: R/W Access size: 8 bits Initial value: 00H I2C1TD I21T7 I21T6 I21T5 I21T4 I21T3 I21T2 I21T1 I21T0 Initial value I2C1TD is a special function register (SFR) to set transmit data.
ML610Q111/ML610Q112 User’s Manual Chapter 14 I C bus Interface Slave 14.2.7 C Bus 1 Status Register (I2C1STAT) Address: 0F2ADH Access: R Access size: 8 bits Initial value: 00H I2C1STAT — — — I21TR I21SAA I21ER I21ACR I21BB — — —...
Page 264
ML610Q111/ML610Q112 User’s Manual Chapter 14 I C bus Interface Slave • I21TR (bit 4) The I21TR bit indicates status of transmission and receive. The I21TR bit is set to “1” when detecting data direction bit is “1”. The I21TR bit is reset to “0” when detecting stop condition, start condition, data direction bit is “0” and when I21EN bit of I2C1MOD0 is “0”.
ML610Q111/ML610Q112 User’s Manual Chapter 14 I C bus Interface Slave 14.3 Description of Operation 14.3.1 Communication Operating Mode The receive starts enabled after a slave address is specified to I2C1SA register, start and stop condition interrupts are set to enabled by using I2C1MOD register and set the I21EN bit to “1”.
ML610Q111/ML610Q112 User’s Manual Chapter 14 I C bus Interface Slave 14.3.2 Communication Operation Timing Figures 14-2 to 14-4 show the operation timing and control method for each communication mode. Transmission Reception Start Stop Repeated start Reception of Transmission of Transmission of...
ML610Q111/ML610Q112 User’s Manual Chapter 14 I C bus Interface Slave When the values of the transmitted bit and the SDA pin do not coincide, the I21ER bit of the I2C bus 1 status register (I2C0STAT) is set to “1” and SDA pin remains the output until termination of the subsequent byte data communication.
ML610Q111/ML610Q112 User’s Manual Chapter 14 I C bus Interface Slave 14.4 Specifying port registers To enable the I C function, the applicable bit of each related port register needs to be set. See Chapter 16, “Port B” and Chapter 17, “Port C” for detail about the port registers.
ML610Q111/ML610Q112 User’s Manual Chapter 15 Port A 15 Port A 15.1 Overview This LSI includes Port A (PA0 to PA2) which is a 3-bit input/output port. Port A can have external interrupt, input of comparator and input of Successive Approximation Type A/D Converter. And, port A can have PWM, Timers, output of comparator, input of external clock, output of clock functions as secondary, tertiary and fourthly functions.
ML610Q111/ML610Q112 User’s Manual Chapter 15 Port A 15.1.2 Configuration Figure 15-1 shows the configuration of Port A. Pull-up Data bus Pull-down Controller PADIR PAMOD0,1 PACON0,1 PWMC,PWMD,PWME PortA CMP0OUT Output OUTCLK, LSCLK Controller TM9OUT, TMFOUT CLKIN, Trigger Inputs* EXI0-EXI2 CMP1P AIN0, AIN1...
ML610Q111/ML610Q112 User’s Manual Chapter 15 Port A 15.1.3 List of Pins Tertiary function Fourthly function Pin name Primary function Secondary function PA0/ Input/output port, EXI0/ External 0 interrupt, High-speed clock Timer 9 out AIN0/ SA-ADC 0 input, PWMC output output (OUTCLK)
Page 273
ML610Q111/ML610Q112 User’s Manual Chapter 15 Port A 15.2 Description of Registers 15.2.1 List of Registers Address Name Symbol (Byte) Symbol (Word) Size Initial value 0F250H Port A data register 0F251H Port A direction register PADIR 0F252H Port A control register 0...
ML610Q111/ML610Q112 User’s Manual Chapter 15 Port A 15.2.2 Port A Data Register (PAD) Address: 0F250H Access: R/W Access size: 8 bits Initial value: 00H ― ― ― ― ― PA2D PA1D PA0D ― ― ― ― ― Initial value PAD is a special function register (SFR) to set the value to be output to the Port A pin or to read the input level of the Port A.
ML610Q111/ML610Q112 User’s Manual Chapter 15 Port A 15.2.3 Port A Direction Register (PADIR) Address: 0F251H Access: R/W Access size: 8 bits Initial value: 00H ― ― ― ― ― PADIR PA2DIR PA1DIR PA0DIR ― ― ― ― ― Initial value PADIR is a special function register (SFR) to select the input/output mode of Port A.
ML610Q111/ML610Q112 User’s Manual Chapter 15 Port A 15.3 Description of Operation 15.3.1 Input/Output Port Functions For each pin of Port A, either output or input is selected by setting the Port A direction register (PADIR). 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 A control registers 0 and 1 (PACON0 and PACON1).
ML610Q111/ML610Q112 User’s Manual Chapter 16 Port B 16 Port B 16.1 Overview This LSI includes Port B (PB0 to PB7) which is an 8-bit input/output port. Port B can have external interrupt, input of comparator and input of Successive Approximation Type A/D Converter.
ML610Q111/ML610Q112 User’s Manual Chapter 16 Port B 16.1.2 Configuration Figure 16-1 shows the configuration of Port B. Pull-up Data bus Pull-down Controller PWMC, PWMD, PWME, PBDIR PWMF0, PWMF1, PWMF2 PBMOD0,1 PBCON0,1 TXD0 , TXD1 SCL, SDA, SOUT, SCK PortB CMP1OUT,...
ML610Q111/ML610Q112 User’s Manual Chapter 16 Port B 16.1.3 List of Pins Tertiary function Fourthly function Pin name Primary function Secondary function PB0/ Input/output port, EXI4/ External 4 interrupt, AIN2/ SA-ADC 2 input, High-speed clock Comparator 1 output PWMC output RXD0/...
ML610Q111/ML610Q112 User’s Manual Chapter 16 Port B 16.2 Description of Registers 16.2.1 List of Registers Address Name Symbol (Byte) Symbol (Word) Size Initial value 0F258H Port B data register 0F259H Port B direction register PBDIR 0F25AH Port B control register 0...
ML610Q111/ML610Q112 User’s Manual Chapter 16 Port B 16.2.2 Port B Data Register (PBD) Address: 0F258H Access: R/W Access size: 8 bits Initial value: 00H PB7D PB6D PB5D PB4D PB3D PB2D PB1D PB0D Initial value PBD is a special function register (SFR) to set the value to be output to the Port B pin or to read the input level of the Port B.
ML610Q111/ML610Q112 User’s Manual Chapter 16 Port B 16.2.3 Port B Direction Register (PBDIR) Address: 0F259H Access: R/W Access size: 8 bits Initial value: 00H PBDIR PB7DIR PB6DIR PB5DIR PB4DIR PB3DIR PB2DIR PB1DIR PB0DIR Initial value PBDIR is a special function register (SFR) to select the input/output mode of Port B.
ML610Q111/ML610Q112 User’s Manual Chapter 16 Port B 16.2.4 Port B Control Registers 0, 1 (PBCON0, PBCON1) Address: 0F25AH Access: R/W Access size: 8/16 bits Initial value: 00H PBCON0 PB7C0 PB6C0 PB5C0 PB4C0 PB3C0 PB2C0 PB1C0 PB0C0 Initial value Address: 0F25BH...
Page 287
ML610Q111/ML610Q112 User’s Manual Chapter 16 Port B When output mode is selected When input mode is selected Setting of PB3 pin (PB3DIR bit = “0”) (PB3DIR bit = “1”) PB3C1 PB3C0 Description High-impedance output (initial value) High-impedance input P-channel open drain output...
ML610Q111/ML610Q112 User’s Manual Chapter 16 Port B 16.2.5 Port B Mode Registers 0 (PBMOD0, PBMOD1) Address: 0F25CH Access: R/W Access size: 8/16 bits Initial value: 00H PBMOD0 PB7MD0 PB6MD0 PB5MD0 PB4MD0 PB3MD0 PB2MD0 PB1MD0 PB0MD0 Initial value Address: 0F25DH Access: R/W...
Page 289
ML610Q111/ML610Q112 User’s Manual Chapter 16 Port B • PB3MD1, PB3MD0 (bit 3) The PB3MD1 and PB3MD0 bits are used to select the primary, secondary, tertiary and fourthly functions of the PB3 pin. PB3MD1 PB3MD0 Description General-purpose input/output mode (initial value)
ML610Q111/ML610Q112 User’s Manual Chapter 16 Port B 16.3 Description of Operation 16.3.1 Input/Output Port Functions For each pin of Port B, either output or input is selected by setting the Port B direction register (PBDIR). 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 B control registers 0 and 1 (PBCON0 and PBCON1).
C pins (SCL, SDA), Timers output pins (TM9OUT, TMFOUT) can be used as the secondary, tertiary and fourthly functions. Note: When used as ML610Q111, the PC4 to PC7 ports do not exist, and the PC4 to PC7 special function registers (SFRs) do not perform. FEUL610Q111...
ML610Q111/ML610Q112 User’s Manual Chapter 17 Port C 17.1.2 Configuration Figure 17-1 shows the configuration of Port C. Pull-up Data bus Pull-down Controller PCDIR PCMOD0,1 PCCON0,1 PWMF0, PWMF1, PWMF2 Port C SCL, SDA Output PC0 to PC7 TM9OUT, TMFOUT Controller SCL, SDA...
ML610Q111/ML610Q112 User’s Manual Chapter 17 Port C 17.1.3 List of Pins Tertiary function Fourthly function Pin name Primary function Secondary function PC0/ Input/output port PWMF0 output Timer 9 output PC1/ Input/output port PWMF1 output PC2/...
Page 295
ML610Q111/ML610Q112 User’s Manual Chapter 17 Port C 17.2 Description of Registers 17.2.1 List of Registers Address Name Symbol (Byte) Symbol (Word) Size Initial value 0F260H Port C data register 0F261H Port C direction register PCDIR 0F262H Port C control register 0...
The PC7D to PC0D bits are used to set the output value of the Port C pin in output mode and to read the pin level of the Port C pin in input mode. When used as ML610Q111, setting the value of PC7D to PC4D do not affect an applicable ports. PC0D Description Output or input level of the PC0 pin: ”L”...
• PC7DIR-PC0DIR (bits 7 to 0) The PC7DIR to PC0DIR pins are used to set the input/output direction of the Port C pin. When used as ML610Q111, setting the value of PC7DIR to PC4DIR do not affect an applicable ports. PC0DIR...
When used as ML610Q111, setting the value of PC7C1 to PC4C1, PC7C0 to PC4C0 do not affect an applicable ports. * High-impedance output means the status that both of H level output and L level output turn off.
Page 299
ML610Q111/ML610Q112 User’s Manual Chapter 17 Port C When output mode is selected When input mode is selected Setting of PC3 pin (PC3DIR bit = “0”) (PC3DIR bit = “1”) PC3C1 PC3C0 Description High-impedance output (initial value) High-impedance input P-channel open drain output...
PCMOD0 and PCMOD1 are special function register (SFR) to select the primary, secondary, tertiary and fourthly function of Port C. When used as ML610Q111, setting the value of PC7MD1 to PC4MD1, PC7MD0 to PC4MD0 do not affect an applicable ports.
Page 301
ML610Q111/ML610Q112 User’s Manual Chapter 17 Port C • PC3MD1, PC3MD0 (bit 3) The PC3MD1 and PC3MD0 bits are used to select the primary, secondary, tertiary and fourthly functions of the PC3 pin. PC3MD1 PC3MD0 Description General-purpose input/output mode (initial value)
In input mode, the input level of each pin of Port C can be read from the Port C data register (PCD). Note: When used as ML610Q111, the PC4 to PC7 ports do not exist, and the PC4 to PC7 special function registers (SFRs) do not perform.
ML610Q111/ML610Q112 User’s Manual Chapter 18 Port D 18 Port D 18.1 Overview This LSI includes Port D (PD0 to PD5) which is a 6-bit input/output port.(only for ML610Q112) 18.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.
ML610Q111/ML610Q112 User’s Manual Chapter 18 Port D 18.1.3 List of Pins Pin name Primary function Input/output port Input/output port Input/output port Input/output port Input/output port Input/output port FEUL610Q111 18-2...
Page 306
ML610Q111/ML610Q112 User’s Manual Chapter 18 Port D 18.2 Description of Registers 18.2.1 List of Registers Address Name Symbol (Byte) Symbol (Word) Size Initial value 0F268H Port D data register 0F269H Port D direction register PDDIR 0F26AH Port D control register 0...
ML610Q111/ML610Q112 User’s Manual Chapter 18 Port D 18.2.2 Port D Data Register (PDD) Address: 0F268H Access: R/W Access size: 8 bits Initial value: 00H ― ― PD5D PD4D PD3D PD2D PD1D PD0D ― ― Initial value PDD is a special function register (SFR) to set the value to be output to the Port D pin or to read the input level of the Port D.
ML610Q111/ML610Q112 User’s Manual Chapter 18 Port D 18.2.3 Port D Direction Register (PDDIR) Address: 0F269H Access: R/W Access size: 8 bits Initial value: 00H ― ― PDDIR PD5DIR PD4DIR PD3DIR PD2DIR PD1DIR PD0DIR ― ― Initial value PDDIR is a special function register (SFR) to select the input/output mode of Port D.
ML610Q111/ML610Q112 User’s Manual Chapter 18 Port D 18.2.4 Port D Control Registers 0, 1 (PDCON0, PDCON1) Address: 0F26AH Access: R/W Access size: 8/16 bits Initial value: 00H ― ― PDCON0 PD5C0 PD4C0 PD3C0 PD2C0 PD1C0 PD0C0 ― ― Initial value...
Page 310
ML610Q111/ML610Q112 User’s Manual Chapter 18 Port D When output mode is selected When input mode is selected Setting of PD3 pin (PD3DIR bit = “0”) (PD3DIR bit = “1”) PD3C1 PD3C0 Description High-impedance output (initial value) High-impedance input P-channel open drain output...
ML610Q111/ML610Q112 User’s Manual Chapter 18 Port D 18.3 Description of Operation 18.3.1 /Output Port Functions Input For each pin of Port D, either output or input is selected by setting the Port D direction register (PDDIR). 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 D control registers 0 and 1 (PDCON0 and PDCON1).
ML610Q111/ML610Q112 User’s Manual Chapter 19 Port AB Interrupts 19 Port AB Interrupts 19.1 Overview This LSI can have the external interrupts corresponding to seven ports. 19.1.1 Features • All bits support a maskable interrupt function. • Allows selection of interrupt disabled mode, falling-edge interrupt mode, rising-edge interrupt mode, or both-edge interrupt mode for each bit.
ML610Q111/ML610Q112 User’s Manual Chapter 19 Port AB Interrupts 19.2.3 Port AB Interrupt Control Register 2 (PABICON2) Address: 0F026H Access: R/W Access size: 8 bits Initial value: 00H PABICON2 PB3SM PB2SM PB1SM PB0SM PA2SM PA1SM PA0SM Initial value PABICON2 is a special function register (SFR) to select detection of signal edge for interrupts with or without sampling.
ML610Q111/ML610Q112 User’s Manual Chapter 19 Port AB Interrupts 19.3 Description of Operation 19.3.1 Interrupt Request When an interrupt edge selected by the port AB interrupt control registers 0, 1, 2 (PABICON0, PABICON1, PABICON2) occurs at the external interrupt pins EXI0-2, EXI4-7 (PA0-2, PB0-3), the corresponding maskable Pxx interrupt (PA0INT–PA2INT, PB0INT-PB3INT) occurs.
This LSI has a built-in 6-channel or 8-channel successive approximation type A/D converter (SA-ADC). 20.1.1 Features • Built-in sample/hold 10-bit successive approximation type A-D converter, which enables channel selection from 6 channels or 8 channels (ML610Q111: 6-channel, ML610Q112: 8-channel) 20.1.2 Configuration Figure 20-1 shows the configuration of SA-ADC. 10-bit...
Page 319
ML610Q111/ML610Q112 User’s Manual Chapter 20 Successive Approximation Type A/D Converter 20.1.3 List of Pins Pin name Description Successive approximation type A/D converter input pin 0 PA0/AIN0 Used for the primary function of the PA0 pin Successive approximation type A/D converter input pin 1...
ML610Q111/ML610Q112 User’s Manual Chapter 20 Successive Approximation Type A/D Converter 20.2 Description of Registers 20.2.1 List of Registers Address Name Symbol (Byte) Symbol (Word) Size Initial value 0F2D0H SA-ADC result register 0L SADR0L 8/16 SADR0 0F2D1H SA-ADC result register 0H...
ML610Q111/ML610Q112 User’s Manual Chapter 20 Successive Approximation Type A/D Converter 20.3 Description of Operation 20.3.1 Settings of A/D Conversion Channels According to the setting of SA-ADC mode register 0 (SADMOD0), A/D conversion is performed as shown below and A/D conversion results are stored in the SA-ADC result register.
ML610Q111/ML610Q112 User’s Manual Chapter 20 Successive Approximation Type A/D Converter 20.3.2 Operation of the Successive Approximation A/D Converter Use the following procedure to operate the SA-ADC: 1. Before starting the SA-ADC, start oscillation of the high-speed clock (HSCLK) and wait until the oscillation stabilizes.
ML610Q111/ML610Q112 User’s Manual Chapter 21 Voltage Level Supervisor 21 Voltage Level Supervisor 21.1 Overview This LSI includes two channels of the voltage level supervisor (VLS). 21.1.1 Features • Accuracy: ±3% (Typ. ) • The threshold voltages of VLS0 (V fall) : 2.85V (Typ. ) rise) : 2.92V (Typ.
ML610Q111/ML610Q112 User’s Manual Chapter 21 Voltage Level Supervisor 21.2 Description of Registers 21.2.1 List of Registers Symbol Address Name Symbol (Word) Size Initial value (Byte) 0F0D8H Voltage level supervisor control register 0 VLSCON0 8/16 VLSCON 0F0D9H Voltage level supervisor control register 1...
ML610Q111/ML610Q112 User’s Manual Chapter 21 Voltage Level Supervisor 21.3 Description of Operation 21.3.1 Operation of Voltage Level Supervisor For the VLS, the ENVLSn bit of the VLS control register 1 (VLSCON1) controls ON/OFF, the VLP0SEL0 bit of VLSMOD controls enable/disable of the low level detector reset function of VLS0, and VLP1SEL1 bit of VLSMOD controls enable/disable of the interrupt request function of VLS1..
ML610Q111/ML610Q112 User’s Manual Chapter 22 Analog Comparator 22 Analog Comparator 22.1 Overview This LSI includes 2 channels of analogue comparator. Voltage comparison (differential input) between two pins (CMP0P, CMP0M) that are input to the comparator is available. 22.1.1 Features • The comparator output can generate an interrupt.
ML610Q111/ML610Q112 User’s Manual Chapter 22 Analog Comparator 22.2.4 Comparator 0 control register 2 (CMP0CON2) Address: 0F952H Access: R/W Access size: 8 bits Initial value: 08H CMP0RF CMP0RF CMP0RF CMP0RF CMP0CON2 — — — — — — — — Initial value CMP0CON2 is a special function register (SFR) to select the reference voltage of the comparator 0.
ML610Q111/ML610Q112 User’s Manual Chapter 22 Analog Comparator 22.2.7 Comparator 1 control register 2 (CMP1CON2) Address: 0F956H Access: R/W Access size: 8 bits Initial value: 08H CMP1RF CMP1RF CMP1RF CMP1RF CMP1CON2 — — — — — — — — Initial value CMP1CON2 is a special function register (SFR) to select the reference voltage of the Comparator 1.
ML610Q111/ML610Q112 User’s Manual Chapter 22 Analog Comparator 22.3 Description of Operation 22.3.1 Comparator Functions The comparator compares the input voltages of the CMPnP and CMPnM pins to output the result to the CMPnD bit of the comparator control register 0 (CMPnCON0).
ML610Q111/ML610Q112 User’s Manual Chapter 22 Analog Comparator 22.3.2 Interrupt Request When an interrupt edge selected by the comparator control register 1 (CMPnCON1) occurs on the comparison result of the comparator, a comparator interrupt (CMPnINT) is generated. For the comparator interrupt, the edge can be selected.
ML610Q111/ML610Q112 User’s Manual Chapter 23 Data Flash Memory 23 Data Flash Memory 23.1 Overview This LSI includes the data flash memory (data memory space (4 Kbytes: 1 Kbytes x 4 sectors)) that is rewritable by using a special function register (SFR) programmatically.
Page 355
ML610Q111/ML610Q112 User’s Manual Chapter 23 Data Flash Memory 23.2 Description of Registers 23.2.1 List of Registers Address Name Symbol (Byte) Symbol (Word) Size Initial value 0F0E0H Flash address register L FLASHAL 8/16 FLASHA 0F0E1H Flash address register H FLASHAH 0F0E2H...
ML610Q111/ML610Q112 User’s Manual Chapter 23 Data Flash Memory 23.2.4 Flash Control Register (FLASHCON) Address: 0F0E4H Access: W Access size: 8 bits Initial value: 00H — — — — — — FSERS FERS FLASHCON — — — — — — Initial value FLASHCON is a write-only special function register (SFR) to control the block erase or the sector erase for the flash memory rewrite.
ML610Q111/ML610Q112 User’s Manual Chapter 23 Data Flash Memory 23.2.5 Flash Accepter (FLASHACP) Address: 0F0E5H Access: W Access size: 8 bits Initial value: 00H fac7 fac6 fac5 fac4 fac3 fac2 fac1 fac0 FLASHACP Initial value FLASHACP is a write-only special function register (SFR) to control the sector erase, the block erase for the flash memory rewrite or enable/disable the 1-word write operation.
ML610Q111/ML610Q112 User’s Manual Chapter 23 Data Flash Memory 23.2.8 Flash Protection Register (FLASHPRT) Address: 0F0E8H Access: R/W Access size: 8 bits Initial value: 00H FLASHPRT — — — — FPRT3 FPRT2 FPRT1 FPRT0 — — — — Initial value FLASHPRT is a special function register (SFR) to control the sector erase, block erase, and 1-word write in the segment 2 0000H to 03FFH, 0400H to 07FFH, 0800H to 0BFFH, or 0C00H to 0FFFH.
Page 362
ML610Q111/ML610Q112 User’s Manual Chapter 23 Data Flash Memory • FPRT3 (bit 3) The FPRT3 is a bit to control the sector erase, block erase, and 1-word write in the segment 2 0C00H to 0FFFH. Writing “1” to FPRT3 sets FPRT3 to “1”, and disables the subsequent sector erases, block erases, and 1-word writes in the segment 2 0C00H to 0FFFH.
ML610Q111/ML610Q112 User’s Manual Chapter 23 Data Flash Memory 23.3 Description of Operation The rewrite function includes the sector erase function that erases by 1K bytes, the block erase function that erases by 4K bytes, and the 1-word write function that writes by 1 word (2 bytes).
ML610Q111/ML610Q112 User’s Manual Chapter 23 Data Flash Memory 23.3.1 Sector Erase Function This function erases the flash memory data by sector (1K bytes). When writing “01H” to the flash self register (FLASHSLF), writing “0FAH” and “0F5H” to the flash acceptor (FLASHACP), setting block addresses for the flash segment register (FLASHSEG) and the flash address register H (FLASHAH), and then writing “1”...
Page 367
ML610Q111/ML610Q112 User’s Manual Chapter 23 Data Flash Memory Figure 23-2 shows a sample program of sector erase. offset FLASHAH ; EA <- FLASHAH address #0FAH ; Flash acceptor enable data #0F5H ; Flash acceptor enable data #(offset FLASHACP)&0FFH #(offset FLASHACP)>>8 ;...
ML610Q111/ML610Q112 User’s Manual Chapter 23 Data Flash Memory 23.3.2 Block Erase Function This function erases the flash memory data by block (4K bytes). When writing “01H” to the flash self register (FLASHSLF), writing “0FAH” and “0F5H” to the flash acceptor (FLASHACP), setting block addresses for the flash segment register (FLASHSEG) and the flash address register H (FLASHAH), and then writing “1”...
Page 369
ML610Q111/ML610Q112 User’s Manual Chapter 23 Data Flash Memory Figure 23-4 shows a sample program of erase. block offset FLASHAH ; EA <- FLASHAH address #0FAH ; Flash acceptor enable data #0F5H ; Flash acceptor enable data #(offset FLASHACP)&0FFH #(offset FLASHACP)>>8 ;...
ML610Q111/ML610Q112 User’s Manual Chapter 23 Data Flash Memory 23.3.3 1-Word Write Function This function writes data to the flash memory by 1 word (2 bytes). Write “01H” to the flash self register (FLASHSLF) and write “0FAH” and “0F5H” to the flash acceptor (FLASHACP) and set the address in the flash segment register (FLASHSEG) and the flash address register L, H (FLASHAL,H).
Page 371
ML610Q111/ML610Q112 User’s Manual Chapter 23 Data Flash Memory offset FLASHAL ; EA <- FLASHAL address #0FAH ; Flash acceptor enable data #0F5H ; Flash acceptor enable data #02H ; Address increment data #00H #(offset FLASHACP)&0FFH #(offset FLASHACP)>>8 ; ER4 <- FLASHACP address...
ML610Q111/ML610Q112 User’s Manual Chapter 23 Data Flash Memory 23.3.4 Notes in Use When the power is down or the operation is terminated forcibly during sector erase, block erase, or 1-word write, retry the sector erase or block erase and rewrite the sector block area.
ML610Q111/ML610Q112 User's Manual Chapter 24 On-chip Debug 24 On-Chip Debug Function 24.1 Overview This LSI has an on-chip debug function allowing Flash memory rewriting. The on-chip debug emulator (uEASE) is connected to this LSI to perform the on-chip debug function.
ML610Q111/ML610Q112 User’s Manual Appendix A Registers Appendix A Registers Contents of Registers Symbol Symbol Initial Address Name Size (Byte) (Word) value 0F000H Data segment register 0F001H Reset status register RSTAT Undefined 0F002H Frequency control register 0 FCON0 8/16...
Page 377
ML610Q111/ML610Q112 User’s Manual Appendix A Registers Symbol Symbol Initial Address Name Size (Byte) (Word) value 0F252H Port A control register 0 PACON0 8/16 PACON 0F253H Port A control register 1 PACON1 0F254H Port A mode register 0 PAMOD0 8/16 PAMOD...
ML610Q111/ML610Q112 User’s Manual Appendix A Registers Symbol Symbol Initial Address Name Size (Byte) (Word) value 0F2D2H SA-ADC result register 1L SADR1L 8/16 SADR1 0F2D3H SA-ADC result register 1H SADR1H 0F2D4H SA-ADC result register 2L SADR2L 8/16 SADR2 0F2D5H SA-ADC result register 2H...
Page 379
ML610Q111/ML610Q112 User’s Manual Appendix A Registers Symbol Symbol Initial Address Name Size (Byte) (Word) value 0F918H PWMC control register 2 PWCCON2 8/16 PWCCON23 0F919H PWMC control register 3 PWCCON3 0F920H PWMD period register L PWDPL 8/16 0FFH PWDP 0F921H PWMD period register H...
ML610Q111/ML610Q112 User’s Manual Appendix B Package Dimensions Appendix B Package Dimensions ML610Q111 Figure B-1 TSSOP20 Notes for Mounting the Surface Mount Type Package The surface mount type packages are very susceptible to heat in reflow mounting and humidity absorbed in storage.
Page 381
ML610Q111/ML610Q112 User’s Manual Appendix B Package Dimensions ML610Q112 FigureB-2 LQFP32 Notes for Mounting the Surface Mount Type Package 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).
ML610Q111/ML610Q112 User’s Manual Appendix C Electrical Characteristics Appendix C Electrical Characteristics Absolute Maximum Ratings = 0V) Parameter Symbol Condition Rating Unit −0.3 to +7.0 Power supply voltage Ta = 25°C −0.3 to V +0.3 Input voltage Ta = 25°C −0.3 to V...
Page 383
ML610Q111/ML610Q112 User’s Manual Appendix C Electrical Characteristics DC Characteristics (1/4) (VDD=2.7 to 5.5V, VSS=0V, Ta=−40 to +105°C, unless otherwise specified) Rating Symb Measuring Parameter Condition Unit circuit Min. Typ. Max. CPU : In STOP state ― µA Supply current 1...
Page 384
ML610Q111/ML610Q112 User’s Manual Appendix C Electrical Characteristics DC Characteristics (2/4) =0V, Ta=−40 to +105°C, unless otherwise specified) =2.7 to 5.5V, V Rating Measuring Parameter Symbol Condition Unit circuit Min. Typ. Max. Typ. Typ. Ta=25°C −3.0% +3.0% VLS0 threshold voltage 2.85...
Page 385
ML610Q111/ML610Q112 User’s Manual Appendix C Electrical Characteristics DC Characteristics (3/4) =0V, Ta=−40 to +105°C, unless otherwise specified) =2.7 to 5.5V, V Rating Measuring Parameter Symbol Condition Unit circuit Min. Typ. Max. IOH = −3.0mA, V = 4.5V ― ―...
Page 386
ML610Q111/ML610Q112 User’s Manual Appendix C Electrical Characteristics Measuring circuit Measuring circuit 1 Measuring circuit 2 (*2) : 1μF Measuring circuit 3 Measuring circuit 4 (*2) (*3) *1: Input logic circuit to determine the specified measuring conditions. *2: Measured at the specified output pins.
Page 387
ML610Q111/ML610Q112 User’s Manual Appendix C Electrical Characteristics AC Characteristics (Clock) (VDD=2.7 to 5.5V, VSS=0V, Ta=−40 to +105°C, unless otherwise specified) Rating Parameter Symbol Condition Unit Min. Typ. Max. Typ. Typ. Ta = -20°C to 85°C 32kHz RC oscillation frequency 32.768...
Page 388
ML610Q111/ML610Q112 User’s Manual Appendix C Electrical Characteristics AC Characteristics (External Interrupt) =0V, Ta=−40 to +105°C, unless otherwise specified) =2.7 to 5.5V, V Rating Parameter Symbol Condition Unit Min. Typ. Max. Interrupt: Enabled (MIE = 1), 2.5 X 3.5 X ―...
Page 389
ML610Q111/ML610Q112 User’s Manual Appendix C Electrical Characteristics AC Characteristics (Synchronous Serial Port) =0V, Ta=−40 to +105°C, unless otherwise specified) =2.7 to 5.5V, V Rating Parameter Symbol Condition Unit Min. Typ. Max. When high-speed oscillation is not ― ― µs...
Page 390
ML610Q111/ML610Q112 User’s Manual Appendix C Electrical Characteristics AC Characteristics (I C Bus Interface: Standard Mode 100kHz) =0V, Ta=−40 to +105°C, unless otherwise specified) =2.7 to 5.5V, V Rating Parameter Symbol Condition Unit Min. Typ. Max. ― ― SCL clock frequency SCL hold time ―...
Page 391
ML610Q111/ML610Q112 User’s Manual Appendix C Electrical Characteristics Electrical Characteristics of Successive Approximation Type A/D Converter =0V, Ta=−40 to +105°C, unless otherwise specified) =2.7 to 5.5V, V Rating Parameter Symbol Condition Unit Min. Typ. Max. ― ― Resolution ≤5kΩ,HSCLK=8.192MHz −4...
ML610Q111/ML610Q112 User’s Manual Appendix D Application Circuit Example Appendix D Application Circuit Example 5.0V uEASE Interface 3.3VOUT VTref TEST TEST RESET_N RESET_N PB0/PWMC ML610Q111 ML610Q112 Reset IC PB1/AIN3 AD Input /SCL /SDA WP SCL SDA C EEPROM A0 A1 A2 : 1μF...
[ ] For fail safe in your system, please fill unused program memory area (your program code does not use) with BRK instruction code “0FFH”. Please fill the area with the code “0FFH” when you release a code for LAPIS Semiconductor’s factory programming.
Page 395
ML610Q111/ML610Q112 User's Manual Appendix E Check List •Non-maskable interrupt [ ] The watchdog timer interrupt (WDTINT) is a non-maskable interrupt that does not depend on MIE flag (Refer to Sections 5.2.10. and 5.3 in the User's Manual). Chapter 6 Clock Generation Circuit •Initial System clock...
Page 396
Chapter 24 On-Chip Debug Function • Operating Conditions [ ] Supply a voltage from 2.7V to 5.5V to the VDD pin when programming (erasing and writing) the Flash ROM with LAPIS semiconductor development tool uEASE. [ ] Please do not apply LSIs being used for debugging to mass production.
Page 397
ML610Q111/ML610Q112 User's Manual Appendix E Check List Appendix A SFR (Specific Function Registers) •Initial value Refer to Appendix A in the user’s manual [ ] Please confirm there are some SFRs have undefined initial value at reset ( Appendix C Electrical Characteristics •External capacitors for Power circuits...
Page 399
ML610Q111/ML610Q112 User’s Manual Revision History Revision History Page Document No. Date Description Previous Current Edition Edition FEUL610Q111-01 Oct. 01, 2013 – – Final edition 1 Add note to WDTMOD register. Corrected a description of PWMF Period 10-26 10-26 register. FEUL610Q111-02 Feb.
Page 400
ML610Q111/ML610Q112 User’s Manual Revision History Added a description of writing to time base counter (LTBR). Changed from “Auto reload timer” to “Continuous mode”. Changed florm “One-shot timer mode” to “One-shot mode .” 8-6 to 8-6 to Added note of timer n data register (TMnD).
Page 401
ML610Q111/ML610Q112 User’s Manual Revision History Removed a description of multi master of I20BB bit. 13-9 13-9 Removed a description of clock synchronization of I20ER bit.. Remove a description of multi master of I20ER bit.. 13-12 13-12 Added a description of I20ER bit.
Page 402
ML610Q111/ML610Q112 User’s Manual Revision History Added note for using a port as comparator 22-9 22-10 input. Corrected the condition of the rewrite count of data flash memory. 23-1 23-1 (wrong) -20 to 75°C(Ta) (correct) -20 to 85°C(Ta) 23-4 23-4 Added note of the 1-word writing operation.
Need help?
Do you have a question about the ML610Q111 and is the answer not in the manual?
Questions and answers