Fujitsu 8FX Hardware Manual

8-bit microcontroller new 8fx family
Hide thumbs

Advertisement

Quick Links

Table of Contents
FUJITSU SEMICONDUCTOR
MN702-00009-2v0-E
CONTROLLER MANUAL
8-BIT MICROCONTROLLER
New 8FX
MB95630H Series
HARDWARE MANUAL

Advertisement

Table of Contents
loading

  Related Manuals for Fujitsu 8FX

  Summary of Contents for Fujitsu 8FX

  • Page 1 FUJITSU SEMICONDUCTOR MN702-00009-2v0-E CONTROLLER MANUAL 8-BIT MICROCONTROLLER New 8FX MB95630H Series HARDWARE MANUAL...
  • Page 3 8-BIT MICROCONTROLLER New 8FX MB95630H Series HARDWARE MANUAL For the information for microcontroller supports, see the following website. http://edevice.fujitsu.com/micom/en-support/ FUJITSU SEMICONDUCTOR LIMITED...
  • Page 5 ■ Sample Programs Fujitsu Semiconductor provides sample programs free of charge to operate the peripheral resources of the New 8FX family of microcontrollers. Feel free to use such sample programs to check the operational specifications and usages of Fujitsu microcontrollers.
  • Page 6 How to Use This Manual ■ Finding a Function The following methods can be used to search for details of a function in this manual: • Searching from CONTENTS CONTENTS lists the contents in this manual in the order of description. •...
  • Page 7 (including, without limitation, submersible repeater and artificial satellite). FUJITSU SEMICONDUCTOR shall not be liable for you and/or any third party for any claims or damages arising out of or in connection with above-mentioned uses of the products.
  • Page 9: Table Of Contents

    CONTENTS CHAPTER 1 MEMORY ACCESS MODE .............. 1 Memory Access Mode ......................2 CHAPTER 2 CPU ....................3 Dedicated Registers ......................4 2.1.1 Register Bank Pointer (RP) .................... 6 2.1.2 Direct Bank Pointer (DP) ....................7 2.1.3 Condition Code Register (CCR) ..................9 General-purpose Register ....................
  • Page 10 5.1.3 Nested Interrupts ......................77 5.1.4 Interrupt Processing Time .................... 78 5.1.5 Stack Operation During Interrupt Processing ............... 79 5.1.6 Interrupt Processing Stack Area ................... 80 CHAPTER 6 I/O PORT ..................81 Overview ..........................82 Configuration and Operations .................... 83 CHAPTER 7 TIME-BASE TIMER ................
  • Page 11 11.3 Channel ........................... 141 11.4 Pins ..........................142 11.5 Interrupts ......................... 143 11.6 Operation of Interval Timer Function (One-shot Mode) ........... 144 11.7 Operation of Interval Timer Function (Continuous Mode) ..........146 11.8 Operation of Interval Timer Function (Free-run Mode) ............ 148 11.9 Operation of PWM Timer Function (Fixed-cycle Mode) ..........
  • Page 12 14.6.1 Operations in Asynchronous Mode (Operating Mode 0, 1) ........223 14.6.2 Operations in Synchronous Mode (Operating Mode 2) ..........227 14.6.3 Operations of LIN function (Operating Mode 3) ............231 14.6.4 Serial Pin Direct Access ..................... 234 14.6.5 Bidirectional Communication Function (Normal Mode) ..........235 14.6.6 Master/Slave Mode Communication Function (Multiprocessor Mode) .......
  • Page 13 18.2 Configuration ........................307 18.3 Channel ........................... 309 18.4 Pins ..........................310 18.5 Interrupt ........................... 311 18.6 Operations and Setting Procedure Example ..............312 18.6.1 8-bit PPG Independent Mode ..................313 18.6.2 8-bit Prescaler + 8-bit PPG Mode ................315 18.6.3 16-bit PPG Mode ......................
  • Page 14 CHAPTER 21 MULTI-PULSE GENERATOR ............377 21.1 Overview .......................... 378 21.2 Block Diagram ......................... 381 21.3 Pins ..........................389 21.4 Interrupts ......................... 390 21.5 Operations ........................392 21.5.1 Operation of Position Detection .................. 394 21.5.2 Operation of Data Write Control Unit ................396 21.5.3 Operation of 16-bit MPG Output Data Buffer Register (Upper/Lower) (OPDBRHx/OPDBRLx) ....................
  • Page 15 22.6.2 Operations in Operation Mode 1 ................470 22.7 Registers ......................... 476 22.7.1 UART/SIO Serial Mode Control Register 1 ch. n (SMC1n) ........477 22.7.2 UART/SIO Serial Mode Control Register 2 ch. n (SMC2n) ........479 22.7.3 UART/SIO Serial Status and Data Register ch. n (SSRn) .......... 481 22.7.4 UART/SIO Serial Input Data Register ch.
  • Page 16 26.4.5 Toggle Bit2 Flag (DQ2) ....................548 26.5 Programming/Erasing Flash Memory ................549 26.5.1 Placing Flash Memory in Read/Reset State ............... 550 26.5.2 Programming Data to Flash Memory ................551 26.5.3 Erasing All Data from Flash Memory (Chip Erase) ............. 553 26.5.4 Erasing Specific Data from Flash Memory (Sector Erase) .........
  • Page 17 Bit Manipulation Instructions (SETB, CLRB) ..............621 MC-8FX Instructions ....................622 Instruction Map ........................ 625 xiii...
  • Page 19 Major revisions in this edition A change on a page is indicated by a vertical line drawn on the left of that page. Page Revisions (For details, see their respective pages.) CHAPTER 3 CLOCK Corrected the connection between the main CR PLL clock CONTROLLER oscillator circuit and the PLLC control register (PLLC).
  • Page 20 Page Revisions (For details, see their respective pages.) CHAPTER 15 8/10-BIT A/D Corrected the register name of the ADDH and ADDL CONVERTER registers. 15.2 Configuration of 8/10-bit A/D A/D converter data registers (ADDH, ADDL) Converter 8/10-bit A/D converter data registers (ADDH, ADDL) Corrected the register name of the ADC1 register.
  • Page 21 Page Revisions (For details, see their respective pages.) Corrected the register name of the IBCR0n register. CHAPTER 24 I C BUS INTERFACE C bus control register 0 24.3 Channel ■ Channel of I C Bus Interface C bus control register 0 ch. n Table 24.3-2 Corrected the register name of the IBCR1n register.
  • Page 22 xviii...
  • Page 23: Chapter 1 Memory Access Mode

    CHAPTER 1 MEMORY ACCESS MODE This chapter describes the memory access mode. Memory Access Mode MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 24: Memory Access Mode

    Reserved. Do not set mode data to any value other than 0x00. After a reset is released, the CPU fetches mode data first. The CPU then fetches the reset vector after the mode data. It starts executing instructions from the address set in the reset vector. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 25: Chapter 2 Cpu

    CHAPTER 2 This chapter describes the functions and operations of the CPU. Dedicated Registers General-purpose Register Placement of 16-bit Data in Memory MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 26: Dedicated Registers

    (8-bit) data. For byte-length arithmetic and transfer operations, only the lower eight bits (AL) of the accumulator are used with the upper eight bits (AH) left unchanged. The initial value set immediately after a reset is "0x0000". FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 27 (0x0078). Note that the condition code register (CCR) is a part of the program status register and cannot be accessed independently. Refer to the "F MC-8FX Programming Manual" for details on using the dedicated registers. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 28: Register Bank Pointer (Rp)

    PS with the "MOVW A,PS" instruction. Values can also be directly written to and read from the two pointers by accessing "0x0078", the mirror address of the register bank pointer. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 29: Direct Bank Pointer (Dp)

    0x0200 to 0x027F 0b100 0x0080 to 0x00FF 0x0280 to 0x02FF 0b101 0x0300 to 0x037F 0b110 0x0380 to 0x03FF 0b111 0x0400 to 0x047F *: The available access area varies among products. For details, refer to the device data sheet. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 30 Table 2.1-2 Direct Address Instruction List Applicable instructions CLRB dir:bit SETB dir:bit BBC dir:bit,rel BBS dir:bit,rel MOV A,dir CMP A,dir ADDC A,dir SUBC A,dir MOV dir,A XOR A,dir AND A,dir OR A,dir MOV dir,#imm CMP dir,#imm MOVW A,dir MOVW dir,A FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 31: Condition Code Register (Ccr)

    This flag indicates whether the result of an operation has caused an overflow, with the operand used in the operation being regarded as an integer expressed as a complement of two. If an overflow occurs, the overflow flag is set to "1"; otherwise, it is set to "0". MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 32 Table 2.1-3 Interrupt Levels Interrupt level Priority High Low (No interrupt) The interrupt level bits (IL[1:0]) are usually "0b11" when the CPU does not service an interrupt (with the main program running). For details of interrupts, see "5.1 Interrupts". FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 33: General-Purpose Register

    The number of banks available is restricted by Bank 0 the available RAM size. Memory area For information on the general-purpose register area available on each product, see "■ AREAS FOR SPECIFIC APPLICATIONS" in the device data sheet. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 34 512 bytes or above. Therefore, when using a program development tool such as a C compiler to set a general-purpose register area, ensure that the area used as a general-purpose register area does not exceed the size of RAM installed. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 35: Placement Of 16-Bit Data In Memory

    Storage state of 16-bit data in the stack When 16-bit register data is saved in a stack on an interrupt, the upper byte is stored at a lower address in the same way as 16-bit data specified by an operand. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 36 CHAPTER 2 CPU MB95630H Series 2.3 Placement of 16-bit Data in Memory FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 37: Chapter 3 Clock Controller

    Overview Oscillation Stabilization Wait Time Registers Clock Modes Operations in Low Power Consumption Mode (Standby Mode) Clock Oscillator Circuit Overview of Prescaler Configuration of Prescaler Operation of Prescaler 3.10 Notes on Using Prescaler MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 38: Overview

    CHAPTER 3 CLOCK CONTROLLER MB95630H Series 3.1 Overview Overview The New 8FX family has a built-in clock controller that optimizes its power consumption. It supports both of the external main clock and the external subclock. The clock controller enables/disables clock oscillation, enables/disables the supply of clock signals to the internal circuit, selects the clock source, and controls the internal CR oscillator and frequency divider circuits.
  • Page 39 (1): Main clock (F (5): Main CR clock (F (9): Main CR PLL clock (F MCRPLL (2): Subclock (F (6): Sub-CR clock (F (3): Main clock (7): Source clock (SCLK) (4): Subclock (8): Machine clock (MCLK) MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 40 ● Standby control register (STBC) This register controls the transition from RUN state to standby mode, the setting of pin states in stop mode, time-base timer mode, or watch mode, and the generation of software resets. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 41 ● Oscillation stabilization wait time setting register (WATR) This register sets the oscillation stabilization wait times for the main clock and subclock. ● Standby control register 2 (STBC2) This register controls the deep standby mode. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 42 The machine clock is generated by dividing the subclock by two. Sub-CR clock mode The machine clock is generated by dividing the sub-CR clock by two. In any clock mode, the frequency of a selected clock can be divided. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 43 In addition, with the hardware watchdog timer already started, the watchdog timer operates also in standby mode, depending on the settings of the non-volatile register (NVR) interface. For details of the non-volatile register (NVR) interface, see "CHAPTER 27 NON-VOLATILE REGISTER (NVR) INTERFACE". MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 44 *6: The state of the Flash memory in a standby mode can be selected from two options, normal state and low- power state, by the deep standby mode control bit in the standby control register 2 (STBC2:DSTBYX). FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 45 *6: The state of the Flash memory in a standby mode can be selected from two options, normal state and low- power state, by the deep standby mode control bit in the standby control register 2 (STBC2:DSTBYX). MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 46: Oscillation Stabilization Wait Time

    Power-on reset Initial value: (2 -2)/F : main clock frequency) Main clock Other than power-on reset Register settings (WATR:MWT[3:0]) Power-on reset Initial value: (2 -2)/F : subclock frequency) Subclock Other than power-on reset Register settings (WATR:SWT[3:0]) FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 47 For details on state transition, see "3.4 Clock Modes" and "3.5 Operations in Low Power Consumption Mode (Standby Mode)". MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 48 Sub-CR clock > Subclock > Main clock • Subclock mode Sub-CR clock > Main CR clock or main clock > Main CR PLL clock • Sub-CR clock mode Main CR clock or main clock > Subclock > Main CR PLL clock FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 49: Registers

    System clock control register 3.3.1 PLLC PLL control register 3.3.2 WATR Oscillation stabilization wait time setting register 3.3.3 STBC Standby control register 3.3.4 SYCC2 System clock control register 2 3.3.5 STBC2 Standby control register 2 3.3.6 MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 50: System Clock Control Register (Sycc)

    The machine clock is generated from the source clock according to the divide ratio set by these bits. bit1:0 Details Writing "00" Source clock (no division) Writing "01" Source clock/4 Writing "10" Source clock/8 Writing "11" Source clock/16 FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 51: Pll Control Register (Pllc)

    PLL clock oscillation has stopped. Reading "1" Indicates that the main CR PLL clock oscillation wait time is over. [bit3:0] Undefined bits Their read values are always "0". Writing values to these bits has no effect on operation. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 52: Oscillation Stabilization Wait Time Setting Register (Watr)

    "1". These bits can be modified when the subclock is stopped with the subclock oscillation stop bit in the system clock control register 2 (SYCC2:SOSCE) set to "0" in main clock mode, main CR clock mode, main CR PLL clock mode, or sub-CR clock mode. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 53 "1". These bits can be modified when the main clock is stopped with the main clock oscillation stop bit in the system clock control register 2 (SYCC2:MOSCE) set to "0" in main CR clock mode, main CR PLL clock mode, subclock mode, or sub-CR clock mode. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 54: Standby Control Register (Stbc)

    An external pin becomes high impedance in stop mode, time-base timer mode and watch mode. Writing "1" (A pin for which connection to a pull-up resistor has been selected in the pull-up register is pulled up.) FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 55 (SRST) and watch bit (TMD), are set to "1" together, the order of priority for such bits is as follows: (1) Software reset bit (SRST) (2) Stop bit (STP) (3) Watch bit (TMD) (4) Sleep bit (SLP) When released from standby mode, the device returns to the normal operating state. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 56: System Clock Control Register 2 (Sycc2)

    Indicates that the clock controller is in the main CR clock oscillation stabilization wait state or Reading "0" that the main CR clock oscillation has stopped. Reading "1" Indicates that the main CR clock oscillation wait time is over. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 57 When the current clock mode is subclock mode or sub-CR clock mode, writing "1" to this bit has no effect on operation. bit0 Details Writing "0" Disables the main CR clock oscillation. Writing "1" Enables the main CR clock oscillation. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 58: Standby Control Register 2 (Stbc2)

    Refer to "■ ELECTRICAL CHARACTERISTICS" in the device data sheet for the difference between the deep standby mode and the normal standby mode in power consumption. • Do not make the device transit to deep standby mode when a Flash command sequence (except read/reset) has been invoked. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 59: Clock Modes

    CR clock mode or main CR PLL clock mode to subclock mode or sub-CR clock mode. In subclock mode or sub-CR clock mode, writing "1" to SYCC2:MOSCE, SYCC2:MCRE or PLLC:MPEN cannot enable the main clock, the main CR clock, or the main CR PLL clock respectively. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 60 (or main CR PLL clock) stabilization stabilization stabilization oscillation stabilization wait time wait time wait time (13) (18) (17) Sub-CR clock oscillation stabilization (20) wait time (19) Subclock mode Sub-CR clock mode (15) (16) Subclock oscillation stabilization wait time (14) FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 61 PLL control register (PLLC:MPRDY) is "1", the device transits to main CR PLL clock mode immediately after the clock mode select bits (SYCC:SCS[2:0]) are set to "0b111". Sub-CR clock Same as (1) and (2) (10) (11) Subclock Same as (3) and (4) (12) MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 62 (15) Subclock Same as (3) and (4) (16) Main CR clock/ (17) Main CR PLL Same as (13) clock Subclock (18) Main clock Same as (14) (19) Sub-CR clock Same as (1) and (2) (20) FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 63: Operations In Low Power Consumption Mode (Standby Mode)

    I/O port or a peripheral function pin to high impedance in stop mode, time-base timer mode or watch mode. Refer to the device data sheet for the states of all pins in standby mode. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 64: Notes On Using Standby Mode

    (CCR) of the CPU. If interrupts are not to be accepted according to the settings of CCR, the device resumes instruction execution from the instruction following the one executed before the device transits to standby mode. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 65 For details of the Flash recovery wait time, see Table 3.5-2. For the difference between deep standby mode and normal standby mode in power consumption, refer to "■ ELECTRICAL CHARACTERISTICS" in the device data sheet. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 66 (STBC:TMD) in main clock mode, main CR clock mode, Time-base timer mode or main CR PLL clock mode. The device returns to the RUN state in response to an interrupt from a peripheral function. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 67 The device transits to watch mode when "1" is written to the watch bit in the standby control register (STBC:TMD) in subclock mode or sub-CR clock mode. Watch mode The device returns to the RUN state in response to an interrupt from a peripheral function. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 68 In main clock mode, main CR clock mode, or main CR PLL clock mode Maximum: 10 SCLK + 150 µs + 6 MCLK • In subclock mode or sub-CR clock mode Maximum: 2 SCLK + 150 µs + 6 MCLK FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 69 During the Flash recovery wait time, the device transits to sleep mode. (The CPU stops its operation; the peripheral function resumes its operation.) However, if a program is being executed on the RAM, no Flash recovery wait time occurs. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 70: Sleep Mode

    Flash recovery wait time elapses. However, if a program is being executed on the RAM, no Flash recovery wait time occurs. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 71: Stop Mode

    When the oscillation stabilization wait time is longer than the Flash recovery wait time After the oscillation stabilization wait time elapses, the device returns to the RUN state. However, if a program is being executed on the RAM, no Flash recovery wait time occurs. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 72 Therefore, some settings of that peripheral function, such as the initial interval time of the interval timer, become undefined. Initialize that peripheral function if necessary after releasing the device from stop mode. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 73: Time-Base Timer Mode

    Flash recovery wait time elapses. However, if a program is being executed on the RAM, no Flash recovery wait time occurs. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 74 Therefore, some settings of that peripheral function, such as the initial interval time of the interval timer, become undefined. Initialize that peripheral function if necessary after releasing the device from time-base timer mode. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 75: Watch Mode

    Therefore, some settings of that peripheral function, such as the initial interval time of the interval timer, become undefined. Initialize that peripheral function if necessary after releasing the device from watch mode. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 76: Clock Oscillator Circuit

    X0A pin while leaving the X1A pin unconnected. Figure 3.6-2 Sample Connection of External Clocks X1 open Inverted X0 input to X1 Main clock Subclock Main clock Subclock oscillator circuit oscillator circuit oscillator circuit oscillator circuit Open Open Open FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 77: Overview Of Prescaler

    , or F ) of the time- MCRPLL MCRPLL base timer. • 8/16-bit composite timer • 8/10-bit A/D converter • 8/16-bit PPG • 16-bit PPG timer • 16-bit reload timer • UART/SIO dedicated baud rate generator MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 78: Configuration Of Prescaler

    ■ Output Clock The prescaler supplies clocks to the following peripheral functions: • 8/16-bit composite timer • 8/10-bit A/D converter • 8/16-bit PPG • 16-bit PPG timer • 16-bit reload timer • UART/SIO dedicated baud rate generator FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 79: Operation Of Prescaler

    Count Clock Sources Generated by Prescaler (F Frequency Count clock source = 4 MHz, frequency MCLK= 4 MHz) MCLK/2 2 MHz MCLK/4 1 MHz MCLK/8 0.5 MHz MCLK/16 0.25 MHz MCLK/32 125 kHz 62.5 kHz 31.25 kHz MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 80 MCLK/16 0.5 MHz 0.625 MHz 0.75 MHz 1 MHz MCLK/32 0.25 MHz 0.3125 MHz 0.375 MHz 0.5 MHz 125 kHz 156.25 kHz 187.5 kHz 0.25 MHz MCRPLL 62.5 kHz 78.125 kHz 93.75 kHz 125 kHz MCRPLL FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 81: Notes On Using Prescaler

    The prescaler count value affects the following peripheral functions: • 8/16-bit composite timer • 8/10-bit A/D converter • 8/16-bit PPG • 16-bit PPG timer • 16-bit reload timer • UART/SIO dedicated baud rate generator MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 82 CHAPTER 3 CLOCK CONTROLLER MB95630H Series 3.10 Notes on Using Prescaler FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 83: Chapter 4 Reset

    CHAPTER 4 RESET This section describes the reset operation. Reset Operation Register Notes on Using Reset MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 84: Reset Operation

    After the watchdog timer starts, a watchdog reset is generated if the watchdog timer is not cleared within a predetermined period of time. ● Power-on reset A power-on reset is generated when the power is switched on. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 85 "L" level while resetting it. However, the function to output "L" level is not provided for external reset in the reset pin. For details of the reset input function and the reset output function setting, see "CHAPTER 29 SYSTEM CONFIGURATION CONTROLLER". MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 86 RAM access ends. This function prevents a word-data write operation from being interrupted by a reset while data of two bytes is being written. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 87 Connect a pull-up resistor to a pin that becomes high impedance during a reset to prevent the device from malfunctioning. For details of the states of all pins during a reset, refer to the device data sheet. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 88: Register

    CHAPTER 4 RESET MB95630H Series 4.2 Register Register This section provides details of the register for reset. Table 4.2-1 List of Register for Reset Register Register name Reference abbreviation RSRR Reset source register 4.2.1 FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 89: Reset Source Register (Rsrr)

    A read access or a write access (writing "0" or "1") to this bit sets it to "0". bit2 Details Read access Sets this bit to "0". Being set to "1" Indicates that the a power-on reset or a low-voltage detection reset (optional) has occurred. Write access Sets this bit to "0". MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 90 Indicates that the a software reset has occurred. Write access Sets this bit to "0". Note: Since reading the reset source register clears its contents, save the contents of this register to the RAM before using those contents for calculation. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 91 When this bit is set to "1", that indicates one of the following reset has occurred: an external reset, a watchdog reset, a power-on reset or a low-voltage detection reset (optional). SWR: When this bit is set to "1", that indicates that a software reset has occurred. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 92: Notes On Using Reset

    The type of reset source determines which bit in the reset source register (RSRR) is to be initialized. • The oscillation stabilization wait time setting register (WATR) of the clock controller can only be initialized by a power-on reset. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 93: Chapter 5 Interrupts

    CHAPTER 5 INTERRUPTS This chapter describes the interrupts. Interrupts MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 94: Interrupts

    This section describes the interrupts. ■ Overview of Interrupts The New 8FX family has 24 interrupt request inputs for respective peripheral functions, for each of which an interrupt level can be set independently to each other. When a peripheral function generates an interrupt request, the interrupt request is output to the interrupt controller.
  • Page 95: Interrupt Level Setting Registers (Ilr0 To Ilr5)

    The interrupt level setting registers assign a pair of bits to every interrupt request. The values of interrupt level setting bits in these registers represent the priority of an interrupt request (interrupt level: 0 to 3) in interrupt processing. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 96 Table 5.1-1 Relationships Between Interrupt Level Setting Bits and Interrupt Levels LXX[1:0] Interrupt level Priority Highest Lowest (No interrupt) XX:00 to 23 Number of an interrupt request While the main program is being executed, the interrupt level bits in the condition code register (CCR:IL[1:0]) are "0b11". FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 97: Interrupt Processing

    IL value? I flag = 1? Execute main program Interrupt service routine Clear interrupt request Save PC and PS to stack Restore PC and PS Execute interrupt processing interrupt vector RETI Update IL in PS MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 98 (writing "0" to the interrupt request flag bit) in the interrupt service routine. The low power consumption mode (standby mode) is released by an interrupt. For details, see "3.5 Operations in Low Power Consumption Mode (Standby Mode)". FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 99: Nested Interrupts

    CPU resumes executing the program interrupted. In addition, the values of the condition code register (CCR) return to the ones existing before the interrupt due to the restoration of the value of the program status (PS). MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 100: Interrupt Processing Time

    (17 machine clock cycles), the interrupt processing time spans 26 machine clock cycles. The span of a machine clock cycle varies depending on the clock mode and main clock speed change (gear function). For details, see "CHAPTER 3 CLOCK CONTROLLER". FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 101: Stack Operation During Interrupt Processing

    Since the value of the accumulator (A) and that of the temporary accumulator (T) are not automatically saved to the stack, use the PUSHW and POPW instructions to save and restore the values of A and T. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 102: Interrupt Processing Stack Area

    POPW instruction, etc. in ascending order of addresses. If the address value of the stack area used decreases due to nested interrupts or subroutine calls, do not let the stack area overlap the data area and the general-purpose register area, both of which retain other data. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 103: Chapter 6 I/O Port

    CHAPTER 6 I/O PORT This chapter describes the configuration and operations of the I/O port. Overview Configuration and Operations MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 104: Overview

    A/D input disable register (upper)* AIDRH A/D input disable register (lower)* AIDRL *: Refer to "■ I/O MAP" in the device data sheet for the availability of the A/D input disable register (upper) and A/D input disable register (lower). FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 105: Configuration And Operations

    • General-purpose I/O pins/peripheral function I/O pins • Port x data register (PDRx) • Port x direction register (DDRx) • Port x pull-up register (PULx) • A/D input disable register (upper) (AIDRH) • A/D input disable register (lower) (AIDRL) MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 106 • Reading the PDRx register returns the pin value, regardless of whether the peripheral function uses that pin as its input pin. However, if the read-modify-write (RMW) type of instruction is used to read the PDRx register, the PDRx register value is returned. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 107 Setting the bit in the PULx register to "1" makes the pull-up resistor be internally connected to the pin. When the pin output is "L" level, the pull-up resistor is disconnected regardless of the value of the PULx register. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 108 CHAPTER 6 I/O PORT MB95630H Series 6.2 Configuration and Operations FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 109: Chapter 7 Time-Base Timer

    CHAPTER 7 TIME-BASE TIMER This chapter describes the functions and operations of the time-base timer. Overview Configuration Interrupt Operations and Setting Procedure Example Register Notes on Using Time-base Timer MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 110: Overview

    = 0.5 s *2: F = 4 MHz = 0.25 s *3: F = 8 MHz MCRPLL PLL multiplication rate = 2 PLL multiplication rate = 4 MHz 2 = 8 MHz = 0.125 s MCRPLL FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 111: Configuration

    Stops main clock oscillation or main CR clock oscillation clear circuit selector Time-base timer interrupt TBIF TBIE TBC3 TBC2 TBC1 TBC0 TCLR Time-base timer control register (TBTC) : Main clock : Main CR clock : Main CR PLL clock MCRPLL MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 112 The time-base timer uses the main clock divided by two, the main CR clock or the main CR PLL clock as its input clock (count clock). ■ Output Clock The time-base timer supplies clocks to the clock supervisor counter, the software watchdog timer and the prescaler. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 113: Interrupt

    TBIF bit at the same time (TBTC:TBIF = 0). Table 7.3-1 Interrupt of Time-base Timer Item Description Interrupt condition The interval time set by "TBTC:TBC[3:0]" has elapsed. Interrupt flag TBTC:TBIF Interrupt enable TBTC:TBIE MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 114: Operations And Setting Procedure Example

    The device transits from the main clock mode, the main CR clock mode or the main CR PLL clock mode to the subclock mode or the sub-CR clock mode. • At power-on • At low-voltage detection reset FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 115 : Time-base timer interrupt request flag bit in time-base timer control register • TBTC:TBIE : Time-base timer interrupt request enable bit in time-base timer control register • STBC:SLP : Sleep bit in standby control register • STBC:STP : Stop bit in standby control register MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 116 *: For details of the interrupt level setting register (ILR), refer to "CHAPTER 5 INTERRUPTS" in this hardware manual and "■ INTERRUPT SOURCE TABLE" in the device data sheet. ● Processing interrupts 1. Clear the interrupt request flag. (TBTC:TBIF = 0) 2. Clear the counter. (TBTC:TCLR = 1) FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 117: Register

    CHAPTER 7 TIME-BASE TIMER MB95630H Series 7.5 Register Register This section describes the register of the time-base timer. Table 7.5-1 List of Time-base Timer Register Register Register name Reference abbreviation TBTC Time-base timer control register 7.5.1 MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 118: Time-Base Timer Control Register (Tbtc)

    Writing "0" Disables the time-base timer interrupt request. Writing "1" Enables the time-base timer interrupt request. [bit5] Undefined bit The read value is always "0". Writing a value to this bit has no effect on operation. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 119 Clears all bits in the counter of the time-base timer to "1". Note: When the output of the time-base timer is selected as the count clock for the software watchdog timer, clear the time-base timer with this bit also clears the software watchdog timer. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 120: Notes On Using Time-Base Timer

    However, since the software watchdog timer counter is also cleared at the same time as the clock for the software watchdog timer returns to the initial state, the software watchdog timer operates in its normal cycle. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 121: Chapter 8 Hardware/Software Watchdog Timer

    CHAPTER 8 HARDWARE/SOFTWARE WATCHDOG TIMER This chapter describes the functions and operations of the watchdog timer. Overview Configuration Operations and Setting Procedure Example Register Notes on Using Watchdog Timer MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 122: Overview

    Sub-CR timer 0bXX1* (software watchdog timer) or 437 ms 2.62 s (sub-CR clock = 50 kHz to 150 kHz) hardware watchdog timer* *1: X = 0 or 1 *2: CS[1:0] = 0b00, CSP = 1 (read-only) FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 123: Configuration

    Sleep mode starts Counter clear Stop mode starts control circuit Time-base timer/watch mode starts Stopping or running in stop mode : Main clock : Main CR clock : Main CR PLL clock MCRPLL : Subclock : Sub-CR clock MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 124 This register performs setup for activating/clearing the watchdog timer counter as well as for selecting the count clock. ■ Input Clock The watchdog timer uses the output clock of the time-base timer, of the watch prescaler or of the sub-CR timer as the input clock (count clock). FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 125: Operations And Setting Procedure Example

    In the case of activating the hardware watchdog timer with its operation in standby mode enabled, whether the device transits to standby mode or wakes up from standby mode, the counter of the watchdog timer is not cleared and the watchdog timer continues its operation. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 126 When a watchdog reset is generated in subclock mode, the timer starts operating in main clock mode after the oscillation stabilization wait time has elapsed. The reset signal is output during this oscillation stabilization wait time. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 127 "0xA596" and "0xA597" enables the hardware watchdog timer in all modes. See "CHAPTER 27 NON-VOLATILE REGISTER (NVR) INTERFACE" for details of the watchdog timer selection ID. 2. Clear the watchdog timer. (WDTC:WTE[3:0] = 0b0101) MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 128: Register

    CHAPTER 8 HARDWARE/SOFTWARE WATCHDOG TIMER MB95630H Series 8.4 Register Register This section describes the register of the watchdog timer. Table 8.4-1 List of Watchdog Timer Register Register Register name Reference abbreviation WDTC Watchdog timer control register 8.4.1 FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 129: Watchdog Timer Control Register (Wdtc)

    This is a read-only bit used to confirm the start/stop of the hardware watchdog timer. bit4 Details Indicates that the hardware watchdog timer has stopped (The software watchdog timer can be Reading "0" activated). Reading "1" Indicates that the hardware watchdog timer has been activated. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 130 Writing "0101" to these bits in the second write access or later after a reset clears the software watchdog timer. Writing a value Has no effect on operation. other than "0101" Note: Using the read-modify-write (RMW) type of instruction to access the WDTC register is prohibited. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 131: Notes On Using Watchdog Timer

    CPU wakes up from stop mode in subclock mode or sub-CR clock mode. Take account of the setting of the subclock stabilization wait time when selecting the subclock. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 132 CHAPTER 8 HARDWARE/SOFTWARE WATCHDOG TIMER MB95630H Series 8.5 Notes on Using Watchdog Timer FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 133: Chapter 9 Watch Prescaler

    CHAPTER 9 WATCH PRESCALER This chapter describes the functions and operations of the watch prescaler. Overview Configuration Interrupt Operations and Setting Procedure Example Register Notes on Using Watch Prescaler MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 134: Overview

    1.311 s n=17 2.621 s *1: 2/F =20 µs when F =100 kHz *2: 2/F =61.035 µs when F =32.768 kHz Note: Refer to the device data sheet for the accuracy of the sub-CR clock frequency. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 135: Configuration

    Watchdog timer clear Resets, or stops Counter clear Interval timer subclock oscillation or circuit selector sub-CR clock oscillation Interrupt of watch prescaler WTIF WTIE WTC2 WTC1 WTC0 WCLR Watch prescaler control register (WPCR) : Subclock : Sub-CR clock MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 136 The watch prescaler uses the subclock divided by two or the sub-CR clock divided by two as its input clock (count clock). ■ Output Clock The watch prescaler supplies its clock to the software watchdog timer. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 137: Interrupt

    WPCR register to "1" and clear the WTIF bit in the same register simultaneously. Table 9.3-1 Interrupt of Watch Prescaler Item Description Interrupt condition Interval time set by "WPCR:WTC[2:0]" has elapsed. Interrupt flag WPCR:WTIF Interrupt enable WPCR:WTIE MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 138: Operations And Setting Procedure Example

    When the subclock oscillation and the sub-CR clock oscillation are enabled, and the oscillation stabilization wait time elapses, the subclock is selected as the input clock of the watch prescaler. • In subclock mode Only the subclock is used as the input clock of the watch prescaler. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 139 : Watch prescaler interrupt request flag bit in watch prescaler control register • WPCR:WTIE : Watch prescaler interrupt request enable bit in watch prescaler control register • STBC:SLP : Sleep bit in standby control register • STBC:STP : Stop bit in standby control register MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 140 *: For details of the interrupt level setting register (ILR), refer to "CHAPTER 5 INTERRUPTS" in this hardware manual and "■ INTERRUPT SOURCE TABLE" in the device data sheet. ● Processing interrupts 1. Clear the interrupt request flag. (WPCR:WTIF = 0) 2. Clear the counter. (WPCR:WCLR = 1) FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 141: Register

    CHAPTER 9 WATCH PRESCALER MB95630H Series 9.5 Register Register This section describes the register of the watch prescaler. Table 9.5-1 List of Watch Prescaler Register Register Register name Reference abbreviation WPCR Watch prescaler control register 9.5.1 MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 142: Watch Prescaler Control Register (Wpcr)

    Details Writing "0" Disables the watch prescaler interrupt request. Writing "1" Enables the watch prescaler interrupt request. [bit5:4] Undefined bits Their read values are always "0". Writing values to these bits has no effect on operation. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 143 Clears all bits in the counter of the watch prescaler to "1". Note: When the output of the watch prescaler is selected as the count clock of the software watchdog timer, clearing the watch prescaler with this bit also clears the software watchdog timer. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 144: Notes On Using Watch Prescaler

    However, since the software watchdog timer counter is also cleared at the same time as the clock for the software watchdog timer returns to the initial state, the software watchdog timer operates in its normal cycle. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 145: Chapter 10 Wild Register Function

    CHAPTER 10 WILD REGISTER FUNCTION This chapter describes the functions and operations of the wild register function. 10.1 Overview 10.2 Configuration 10.3 Operations 10.4 Registers 10.5 Typical Hardware Connection Example MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 146: Overview

    ROM data can be replaced with modification data set in the registers. Data of up to three different addresses can be modified. The wild register function can be used to debug a program after creating the mask and to patch bugs in the program. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 147: Configuration

    Memory area block Wild register address setting register (WRAR) Wild register data setting register (WRDR) Access control circuit Wild register address compare enable register (WREN) Wild register data test setting register (WROR) Memory space MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 148 (WRAR). If they match, the circuit outputs the data from the wild register data setting register (WRDR) to the data bus. The operation of the control circuit block is controlled by the wild register address compare enable register (WREN). FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 149: Operations

    The wild register function can be applied to all address space except the address "0x0078". Since the address "0x0078" is used as a mirror address for the register bank pointer and the direct bank pointer, this address cannot be patched. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 150: Registers

    Table 10.4-2 Wild Register Numbers Corresponding to Wild Register Address Setting Registers and Wild Register Data Setting Registers Wild register Wild register address setting register Wild register data setting register number (WRAR) (WRDR) WRAR0 WRDR0 WRAR1 WRDR1 WRAR2 WRDR2 FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 151: Wild Register Data Setting Registers (Wrdr0 To Wrdr2)

    The read access to one of these bits is enabled only when the data test setting bit in the wild register data test setting register (WROR) corresponding to the bit to be read is set to "1". MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 152: Wild Register Address Setting Registers (Wrar0 To Wrar2)

    These bits set the address to be amended by the wild register function. The address to be assigned to amendment data is set to these bits. The address is to be specified according to the wild register number corresponding to a wild register address setting register. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 153: Wild Register Address Compare Enable Register (Wren)

    • EN1 corresponds to wild register number 1. • EN2 corresponds to wild register number 2. bit2/bit1/bit0 Details Writing "0" Disables the operation of the wild register function. Writing "1" Enables the operation of the wild register function. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 154: Wild Register Data Test Setting Register (Wror)

    • DRR1 corresponds to wild register number 1. • DRR2 corresponds to wild register number 2. bit2/bit1/bit0 Details Writing "0" Disables reading from the wild register data setting register. Writing "1" Enables reading from the wild register data setting register. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 155: Typical Hardware Connection Example

    10.5 Typical Hardware Connection Example 10.5 Typical Hardware Connection Example Below is an example of typical hardware connection for the application of the wild register function. ■ Hardware Connection Example Figure 10.5-1 Typical Hardware Connection Example EEPROM (Storing correction program) MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 156 CHAPTER 10 WILD REGISTER FUNCTION MB95630H Series 10.5 Typical Hardware Connection Example FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 157: Chapter 11 8/16-Bit Composite Timer

    11.9 Operation of PWM Timer Function (Fixed-cycle Mode) 11.10 Operation of PWM Timer Function (Variable-cycle Mode) 11.11 Operation of PWC Timer Function 11.12 Operation of Input Capture Function 11.13 Operation of Noise Filter 11.14 Registers 11.15 Notes on Using 8/16-bit Composite Timer MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 158: Overview

    8-bit PWM signal of variable cycle and duty depending on the cycle and "L" pulse width specified by registers. In this operating mode, since the two 8-bit counters have to be used separately, the composite timer cannot operate as a 16-bit counter. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 159 In free-run mode, the counter transfers its value to a register to generate an interrupt immediately after the detection of an edge. Afterward, unlike in clear mode, the counter continues to count without being cleared to "0x00". MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 160: Configuration

    For details, refer to the device data sheet. In this chapter, "n" in a pin name and a register abbreviation represents the channel number. For details of pin names, register names and register abbreviations of a product, refer to the device data sheet. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 161 16-bit counter. ● 8-bit comparator The comparator compares the value in the 8/16-bit composite timer data register and that in the counter. It incorporates a latch that temporarily stores the 8/16-bit composite timer data register value. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 162 LIN-UART". In addition, the TII0 pin for any timer other than timer 00 is internally fixed at "0". ■ Input Clock The 8/16-bit composite timer uses the output clock from the prescaler as its input clock (count clock). FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 163: Channel

    The following table lists the external pins on a channel. Table 11.3-1 External Pins of 8/16-bit Composite Timer Pin name Pin function TOn0 Timer n0 output TOn1 Timer n1 output Timer n0 input and timer n1 input MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 164: Pins

    (variable-cycle mode) is selected, the input function of this pin can also be used. To use the input function mentioned above, set the bit in the port direction register corresponding to ECn pin to "0" to make the pin as an input port. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 165: Interrupts

    16-bit detection in the input (variable-cycle mode), except operation capture operation, except in 16-bit operation in 16-bit operation Interrupt flag Tn1CR1:IF Tn1CR1:IF Tn1CR1:IR Interrupt enable Tn1CR1:IE and Tn1CR0:IFE Tn1CR1:IE and Tn1CR0:IFE Tn1CR1:IE MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 166: Operation Of Interval Timer Function (One-Shot Mode)

    (comparison data storage latch) in the comparator when the counter starts counting. Do not write "0x00" to the 8/16-bit composite timer data register. Figure 11.6-2 shows the operation of the interval timer function in 8-bit operation. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 167 Reactivated with output initial value unchanged ("0") Timer output pin For initial value "1" on activation *: If the Tn0DR/Tn1DR data register value is modified during operation, the new value is used from the next active cycle. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 168: Operation Of Interval Timer Function (Continuous Mode)

    Do not write "0x00" to the 8/16-bit composite timer data register while the counter is counting. When the timer stops operating, the timer output bit (TMCRn:TO0/TO1) holds the last value. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 169 *1: If the Tn0DR/Tn1DR data register value is modified during operation, the new value is used from the next active cycle. *2: The counter is cleared and the data register settings are loaded into the comparison data latch whenever a match is detected during operation. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 170: Operation Of Interval Timer Function (Free-Run Mode)

    Do not write "0x00" to the 8/16-bit composite timer data register. When the timer stops operation, the timer output bit (TMCRn:TO0/TO1) holds the last value. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 171 Activated Matched Matched Matched Matched Counter value match* Timer output pin *: Even though a match is detected during operation, the counter is not cleared. The data register settings are reloaded into the comparison data latch. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 172: Operation Of Pwm Timer Function (Fixed-Cycle Mode)

    When the timer stops operation, the timer output bit (TMCRn:TO0/TO1) holds the last value. In the output waveform immediately after activation of the timer (write "1" to the STA bit), the "H" pulse is one count clock shorter than the value set in the Tn0DR/Tn1DR register. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 173 Counter value 0x00 0xFF 0x00 "H" PWM waveform One count width "L" Note: When the PWM function has been selected, the timer output pin holds the level at the point when the counter stops (Tn0CR1/Tn1CR1:STA = 0). MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 174: Operation Of Pwm Timer Function (Variable-Cycle Mode)

    When the timer stops operating, the timer output bit (TMCRn:TO0) holds the last output value. If the 8/16-bit composite timer data register is modified during operation, the data written will become valid from the cycle immediately after the detection of a synchronous match. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 175 "H" PWM waveform "L" Tn0DR register value: 0x00", Tn1DR register value: "0xFF" (duty ratio = 99.6%) Counter timer n0 value 0x00 0x00 Counter timer n1 value 0x00 0xFF, 0x00 "H" PWM waveform "L" One count width MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 176: 11.11 Operation Of Pwc Timer Function

    In addition, the timer output is inverted due to the overflow. The timer output initial value can be set by the timer output initial value bit (Tn0CR1/Tn1CR1:SO). When the timer stops operating, the timer output bit (TMCRn:TO1/TO0) holds the last value. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 177 Figure 11.11-2 Operation Diagram of PWC Timer (Example of H-pulse Width Measurement) "H" width Pulse input (Input waveform to PWC pin) Counter value 0xFF Time Cleared by program STA bit Counter operation IR bit BF bit Data transferred from counter to Tn0DR/Tn1DR T0nDR/Tn1DR data register read MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 178: 11.12 Operation Of Input Capture Function

    Tn1CR1:IF) is set to "1". The interrupt service routine can therefore be used to count the number of overflows. In addition, the timer output is inverted due to the overflow. The timer output initial value can be set by the timer output initial value bit (Tn0CR1/Tn1CR1:SO). FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 179 0xBF 0x9F 0x7F 0x3F Capture value 0xBF 0x7F 0x3F 0x9F in Tn0DR/Tn1DR Rising edge of capture Falling edge of capture Rising edge of Falling edge of capture capture External input Counter clear mode Counter free-run mode MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 180: 11.13 Operation Of Noise Filter

    If the noise filter function is activated, the signal input will be delayed for four machine clock cycles. Figure 11.13-1 Operation of Noise Filter Sampling filter clock External input signal Output filter "H" noise Output filter "L" noise Output filter "H"/"L" noise FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 181: 11.14 Registers

    11.14.2 Tn1CR1 8/16-bit composite timer n1 status control register 1 11.14.2 TMCRn 8/16-bit composite timer timer mode control register 11.14.3 Tn0DR 8/16-bit composite timer n0 data register 11.14.4 Tn1DR 8/16-bit composite timer n1 data register 11.14.4 MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 182: 8/16-Bit Composite Timer Status Control Register 0 (Tn0Cr0/Tn1Cr0)

    With this bit set to "1", an IF flag interrupt request is output when both the IE bit (Tn0CR1/Tn1CR1:IE) and the IF flag (Tn0CR1/Tn1CR1:IF) are set to "1". bit7 Details Writing "0" Disables the IF flag interrupt. Writing "1" Enables the IF flag interrupt. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 183 Writing "100" MCLK/16 Writing "101" MCLK/32 Writing "110" or F MCRPLL Writing "111" External clock *: The value to be used as the count clock depends on the settings of the SCS[2:0] bits in the SYCC register. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 184 Input capture (falling edge, free-run counter) Writing "1100" Input capture (both edges, free-run counter) Writing "1101" Input capture (rising edge, counter clear) Writing "1110" Input capture (falling edge, counter clear) Writing "1111" Input capture (both edges, counter clear) FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 185: 8/16-Bit Composite Timer Status Control Register 1 (Tn0Cr1/Tn1Cr1)

    • Before setting this bit to "1", set the count clock select bits (Tn0CR0/Tn1CR0:C[2:0]), timer operation select bits (Tn0CR0/Tn1CR0:F[3:0]), timer output initial value bit (Tn0CR1/Tn1CR1:SO), 16-bit mode enable bit (TMCRn:MOD), and filter function select bits (TMCRn:FEn1, FEn0). bit7 Details Writing "0" Stops the timer operation. Writing "1" Enables the timer operation. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 186 Indicates that the pulse width measurement has been completed or no edge has been detected. Reading "1" Indicates that the pulse width measurement has been completed or an edge has been detected. Writing "0" Clears this flag. Writing "1" Has no effect on operation. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 187 Reading "0" Indicates that neither timer reload nor overflow has occurred. Reading "1" Indicates that the a timer reload or an overflow has occurred. Writing "0" Clears this flag. Writing "1" Has no effect on operation. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 188 Writing "0" to this bit disables outputting the timer value (TMCRn:TO1/TO0) to the external pin. In this case, the external pin serves as a general-purpose port. Writing "1"to this bit enables outputting the timer value to the external pin. bit0 Details Writing "0" Disables timer output. Writing "1" Enables timer output. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 189: 8/16-Bit Composite Timer Timer Mode Control Register (Tmcrn)

    When the timer operating mode select bits (Tn0CR0/Tn1CR0:F[3:0]) are modified with the timer stopping operating, this bit indicates the last value of timer operation if the same timer operation has been performed; otherwise it indicates its initial value "0". MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 190 (the filter function does not operate.). bit3:2 Details Writing "00" Disables the filter function. Writing "01" Filters out "H" pulse noise. Writing "10" Filters out "L" pulse noise. Writing "11" Filters out both "H" pulse noise and "L" pulse noise. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 191 (the filter function does not operate.). bit1:0 Details Writing "00" Disables the filter function. Writing "01" Filters out "H" pulse noise. Writing "10" Filters out "L" pulse noise. Writing "11" Filters out both "H" pulse noise and "L" pulse noise. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 192: 8/16-Bit Composite Timer Data Register (Tn0Dr/Tn1Dr)

    The current value can be read from this register. In 16-bit operation, write the upper timer data to Tn1DR and lower timer data to Tn0DR, and write or read Tn1DR first and then Tn0DR. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 193 Therefore, do not write data to the register. In 16-bit operation, write the upper timer data to Tn1DR and lower timer data to Tn0DR, and read Tn1DR first and then Tn0DR. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 194 Figure 11.14-1 shows the Tn0DR and Tn1DR registers read from and written to during 16-bit operation. Figure 11.14-1 Read and Write Operations of Tn0DR and Tn1DR Registers during 16-bit Operation Tn0DR Read register buffer Write Read data data Write Tn1DR buffer register Tn1DR Tn0DR Tn1DR Tn0DR write write read read FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 195: 11.15 Notes On Using 8/16-Bit Composite Timer

    (see Figure 11.15-1 and Figure 11.15-2). Therefore, the first interval time or the initial external clock count value is incorrect. Always initialize the counter value after the microcontroller is released from stop mode or watch mode. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 196 (STBC register) Wake-up from stop mode by external interrupt Wake-up from sleep mode by interrupt STP bit (STBC register) HO bit *: The PWM timer output maintains the value held before it enters the stop mode. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 197: Chapter 12 External Interrupt Circuit

    This chapter describes the functions and operations of the external interrupt circuit. 12.1 Overview 12.2 Configuration 12.3 Channels 12.4 Pin 12.5 Interrupt 12.6 Operations and Setting Procedure Example 12.7 Register 12.8 Notes on Using External Interrupt Circuit MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 198: Overview

    Therefore, the operating mode of the device can be changed when a signal is input to the external interrupt pin. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 199: Configuration

    (INT) matches the polarity of the edge selected in the interrupt control register (EIC), a corresponding external interrupt request flag bit (EIR) is set to "1". ● External interrupt control register (EIC) This register is used to select an edge, enable or disable interrupt requests, check for interrupt requests, etc. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 200: Channels

    External interrupt input ch. n+2 INTn+3 External interrupt input ch. n+3 The number of external interrupt circuit units varies among products. For the number of external interrupt circuit units in an individual product, refer to the device data sheet. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 201: Pin

    The state of a pin can always be read from the port data register (PDR) when that pin is set as an input port. The value of PDR can be read by using the read-modify-write (RMW) type of instruction. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 202: Interrupt

    (EIC:EIE0 or EIE1 = 1) corresponding to that external interrupt request flag bit is enabled, an interrupt request is generated to the interrupt controller. In an interrupt service routine, write "0" to the external interrupt request flag bit corresponding to that interrupt request generated to clear the interrupt request. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 203: Operations And Setting Procedure Example

    Figure 12.6-1 shows the operations for setting the INTn pin as an external interrupt input. Figure 12.6-1 Operations of External Interrupt Input waveform to INTn pin Interrupt request flag bit cleared by program EIR0 bit EIE0 bit SL01 bit SL00 bit No edge Rising edge Falling edge Both edges detection MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 204 An external interrupt input port shares the same pin with a general-purpose I/O port. Therefore, when using the pin as an external interrupt input port, set the bit in the port direction register (DDR) corresponding to that pin to "0" (input). FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 205: Register

    CHAPTER 12 EXTERNAL INTERRUPT CIRCUIT MB95630H Series 12.7 Register 12.7 Register This section describes the register of the external interrupt circuit. Table 12.7-1 List of External Interrupt Circuit Register Register Register name Reference abbreviation External interrupt control register 12.7.1 MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 206: External Interrupt Control Register (Eic)

    The status of the external interrupt pin can be read directly from the port data register, regardless of the status of the interrupt request enable bit. bit4 Details Writing "0" Disables outputting the interrupt request. Writing "1" Enables outputting the interrupt request. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 207 The status of the external interrupt pin can be read directly from the port data register, regardless of the status of the interrupt request enable bit. bit0 Details Writing "0" Disables outputting the interrupt request. Writing "1" Enables outputting the interrupt request. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 208: Notes On Using External Interrupt Circuit

    • The device cannot wake up from the interrupt service routine if the external interrupt request flag bit is "1" and the interrupt request enable bit is enabled. In the interrupt service routine, always clear the external interrupt request flag bit. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 209: Chapter 13 Interrupt Pin Selection Circuit

    CHAPTER 13 INTERRUPT PIN SELECTION CIRCUIT This chapter describes the functions and operations of the interrupt pin selection circuit. 13.1 Overview 13.2 Configuration 13.3 Pins 13.4 Operation 13.5 Register 13.6 Notes on Using Interrupt Pin Selection Circuit MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 210: Overview

    INT00 (ch. 0) input of external interrupt. This enables the input signals to the peripheral function pins to also serve as external interrupt pins. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 211: Configuration

    • Selection circuit This circuit outputs the input from the pin selected by the WICR register to the INT00 input of the external interrupt circuit (ch. 0). MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 212: Pins

    Table 13.3-1 Correspondence between Peripheral Functions and Peripheral Input Pins Peripheral input pin name Peripheral functions name 8/16-bit composite timer (event input) INT00 Interrupt pin selection circuit TRG1 16-bit PPG timer (trigger input) UCK0 UART/SIO (clock input/output) UART/SIO (data input) FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 213: Operation

    - When a reset is released, the WICR register is initialized to "0x40" and the INT00 bit is selected as the only available interrupt pin. To use any pins other than the INT00 pin as external interrupt pins, modify the settings of this register before enabling the operation of the external interrupt circuit. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 214: Register

    13.5 Register 13.5 Register This section describes the register of the interrupt pin selection circuit. Table 13.5-1 List of External Interrupt Circuit Register Register Register name Reference abbreviation WICR Interrupt pin selection circuit control register 13.5.1 FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 215: Interrupt Pin Selection Circuit Control Register (Wicr)

    INT00 (ch. 0) operation is enabled in the external interrupt circuit. bit3 Details Writing "0" Deselects the EC1 pin as an interrupt input pin. Writing "1" Selects the EC1 pin as an interrupt input pin. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 216 The device wakes up from the standby mode when a valid edge pulse is input to the selected pin. For detail of the standby mode, see "3.5 Operations in Low Power Consumption Mode (Standby Mode)". FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 217 INT00 (ch. 0) of the external interrupt circuit is enabled (the values other than "0b00" are written to the SL0[1:0] bits in the EIC register of the external interrupt circuit.), the selected pins will remain enabled to perform input so as to accept interrupts even in standby mode. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 218: Notes On Using Interrupt Pin Selection Circuit

    INT00 (ch. 0) of the external interrupt circuit is treated as "H" if a signal input to one of the selected interrupt pins is "H" (It becomes "OR" of the signals input to the selected pins). FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 219: Chapter 14 Lin-Uart

    This chapter describes the functions and operations of the LIN-UART. 14.1 Overview 14.2 Configuration 14.3 Pins 14.4 Interrupts 14.5 LIN-UART Baud Rate 14.6 Operations of LIN-UART and LIN-UART Setting Procedure Example 14.7 Registers 14.8 Notes on Using LIN-UART MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 220: Overview

    • Detection of LIN synch field start/stop edges connected to the 8/16-bit composite timer Continuous output to the SCK pin enabled for synchronous communication using the Synchronous serial clock start/stop bits Special synchronous clock mode for delaying the clock (used in Serial Peripheral Clock delay option Interface (SPI)) FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 221 Synchronous (Normal mode) Asynchronous (LIN mode) • Operating mode 1 supports both master and slave operation for the multiprocessor mode. • The communication format of operating mode 3 is fixed: 8-bit data, no parity, stop bit 1, LSB-first. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 222: Configuration

    • Bus idle detection circuit • LIN-UART serial control register (SCR) • LIN-UART serial mode register (SMR) • LIN-UART serial status register (SSR) • LIN-UART extended status control register (ESCR) • LIN-UART extended communication control register (ECCR) FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 223: Reload Counter

    15-bit register for reload values; it generates the transmit/receive clock from the external or internal clock. The count value in the transmit reload counter is read from the baud rate generator1, 0 (BGR1 and BGR0). MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 224 The circuit stops operating in synchronous mode. ● Interrupt generation circuit This circuit controls all interrupt sources. An interrupt is generated immediately provided that the corresponding interrupt enable bit has been set. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 225 • Enabling/disabling output to the clock pin ● LIN-UART serial status register (SSR) Its operating functions are as follows: • Checking transmission/reception or error status • Selecting the transfer direction (LSB-first or MSB-first) • Enabling/disabling receive interrupts • Enabling/disabling transmit interrupts MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 226 • LIN synch break generation ■ Input Clock The LIN-UART uses a machine clock or an input signal from the SCK pin as an input clock. The input clock is used as the transmission/reception clock source of the LIN-UART. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 227: Pins

    (SMR:SOE = 1) Set to the input port when this pin is used for clock input. (DDR:corresponding bit = 0) Serial clock input/output Enable output when this pin is used as an clock output pin. (SMR:SCKE = 1) MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 228: Interrupts

    With RDRF = 1, the next serial data is received while the CPU has not read the RDR register. (ORE = 1). Framing error A stop bit reception error occurs (FRE = 1). Parity error A parity detection error occurs (PE = 1). FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 229 Since the initial value of the TDRE bit is "1" after a hardware reset/software reset, if the TIE bit is set to "1" after a hardware reset/software reset, an interrupt is generated immediately. The TDRE bit is cleared only by writing data to the LIN-UART transmit data register (TDR). MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 230 Stop bit0 bit1 bit2 bit3 bit4 bit5 bit6 bit7 Data = 0x55 Internal signal (LSYN) 8/16-bit Capture value 1 Capture value 2 composite timer Difference in count values = Capture value 2 - Capture Value 1 FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 231: Timing Of Receive Interrupt Generation And Flag Set

    One reception operation uses 7-bit data, a parity bit (parity bit = "even parity" or "odd parity") and one stop bit. The other uses 8-bit data, no parity bit and one stop bit. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 232 CHAPTER 14 LIN-UART MB95630H Series 14.4 Interrupts Figure 14.4-3 ORE Flag Set Timing Received data ST 0 1 2 3 4 5 6 7 1 2 3 4 5 6 7 SP RDRF FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 233: Timing Of Transmit Interrupt Generation And Flag Set

    8-bit data, a parity bit ("even parity" or "odd parity") and one stop bit. No parity bit is transmitted in operating mode 3, or in operating mode 2 with SSM = 0. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 234 TDRE bit can be cleared only by writing new data to the LIN-UART transmit data register (TDR). For interrupt request numbers and vector table addresses of respective peripheral functions, refer to "■ INTERRUPT SOURCE TABLE" in the device data sheet. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 235: Lin-Uart Baud Rate

    (slave operation in operating mode 2 (synchronous) (ECCR:MS = 1)). It is used in synchronous mode (serial clock reception side). As for clock source settings, select the external clock and its direct use (SMR:EXT = 1, OTO = 1). MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 236 Reset Counter value: T (External clock Txc = v/2? input) Transmit clock Internal data bus BGR7 BGR14 BGR6 BGR13 BGR0 BGR5 BGR1 BGR12 BGR4 register register register BGR11 REST BGR3 BGR10 BGR2 BGR9 BGR1 BGR8 BGR0 FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 237: Baud Rate Setting

    The reload counter stops if the reload value is set to "0". Therefore, set the smallest reload value to "1". For transmission/reception in asynchronous mode, since five times of oversampling have to be done before the reception value is determined, set the reload value to at least "4". MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 238 < 0.01 13541 < 0.01 13332 < 0.01 16666 < 0.01 26666 < 0.01 27082 < 0.01 26666 < 0.01 53332 < 0.01 54166 < 0.01 The unit of frequency deviation is %. MCLK represents machine clock. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 239 LIN-UART. Therefore, if the external clock becomes not divisible because its cycle is faster than half the cycle of the internal clock, the external clock signal becomes unstable. For the value of the SCK clock, refer to the data sheet of this microcontroller. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 240 Figure 14.5-2 Operation of Dedicated Baud Rate Generator (Reload Counter) Transmit/receive clock Falling at (V+1)/2 Reload counter Reload counter value Note: The falling edge of the serial clock signal is generated after the reload value divided by 2 [(V+1)/2] is counted. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 241: Reload Counter

    If the REST bit in LIN-UART serial mode register (SMR) is set to "1", the two reload counters restart at the next clock cycle. This function enables the transmit reload counter to be used as a simple timer. Figure 14.5-3 shows an example of using this function (when the reload value is 100). MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 242 Although the counter value is temporarily cleared to "0x00" by the LIN-UART reset (writing "1" to SMR:UPCL), the reload counter restarts since the reload value is kept. If the restart setting is used (writing "1" to SMR:REST), the reload counter restarts without the counter value being cleared to "0x00". FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 243: Operations Of Lin-Uart And Lin-Uart Setting Procedure Example

    • In operating mode 3, the communication format is fixed at "8-bit data, no parity bit, one stop bit, LSB-first". • If the operating mode is changed, all transmission operations and reception operations are canceled, and the LIN-UART waits for the next transmission/reception. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 244 5. Set the baud rate generators 1, 0. (BGR1,BGR0) *: For details of the interrupt level setting register (ILR), refer to "CHAPTER 5 INTERRUPTS" in this hardware manual and "■ INTERRUPT SOURCE TABLE" in the device data sheet. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 245: Operations In Asynchronous Mode (Operating Mode 0, 1)

    (d = Number of data bits [7 or 8], p = parity [0 or 1], s = Number of stop bits [1 or 2]) Figure 14.6-1 shows the transmit/receive data format in asynchronous mode (operating mode 0, MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 246 P : Parity bit : Address/data bit Note: When the BDS bit in the LIN-UART serial status register (SSR) is set to "1" (MSB-first), the bits are processed in the following order: D7, D6, ... D1, D0 (P). FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 247 (SSR:RDRF) is set to "1" and no error has occurred (SSR:PE, ORE, FRE = 0). ● Input clock Use the internal clock or the external clock. For the baud rate, select the baud rate generator (SMR:EXT = 0 or 1, OTO = 0). MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 248 ST: Start bit, SP: Stop bit, Parity used (PEN = 1) Note: In operating mode 1, the parity cannot be used. ● Data signaling NRZ data format. ● Data bit transfer method The data bit transfer method can be LSB-first transfer or MSB-first transfer. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 249: Operations In Synchronous Mode (Operating Mode 2)

    Data frame ● Start/stop bits When the SSM bit in the LIN-UART extended communication control register (ECCR) is "1", the start and stop bits are added to the data format as they are in asynchronous mode. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 250 When the SCES bit in the LIN-UART extended status register (ESCR) is "1", the LIN-UART clock is inverted, and receive data is sampled at the falling edge of the LIN-UART clock. At that time, the value of the serial data must become valid at the edge of the LIN-UART clock. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 251 - For SSM = 1: PEN : "1": Adds/detects parity bit, "0": Not use parity bit : "1": Even parity, "0": Odd parity SBL : "1": Stop bit length 2, "0": Stop bit length 1 MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 252 To receive data only, disable the serial output (SMR:SOE = 0), and then write dummy data to the TDR register. Enabling continuous clock output and the start/stop bits enables bi-directional communication as that in asynchronous mode. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 253: Operations Of Lin Function (Operating Mode 3)

    In addition, enable the 8/16-bit composite timer interrupt and make the 8/16-bit composite timer detect both edges. The time at which the input signal input to the 8/16-bit composite timer is eight times the baud rate. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 254 LIN break interrupt (if the following communication format is used: 8-bit data, no parity, one stop bit.), set the RXE to "0" when using the LIN break. The LIN synch break detection functions only in operating mode 3. Figure 14.6-8 shows the LIN-UART operation in LIN slave mode. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 255 IRQ clear: input capture of 8/16-bit composite timer count starts IRQ (8/16-bit composite timer) IRQ clear: Baud rate calculated and set LBIE disabled Reception enabled Falling edge of start bit 1 byte of reception data saved to RDR RDR read by CPU MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 256: Serial Pin Direct Access

    SIOP bit holds a previous value. While the value of the SIN pin is read by normal read, the value of the SOT pin is read from the SIOP bit by the read-modify-write (RMW) type of instruction. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 257: Bidirectional Communication Function (Normal Mode)

    When using bidirectional communication, connect two CPUs as shown in Figure 14.6-11. Figure 14.6-11 Example of Connection for Bidirectional Communication in LIN-UART Operating Mode 2 Output Input CPU1 CPU2 (Serial clock transmit side) (Serial clock receive side) MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 258 (0 or 2) (same as that of the master) Data transmission Communicate with 1-byte data set in TDR Data received? Data received? Read and process received data Data transmission Read and process received Transmit 1-byte data data (ANS) FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 259: Master/Slave Mode Communication Function (Multiprocessor Mode)

    Figure 14.6-14 Connection Example of LIN-UART Master/Slave Mode Communication Master CPU Slave CPU #1 Slave CPU #0 ● Function selection In master/slave mode communication, select the operating mode and the data transfer method as shown in Figure 14.6-14. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 260 A slave CPU uses a program to check address data, and communicates with the master CPU when the address data matches the address assigned to that slave CPU. Figure 14.6-15 is a flow chart showing master/slave mode communication (multiprocessor mode). FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 261 Transmit address to slave AD bit = 1 Slave address matches address data Set AD bit to "0" Communicate with master Communicate with slave Terminate Terminate communication? communication? Communicate with another slave Disable transmission/ reception MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 262: Lin Communication Function

    Figure 14.6-17 shows an example of communication in a LIN bus system. The LIN-UART can operate as a LIN master or a LIN slave. Figure 14.6-17 Example of LIN Bus System Communication LIN bus LIN master Transceiver Transceiver LIN slave FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 263: Examples Of Lin-Uart Lin Communication Flow Chart (Operating Mode 3)

    * 2: - If the FRE or ORE flag is set to "1", write "1" to the SCR:CRE bit to clear the error flag. - If the ESCR:LBD bit is set to "1", execute the LIN-UART reset. Note: Deal properly with any error detected in a process. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 264 * 2: - If the FRE or ORE flag is set to "1", write "1" to the SCR:CRE bit to clear the error flag. - If the ESCR:LBD bit is set to "1", execute the LIN-UART reset. Note: Deal properly with any error detected in a process. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 265: Registers

    14.7.4 LIN-UART transmit data register 14.7.4 ESCR LIN-UART extended status control register 14.7.5 ECCR LIN-UART extended communication control register 14.7.6 BGR1 LIN-UART baud rate generator register 1 14.7.7 BGR0 LIN-UART baud rate generator register 0 14.7.7 MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 266: Lin-Uart Serial Control Register (Scr)

    This bit is fixed at "0" in operating mode 3 (LIN). bit5 Details Writing "0" 1 bit Writing "1" 2 bits Note: At reception, only a framing error for the bit length of the stop bit is always detected. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 267 Disables data frame transmission. Writing "1" Enables data frame transmission. Note: When data frame transmission is disabled (TXE = 0) while it is in progress, the transmission halts immediately. In this case, the integrity of data is not guaranteed. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 268: Lin-Uart Serial Mode Register (Smr)

    Selects the external serial clock source. [bit3] REST: Reload counter restart bit This bit restarts the reload counter. bit3 Details Read access The read value is always "0". Writing "0" Has no effect on operation. Writing "1" Restarts the reload counter. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 269 I/O port sharing the same pin with SOT. bit0 Details Writing "0" Makes the SOT pin function as a general-purpose I/O port. Writing "1" Makes the SOT pin function as the LIN-UART serial data output pin. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 270: Lin-Uart Serial Status Register (Ssr)

    When this flag is set, the data in the LIN-UART receive data register (RDR) is invalid. bit5 Details Reading "0" Indicates that no framing error has been detected. Reading "1" Indicates that a framing error has been detected. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 271 This bit enables or disables the transmit interrupt request output to the interrupt controller. When both the TIE bit and the TDRE bit are "1", a transmit interrupt request is output. bit0 Details Writing "0" Disables the transmit interrupt. Writing "1" Enables the transmit interrupt. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 272: Lin-Uart Receive Data Register/Lin-Uart Transmit Data Register (Rdr/Tdr)

    If the transmit data register empty flag bit (SSR:TDRE) is "1", the next transmit data can be written to TDR. If the transmit interrupt has been enabled, a transmit interrupt is generated. Write the next transmit data to TDR after a transmit interrupt or when the transmit data register empty flag bit (SSR:TDRE) is "1". FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 273 Since both registers are located at the same address, the write value and the read value are different. Thus, the read-modify-write (RMW) type of instruction, such as the INC instruction and the DEC instruction, cannot be used. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 274: Lin-Uart Extended Status Control Register (Escr)

    Writing "0" Clears this bit. Writing "1" Has no effect on operation. Note: To detect a LIN synch break, enable the LIN synch break detection interrupt (LBIE = 1), and then disable the reception (SCR:RXE = 0). FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 275 SIOP bit is held.) It writes "0" or "1" to the SOT pin. It returns the value of the SIN pin. It reads the value of the SOT pin and writes "0" or "1" to the SOT pin. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 276 Details (only for operating mode 2) Writing "0" Selects the rising edge of the clock as the sampling edge (normal). Writing "1" Selects the falling edge of the clock as the sampling edge (inverted clock). FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 277: Lin-Uart Extended Communication Control Register (Eccr)

    Selects the reception side (external serial clock reception). Note: When the reception side is selected, select the external clock as the clock source and enable the external clock input (SMR:SCKE = 0, EXT = 1, OTO = 1). MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 278 If there is no transmission on the SOT pin, this bit is "1". Do not use this bit when SSM = 0 in operating mode 2. bit0 Details Reading "0" Indicates that transmission is in progress. Reading "1" Indicates that there is no transmission operation. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 279: Lin-Uart Baud Rate Generator Registers 1, 0 (Bgr1, Bgr0)

    BGR0 can be accessed by byte access and word access. Writing a reload value to the LIN-UART baud rate generator registers causes the reload counter to start counting. Write values to the BGR1 register or the BGR0 register only when the LIN-UART has stopped operating. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 280: Notes On Using Lin-Uart

    In the case of not following the above procedure to modify operating settings, proper operations of this device cannot be guaranteed. Though the transmission bit length of the LIN break field is variable, the detection bit length of the LIN break field is fixed at 11 bits. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 281 The above problem can also be prevented by always using byte access to write values to the SCR register. ● LIN-UART software reset Execute the LIN-UART software reset (SMR:UPCL = 1) when the TXE bit in the LIN-UART serial control register (SCR) is "0". MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 282 (RXE = 1 0 1). Therefore, the falling edge of the serial data input (SIN) is detected, the start bit is recognized when "L" is detected at the reception sampling point, and the reception is started (See "When reception is temporarily disabled (RXE = 1 0 1)" in Figure 14.8-1). FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 283 When reception is temporarily disabled (RXE = 1 Reception is reset: Falling edge is Error is cleared Waitng for falling edge Framing error next start bit occurs edge No further errors Reception is ongoing regardress of no falling edge MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 284 CHAPTER 14 LIN-UART MB95630H Series 14.8 Notes on Using LIN-UART FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 285 8/10-BIT A/D CONVERTER This chapter describes the functions and operations of the 8/10-bit A/D converter. 15.1 Overview 15.2 Configuration 15.3 Pin 15.4 Interrupt 15.5 Operations and Setting Procedure Example 15.6 Registers 15.7 Notes on Using 8/10-bit A/D Converter MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 286: Chapter 15 8/10-Bit A/D Converter

    • The completion of conversion can be determined according to the ADI bit in the ADC1 register. To activate the A/D conversion function, use one of the following methods. • Activation using the AD bit in the ADC1 register • Continuous activation using the 8/16-bit composite timer output TO00 FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 287: Configuration

    8/10-bit A/D converter data register(upper/lower) (ADDH/ADDL) ANS3 ANS2 ANS1 ANS0 ADMV Reserved 8/10-bit A/D converter control register 1 (ADC1) ● Clock selector This selects the A/D conversion clock with continuous activation having been enabled (ADC2:EXT = 1). MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 288 This register is used to select an input clock, enable and disable interrupts and control different functions of the A/D converter. ■ Input Clock The 8/10-bit A/D converter uses an output clock from the prescaler as the input clock (operating clock). FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 289: Pin

    (DDR) corresponding to that pin, and the value corresponding to that pin to the analog input pin select bits (ADC1:ANS[3:0]). A pin not used as an analog input pin can be used as a general-purpose I/O port even when the 8/10-bit A/D converter is in use. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 290: Interrupt

    ADIE bit. The CPU cannot return from interrupt processing if the interrupt request flag bit (ADC1:ADI) is "1" with interrupt requests having been enabled (ADC2:ADIE = 1). Always clear the ADI bit in the interrupt service routine. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 291: Operations And Setting Procedure Example

    × : Unused bit 0 : Set to "0" 1 : Set to "1" When the A/D conversion function is activated, A/D conversion starts. In addition, the A/D conversion function can be re-activated even during conversion. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 292 (ADC2:EXT = 0) before changing the analog input pin. • A reset, or the start of the stop mode or watch mode causes the A/D converter to stop and the ADMV bit to be cleared to "0". FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 293 "■ INTERRUPT SOURCE TABLE" in the device data sheet. ● Interrupt processing 1. Clear the interrupt request flag to "0". (ADC1:ADI = 0) 2. Read converted values. (ADDH, ADDL) 3. Activate the A/D conversion function. (ADC1:AD = 1) MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 294: Registers

    Register name Reference abbreviation ADC1 8/10-bit A/D converter control register 1 15.6.1 ADC2 8/10-bit A/D converter control register 2 15.6.2 ADDH 8/10-bit A/D converter data register (upper) 15.6.3 ADDL 8/10-bit A/D converter data register (lower) 15.6.3 FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 295: 8/10-Bit A/D Converter Control Register 1 (Adc1)

    • Do not write to ANS[3:0] any value other than those listed in the table above. • When the ADMV bit is "1", do not modify these bits. Pins not used as analog input pins can be used as general- purpose I/O ports. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 296 Has no effect on operation. Writing "1" Starts the A/D conversion function. Note: Writing "0" to this bit cannot stop the operation of the A/D conversion function. The read value of this bit is always "0". FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 297: 8/10-Bit A/D Converter Control Register 2 (Adc2)

    Writing "0" Selects not using any external start signal to start the A/D conversion function. Selects the 8/16-bit composite timer ch. 0 output pin (TO00) as the pin used to start the A/D Writing "1" conversion function. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 298 Modify these bits according to operating conditions (voltage and frequency). Details bit1:0 (MCLK: machine clock) Writing "00" 1 MCLK Writing "01" MCLK/2 Writing "10" MCLK/4 Writing "11" MCLK/8 Note: Modify these bits only when the A/D converter has stopped operating. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 299: 8/10-Bit A/D Converter Data Register (Upper/Lower) (Addh/Addl)

    After A/D conversion is completed and before the next A/D conversion is completed, read A/D data registers (conversion results), and clear the interrupt request flag bit (ADI) in the ADC1 register. During A/D conversion, the values of the ADDH and ADDL registers are results of the last A/D conversion. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 300: Notes On Using 8/10-Bit A/D Converter

    Compare time = CKIN 10 (fixed value) + MCLK A/D converter startup time: minimum = MCLK + MCLK maximum = MCLK + CKIN Conversion time = A/D converter startup time + sampling time + compare time FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 301 A/D conversion starts. • When setting the A/D converter in software, ensure that the settings satisfy the specifications of "sampling time" and "compare time" of the A/D converter mentioned in the device data sheet. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 302 CHAPTER 15 8/10-BIT A/D CONVERTER MB95630H Series 15.7 Notes on Using 8/10-bit A/D Converter FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 303: Chapter 16 Low-Voltage Detection Reset Circuit

    CHAPTER 16 LOW-VOLTAGE DETECTION RESET CIRCUIT This chapter describes the function and operation of the low-voltage detection reset circuit. 16.1 Overview 16.2 Configuration 16.3 Pins 16.4 Operation 16.5 Register MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 304: Overview

    At power-on, the lowest reset threshold voltage is selected in the LVDR register. The circuit is only available on certain products. Check the availability of the circuit in the device data sheet. Refer also to the device data sheet for details of the electrical characteristics. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 305: Configuration

    ■ Block Diagram of Low-voltage Detection Reset Circuit Figure 16.2-1 Block Diagram of Low-voltage Detection Reset Circuit 0xAA 0x5A Reset signal 0x55 N-ch Other Vref values LVRS7 LVRS6 LVRS5 LVRS4 LVRS3 LVRS2 LVRS1 LVRS0 LVD reset voltage selection ID register (LVDR) MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 306: Pins

    The low-voltage detection reset circuit monitors the voltage of this pin. ● V This is the GND pin serving as the reference for voltage detection. ● RST pin The low-voltage detection reset signal is output inside the microcontroller and to this pin. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 307: Operation

    Reset signal A: Delay B: Oscillation stabilization wait time ■ Operation in Standby Mode The low-voltage detection reset circuit keeps operating even in standby mode (stop mode, sleep mode, subclock mode and watch mode). MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 308: Register

    16.5 Register 16.5 Register This section describes the register of low-voltage detection reset circuit. Table 16.5-1 List of Low-voltage Detection Reset Circuit Register Register Register name Reference abbreviation LVDR LVD reset voltage selection ID register 16.5.1 FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 309: Lvd Reset Voltage Selection Id Register (Lvdr)

    Writing a value other than the above 2.6 V 2.7 V Note: The reset of the low-voltage detection reset circuit has no effect on the reset threshold voltage settings as the reset cannot clear this register. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 310 CHAPTER 16 LOW-VOLTAGE DETECTION RESET CIRCUIT MB95630H Series 16.5 Register FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 311: Chapter 17 Clock Supervisor Counter

    CHAPTER 17 CLOCK SUPERVISOR COUNTER This chapter describes the functions and operations of the clock supervisor counter. 17.1 Overview 17.2 Configuration 17.3 Operations 17.4 Registers 17.5 Notes on Using Clock Supervisor Counter MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 312: Overview

    Otherwise, it cannot detect the abnormal state of the external clock correctly and will hang up if the external clock stops. See "CHAPTER 8 HARDWARE/SOFTWARE WATCHDOG TIMER" for the hardware watchdog timer (running in standby mode). FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 313: Configuration

    Time-base timer output Output Selector 8-bit Counter Main oscillation clock Counter 1st: counting starts Source 2nd: counting stops Clock Selector Sub-oscillation clock Control Circuit Counter enabled Clock Monitoring Control Register (CMCR) Clock Monitoring Data Register (CMDR) Internal Bus MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 314 This block is used to select the counter enable period from eight different time-base timer intervals. ● Counter source clock selector This block is used to select the counter source clock from the main oscillation clock and the suboscillation clock. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 315: Operations

    ● Clock Supervisor Counter Operation 2 The CMDR register is cleared when the CMCEN bit changes from "0" to "1". Figure 17.3-2 Clock Supervisor Counter Operation 2 Selected time-base timer interval Main/Sub-oscillation clock CMCEN Clear Internal counter CMDR register MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 316 The counter is cleared to "0" by the software if the CMCEN is set to "0" while the counter is operating. Figure 17.3-5 Clock Supervisor Counter Operation 5 Selected time-base timer interval Main/Sub-oscillation clock Software setting CMCEN Internal counter CMDR register FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 317 2613 10449 41796 167184 1253 5018 20077 80312 321253 1307 5225 20898 83592 334368 2038 8155 32626 130508 522038 32.5 2123 8490 33960 135837 543347 : Recommended setting : The counter value becomes "0" or "255". MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 318 Time-base Timer Interval > ----------------------- 1.05 4.3 ms TBC[3:0] = 0b0110 (2 Notes: • See "7.1 Overview" for time-base timer interval settings. • See "3.3.3 Oscillation Stabilization Wait Time Setting Register (WATR)" for main/ sub-oscillation stabilization time settings. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 319 “1”, that means the external clock is dead or the external clock frequency is Main clock oscillation stabilization bit — SYCC2:MRDY abnormal.) Subclock oscillation stabilization bit — SYCC2:SRDY MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 320: Registers

    Registers This section describes the registers of the clock supervisor counter. Table 17.4-1 List of Clock Supervisor Counter Registers Register Register name Reference abbreviation CMDR Clock monitoring data register 17.4.1 CMCR Clock monitoring control register 17.4.2 FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 321: Clock Monitoring Data Register (Cmdr)

    • After the external clock stops, the falling edge of the selected time-base timer clock is detected twice. (See Figure 17.5-2.) Note: The value of this register is "0b00000000" as long as the counter is operating (CMCR:CMCEN = 1). MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 322: Clock Monitoring Control Register (Cmcr)

    The first rising edge of the interval selected enables the counter operation and the second rising edge of the same output disables the counter operation. Details bit3:1 : main CR clock) Writing "000" Writing "001" Writing "010" Writing "011" Writing "100" Writing "101" Writing "110" Writing "111" FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 323 Disables the counter operation. Writing "1" Enables the counter operation. Notes: • Do not modify the CMCSEL bit when the CMCEN bit is "1". • Do not modify the TBTSEL[2:0] bits when the CMCEN bit is "1". MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 324: Notes On Using Clock Supervisor Counter

    TBTSEL[2:0] DIV[1:0] 010 to 111 (clock gear setting) to 2 ❍ ❍ ❍ 00 (1 1/F ❍ ❍ 01 (4 1/F ❍ ❍ 10 (8 1/F ❍ 11 (16 1/F ❍ : Recommended x : Prohibited FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 325 The counter is cleared at the same falling edge. Figure 17.5-2 Clock Supervisor Counter Operation 2 Selected time-base timer interval Main/Sub-oscillation clock CMCEN Internal counter CMDR register MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 326 CHAPTER 17 CLOCK SUPERVISOR COUNTER MB95630H Series 17.5 Notes on Using Clock Supervisor Counter FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 327: Chapter 18 8/16-Bit Ppg

    8/16-BIT PPG This chapter describes the functions and operations of the 8/16-bit PPG. 18.1 Overview 18.2 Configuration 18.3 Channel 18.4 Pins 18.5 Interrupt 18.6 Operations and Setting Procedure Example 18.7 Registers 18.8 Notes on Using 8/16-bit PPG MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 328: Overview

    In this operation, a variable-cycle pulse waveform is output in any duty ratio. The unit can also be used as a D/A converter in conjunction with an external circuit. ● Output inversion mode This mode can invert the PPG output value. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 329: Configuration

    MCLK/16 detection LOAD circuit CL K MCLK/32 or F or F MCRPLL or F or F 8-bit downcounter MCRPLL (PPG timer n1) STOP REV01 PEN01 PPGn1 Edge START BORROW detection PIE1 PUF1 POEN1 POEN1 IRQXX MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 330 ● 8/16-bit PPG output inversion register An initial level also includes the output of 8/16-bit PPG timer and it is reversed. ■ Input Clock The 8/16-bit PPG uses the output clock from the prescaler as its input clock (count clock). FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 331: Channel

    8/16-bit PPG timer n0 cycle setup buffer register PDSn1 8/16-bit PPG timer n1 duty setup buffer register PDSn0 8/16-bit PPG timer n0 duty setup buffer register PPGS 8/16-bit PPG start register REVC 8/16-bit PPG output inversion register MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 332: Pins

    PPGn0, PPGn1: A PPG waveform is output to these pins. The PPG waveform can be output by enabling the output by the 8/16-bit PPG timer n1/n0 control registers (PCn0: POEN0 = 1, PCn1: POEN1 = 1). FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 333: Interrupt

    (PUF) in the 8/16-bit PPG timer n0/n1 control register (PC) to "1". When the interrupt request enable bit is enabled (PIE = 1), an interrupt request is output to the interrupt controller. In 16-bit PPG mode, the 8/16-bit PPG timer n0 control register (PCn0) is available. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 334: Operations And Setting Procedure Example

    Operations and Setting Procedure Example This section describes the operations of the 8/16-bit PPG. The 8/16-bit PPG has the following three operating modes: • 8-bit PPG independent mode • 8-bit prescaler + 8-bit PPG mode • 16-bit PPG mode FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 335: 8-Bit Ppg Independent Mode

    After "H" which is the value of duty setting is output, "L" is output to the PPG output. If, however, the PPG output level reverse bit is set to "1", the PPG output is set and reset inversely from the above process. Figure 18.6-2 shows the operation of the 8-bit PPG independent mode. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 336 When the PDS register is set to "0x02" with the PPS register set to "0x04", the PPG output is set at a duty ratio of 50% (half the value of the PPS register is set to the PDS register). FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 337: 8-Bit Prescaler + 8-Bit Ppg Mode

    PPGn1 output is set to "L". If the output level reverse signal (REV01) is "0", the polarity remains the same. If it is "1", the polarity is MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 338 (2) = m1 n0: PDSn0 register value The value changes depending on the (3) = (1) m1: PPSn1 register value PPGn1 output (ch. n) waveform and the (4) = (1) n1: PDSn1 register value PEN00 start timing. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 339: 16-Bit Ppg Mode

    • When the values of the downcounters match the values in the 8/16-bit PPG timer duty setup buffer registers (both the value in PDSn1 for PPG timer n1 and the value in PDSn0 for PPG timer n0), the PPGn0 pin is set to "H" synchronizing with the count clock. After "H" which MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 340 (Normal polarity) (Reverse polarity) T: Count clock cycle (1) = n m: PPSn1 & PPSn0 (2) = m n: PDSn1 & PDSn0 : The value changes depending on the count clock selected and the start timing. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 341 *: For details of the interrupt level setting register (ILR), refer to "CHAPTER 5 INTERRUPTS" in this hardware manual and "■ INTERRUPT SOURCE TABLE" in the device data sheet. ● Interrupt processing 1. Process any interrupt. 2. Clear the interrupt request flag. (PCn1:PUF1, PCn0:PUF0) 3. Start the 8/16-bit PPG. (PPGS) MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 342: Registers

    8/16-bit PPG timer n0 cycle setting buffer register 18.7.3 PDSn1 8/16-bit PPG timer n1 duty setting buffer register 18.7.4 PDSn0 8/16-bit PPG timer n0 duty setting buffer register 18.7.4 PPGS 8/16-bit PPG start register 18.7.5 REVC 8/16-bit PPG output reverse register 18.7.6 FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 343: 8/16-Bit Ppg Timer N1 Control Register (Pcn1)

    REV01 is output. "L" output is supplied when REV01 is "0".) bit3 Details Writing "0" The PPG timer n1 pin functions as a general-purpose I/O port. Writing "1" The PPG timer n1 pin functions as a PPG output pin. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 344 Writing "110" or F or F MCRPLL Writing "111" or F or F MCRPLL Note: In subclock mode or sub-CR clock mode, since the time-base timer stops operating, setting CKS1[2:0] to "0b110" or "0b111" is prohibited. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 345: 8/16-Bit Ppg Timer N0 Control Register (Pcn0)

    Indicates that no counter borrow of PPG timer n0 has been detected. Reading "1" Indicates that a counter borrow of PPG timer n0 has been detected. Writing "0" Clears this bit. Writing "1" Has no effect on operation. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 346 Writing "110" or F or F MCRPLL Writing "111" or F or F MCRPLL Note: In subclock mode or sub-CR clock mode, since the time-base timer stops operating, setting CKS0[2:0] to "0b110" or "0b111" is prohibited. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 347: 8/16-Bit Ppg Timer N1/N0 Cycle Setup Buffer Register (Ppsn1/Ppsn0)

    • Do not set the cycle to "0x0000" or "0x0001" when using the unit in 16-bit PPG mode. • If the cycle settings are modified during the operation, the modified settings will be effective from the next PPG cycle. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 348: 8/16-Bit Ppg Timer N1/N0 Duty Setup Buffer Register (Pdsn1/Pdsn0)

    "L" output in the normal polarity (when the output level inversion bit of 8/16-bit PPG output inversion register is "0"). • If the duty settings are modified during operation, the modified value will be effective from the next PPG cycle. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 349: 8/16-Bit Ppg Start Register (Ppgs)

    This bit enables or stops the downcounter operation of PPG timer 10 (ch. 1). bit2 Details Writing "0" Stops the downcounter operation of PPG timer 10 (ch. 1). Writing "1" Enables the downcounter operation of PPG timer 10 (ch. 1). MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 350 This bit enables or stops the downcounter operation of PPG timer 00 (ch. 0). bit0 Details Writing "0" Stops the downcounter operation of PPG timer 00 (ch. 0). Writing "1" Enables the downcounter operation of PPG timer 00 (ch. 0). FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 351: 8/16-Bit Ppg Output Reverse Register (Revc)

    Selects reverse polarity. [bit2] REV10: PPG timer 10 (ch. 1) output level reverse bit This bit selects the output level of PPG timer 10 (ch. 1). bit2 Details Writing "0" Selects normal polarity. Writing "1" Selects reverse polarity. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 352 Selects reverse polarity. [bit0] REV00: PPG timer 00 (ch. 0) output level reverse bit This bit selects the output level of PPG timer 00 (ch. 0). bit0 Details Writing "0" Selects normal polarity. Writing "1" Selects reverse polarity. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 353: Notes On Using 8/16-Bit Ppg

    A PPG interrupt is generated when the interrupt enable bit (PIE1/PIE0) is set to "1" and the interrupt request flag bit (PUF1/PUF0) in the 8/16-bit PPG timer n1/n0 control register (PCn1/ PCn0) is also set to "1". Always clear the interrupt request flag bit (PUF1/PUF0) to "0" in the interrupt service routine. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 354 CHAPTER 18 8/16-BIT PPG MB95630H Series 18.8 Notes on Using 8/16-bit PPG FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 355: Chapter 19 16-Bit Ppg Timer

    This chapter describes the functions and operations of the 16-bit PPG timer. 19.1 Overview 19.2 Configuration 19.3 Channel 19.4 Pins 19.5 Interrupts 19.6 Operations and Setting Procedure Example 19.7 Registers 19.8 Notes on Using 16-bit PPG Timer MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 356: Overview

    - Occurrence of a counter borrow in the 16-bit downcounter (cycle match). - Rising edge of PPG in normal polarity or falling edge of PPG in inverted polarity - Counter borrow, rising edge of PPG in normal polarity, or falling edge of PPG in inverted polarity FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 357: Configuration

    ● Count clock selector The clock for the countdown of 16-bit downcounter is selected from eight types of internal count clocks. ● 16 bit downcounter It counts down with the count clock selected with the count clock selector. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 358 ● 16-bit PPG status control register (upper/lower) ch. n (PCNTHn/PCNTLn) The operation mode and the operation condition of 16-bit PPG timer are set. ■ Input Clock The 16-bit PPG timer uses the output clock from the prescaler as its input clock (count clock). FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 359: Channel

    16-bit PPG duty setting buffer register (upper) ch. n PDUTLn 16-bit PPG duty setting buffer register (lower) ch. n PCNTHn 16-bit PPG status control register (upper) ch. n PCNTLn 16-bit PPG status control register (lower) ch. n MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 360: Pins

    PPGn: A PPG waveform is output to this pin. The PPG waveform can be output by using the 16-bit PPG status control register to enable output (PCNTLn:POEN=1). ● TRGn pin TRGn:Used to start the 16-bit PPG timer by the hardware trigger. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 361: Interrupts

    When the IRQF bit in the 16-bit PPG status control register (PCNTLn) is set to "1" and interrupt requests are enabled (PCNTLn:IREN = 1) in the 16-bit PPG timer, an interrupt request is generated and output to the controller. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 362: Operations And Setting Procedure Example

    Hardware trigger by TRGn pin input : 1 count clock cycle + 3 machine clock cycles The minimum time is as follows. Software trigger : 2 machine clock cycles Hardware trigger by TRGn pin input : 3 machine clock cycles FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 363 Rising edge detected Restarted by trigger Software trigger (Normal polarity) (Inverted polarity) T : Count clock cycle (1)=n T ns m: Value of PCSRH & PCSRL registers (2)=m T ns n : Value of PDUTH & PDUTL registers MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 364 Rising edge detected Trigger restarted Software trigger (Normal polarity) (Inverted polarity) T : Count clock cycle (1)=n T ns m: Value of PCSRH & PCSRL registers (2)=m T ns n : Value of PDUTH & PDUTL registers FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 365 *: For details of the interrupt level setting register (ILR), refer to "CHAPTER 5 INTERRUPTS" in this hardware manual and "■ INTERRUPT SOURCE TABLE" in the device data sheet. ● Interrupt processing 1. Process any interrupt. 2. Clear the interrupt request flag. (PCNTLn:IRQF) MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 366: Registers

    16-bit PPG duty setting buffer register (upper) ch. n 19.7.3 PDUTLn 16-bit PPG duty setting buffer register (lower) ch. n 19.7.3 PCNTHn 16-bit PPG status control register (upper) ch. n 19.7.4 PCNTLn 16-bit PPG status control register (lower) ch. n 19.7.5 FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 367: 16-Bit Ppg Downcounter Register (Upper/Lower) Ch. N (Pdcrhn/Pdcrln)

    This register is read-only and writing a value to this register has no effect on the operation. Note: If you use the "MOV" instruction and read PDCRLn before PDCRHn, PDCRLn returns the value from the previous valid read operation. Therefore, the value of the 16-bit downcounter cannot be read correctly. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 368: 16-Bit Ppg Cycle Setting Buffer Register (Upper/ Lower) Ch. N (Pcsrhn/Pcsrln)

    If the downcounter load occurs after the "MOV" instruction is used to write data to PCSRLn before PCSRHn, the previous valid PCSRHn value and newly written PCSRLn value are loaded to the downcounter. It should be noted that as a result, the correct period cannot be set. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 369: 16-Bit Ppg Duty Setting Buffer Register (Upper/Lower) Ch. N (Pduthn/Pdutln)

    • When the value set in the duty setting registers is greater than the value in the 16-bit PPG cycle setting buffer registers, the "L" level will always be output if normal polarity is set, and the "H" level will always be output if inverted polarity is set. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 370: 16-Bit Ppg Status Control Register (Upper) Ch. N (Pcnthn)

    This bit selects the operating mode of the 16-bit PPG timer. bit5 Details Writing "0" PWM mode Writing "1" One-shot mode Note: While the 16-bit PPG timer is in operation, modifying the setting of this bit is prohibited. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 371 When the polarity setting is se to "inverted" (PCNTLn:OSEL = 1), the PPGn output is always masked to "H". bit0 Details Writing "0" Disables the PPGn output mask function. Writing "1" Enables the PPGn output mask function. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 372: 16-Bit Ppg Status Control Register (Lower) Ch. N (Pcntln)

    Reading "0" Indicates that no 16-bit PPG timer interrupt has been generated. Reading "1" Indicates that a 16-bit PPG timer interrupt has been generated. Writing "0" Clears this bit. Writing "1" Has no effect on operation. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 373 16-bit downcounter value matches the duty setting register value, and goes to "L" when a downcounter borrow occurs (normal polarity). When "1" is written to this bit, the 16-bit PPG timer output is inverted (inverted polarity). bit0 Details Writing "0" Normal polarity Writing "1" Inverted polarity MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 374: Notes On Using 16-Bit Ppg Timer

    0b00), never disable the 16-bit PPG timer operation (PCNTHn:CNTE = 0) and enable the software trigger (PCNTHn:STRG = 1) at the same time. Otherwise, even though the 16-bit PPG timer stops operating, the interrupt flag bit may be set by a retrigger. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 375: Chapter 20 16-Bit Reload Timer

    This chapter describes the functions and operations of the 16-bit reload timer. 20.1 Overview 20.2 Configuration 20.3 Channel 20.4 Pins 20.5 Interrupt 20.6 Operations and Setting Procedure Example 20.7 Registers 20.8 Notes on Using 16-bit Reload Timer MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 376: Overview

    (rising, falling, or both) specified by the operating mode select bits (MOD[2:0]) is input to the TIn pin. When an external clock is input in regular cycles, the reload timer can also be used as an interval timer. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 377 16-bit reload timer can be used as the interval timer. ● One-shot mode An interrupt is generated when an underflow occurs on the 16-bit downcounter. During counter operation, the TOn pin outputs a square waveform indicating that the counter is currently running. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 378: Configuration

    16-bit reload timer control 16-bit reload timer control CSL2 CSL1 CSL0 MOD2 MOD1 MOD0 OUTE OUTL RELD INTE UF CNTE TRG status register (upper) ch. n (TMCSRHn) status register (lower) ch. n (TMCSRLn) Interrupt request signal Internal bus FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 379 16-bit reload timer as well as indicates the current operation status. ■ Input Clock The 16-bit reload timer uses the output clock from the prescaler or the input signal from the TIn pin as its input clock (count clock). MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 380: Channel

    TMRHn 16-bit reload timer timer register (upper) ch. n TMRLn 16-bit reload timer timer register (lower) ch. n TMRLRHn 16-bit reload timer reload register (upper) ch. n TMRLRLn 16-bit reload timer reload register (lower) ch. n FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 381: Pins

    When this pin is used as the 16-bit reload timer output pin, regardless of the setting of port direction register (DDR), enabling 16-bit reload timer output (TMCSRLn:OUTE = 1) automatically makes this pin function as the 16-bit reload timer output pin to output the waveforms. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 382: Interrupt

    (lower) ch. n (TMCSRLn) to "1" when an underflow occurs in the 16-bit downcounter ("0x0000" "0xFFFF"). If the underflow interrupt request has been enabled (TMCSRLn:INTE = 1), the interrupt request will be output to the interrupt controller. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 383: Operations And Setting Procedure Example

    : State transition by register access WAIT : WAIT signal (internal signal) : Software trigger bit (TMCSRLn) CNTE : Timer operation enable bit (TMCSRLn) : Underflow generation flag bit (TMCSRLn) RELD : Reload selection bit (TMCSRLn) MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 384 "■ INTERRUPT SOURCE TABLE" in the device data sheet. ● Interrupt processing 1. Clear the underflow interrupt request flag. (TMCSRLn:UF=0) 2. Disable underflow interrupt. (TMCSRLn:INTE = 0) 3. Process any interrupt. 4. Enable underflow interrupt. (TMCSRLn:INTE = 1) FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 385: Internal Clock Mode

    (UF) is "1" when the underflow interrupt request enable bit (INTE) is set to "1", an interrupt request is output. The TOn pin can output a toggle waveform that is inverted every time an underflow occurs. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 386 (MOD[2:0]) is being input to the TIn pin. The timer start with the software trigger becomes effective as well as the one with an external trigger. Figure 20.6-5 shows the gate input operation in reload mode. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 387 Figure 20.6-6 Count Operation in One-shot Mode (Software Trigger Operation) Count clock 0000 FFFF 0000 FFFF Counter Reload data Reload data Data load signal UF bit CNTE bit TRG bit TOn pin Wait for start trigger input MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 388 Figure 20.6-8 Count Operation in One-shot Mode (External Gate Input Operation) Count clock 0000 FFFF Counter Reload data Reload data Data load signal UF bit CNTE bit TRG bit TIn pin TOn pin Wait for start trigger input FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 389: Event Count Mode

    16-bit counter, and an interrupt request is output if the underflow interrupt enable bit (INTE) is set to "1". The TOn pin can output a toggle waveform that is inverted each time an underflow occurs. Figure 20.6-10 shows the count operation in reload mode. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 390 Figure 20.6-11 Counter Operation in One-shot Mode (Event Count Mode) TIn pin 0000 FFFF 0000 FFFF Counter Reload data Reload data Data load signal UF bit CNTE bit TRG bit TOn pin Wait for start trigger input FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 391: Registers

    16-bit reload timer timer register (upper) ch. n 20.7.3 TMRLn 16-bit reload timer timer register (lower) ch. n 20.7.3 TMRLRHn 16-bit reload timer reload register (upper) ch. n 20.7.4 TMRLRLn 16-bit reload timer reload register (lower) ch. n 20.7.4 MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 392: 16-Bit Reload Timer Control Status Register (Upper) Ch. N (Tmcsrhn)

    Writing "100" MCLK/16 Writing "101" MCLK/32 Writing "110" or F or F MCRPLL Writing "111" Event count mode External clock *: MCLK: machine clock : main clock : main CR PLL clock MCRPLL : main CR clock FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 393 TIn pin function Valid edge/level Writing "000" External pin input invalid — Writing "001" Rising edge Writing "010" Trigger input Falling edge Writing "011" Both edges Writing "100" Writing "101" Setting prohibited Writing "110" Writing "111" MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 394: 16-Bit Reload Timer Control Status Register (Lower) Ch. N (Tmcsrln)

    16-bit reload timer reload register ch. n (TMRLRHn/TMRLRLn) is loaded to the 16-bit reload timer timer register ch. n (TMRHn/TMRLn), and the 16-bit reload timer continues counting. bit4 Details Writing "0" One-shot mode Writing "1" Reload mode FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 395 The read value is always "0". Writing "0" Has no effect on operation. The 16-bit reload timer starts counting from the next count clock input after the value set in Writing "1" TMRLRHn/TMRLRLn is reloaded to TMRHn/TMRLn. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 396: 16-Bit Reload Timer Timer Register (Upper/Lower) Ch. N (Tmrhn/Tmrln)

    • This register is read-only and located at the same address as the 16-bit reload timer reload register ch. n. Therefore, a write access to this register becomes a write access to the 16-bit reload timer reload register ch. n. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 397: 16-Bit Reload Timer Reload Register (Upper/Lower) Ch. N (Tmrlrhn/Tmrlrln)

    • This register is write-only and located at the same address as the 16-bit reload timer timer register ch. n. Therefore, a read access to this register becomes a read access to the 16-bit reload timer timer register ch. n. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 398: Notes On Using 16-Bit Reload Timer

    (UF) in the 16-bit reload timer control status register (lower) ch. n (TMCSRLn) is set to "1", the CPU cannot wake up from the interrupt service routine. Therefore, always clear the UF bit in the interrupt service routine. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 399: Chapter 21 Multi-Pulse Generator

    This chapter describes the specifications and operations of the multi-pulse generator. 21.1 Overview 21.2 Block Diagram 21.3 Pins 21.4 Interrupts 21.5 Operations 21.6 Registers 21.7 Notes on Using Multi-pulse Generator 21.8 Sample Program for Multi-pulse Generator MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 400: Overview

    Triggered by the position detection input (SNI2 to SNI0). Triggered by the 16-bit reload timer underflow. The 16-bit reload timer is started by the position detection comparison circuit. Triggered either by the 16-bit reload timer underflow, or by the position detection input. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 401 PPG edge to synchronize with. Figure 21.1-1 PPG Rising Edge Synchronization Asynchronous State Change WTS[1:0] = 0b00 Glitch Synchronous State Change WTS[1:0] = 0b01 OP5’ OP4’ The sequencer changes its state (e.g. due to a reload timer underflow). MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 402 After above condition met, the writing timing signal will be generated for the data transfer between the OPDBRHx and OPDBRLx registers and the OPDUR and OPDLR registers. Furthermore, the edge detection for individual input (SNI2 to SNI0) can be disable/enable. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 403: Block Diagram

    *2: See "■ Multi-pulse Generator Interrupt Sources" in "21.4 Interrupts". ● 16-bit PPG timer The 16-bit PPG timer is used to provide the PPG signal for the waveform sequencer. Details of the 16-bit PPG timer are described in "CHAPTER 19 16-BIT PPG TIMER". MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 404 WTS1 WTS0 CPIF CPIE CPD2 CPD1 CPD0 CMPE CPE1 CPE0 SNC2 SNC1 SNC0 SEE2 SEE1 SEE0 IPCLR Register Compare Match Interrupt Interrupt C* PDIRT NCCR Register *: See "■ Multi-pulse Generator Interrupt Sources" in "21.4 Interrupts". FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 405 The sync circuit is used to synchronize the OPT5 to OPT0 outputs with the PPG signal. ● 16-bit MPG noise cancellation control register (NCCR) The 16-bit MPG noise cancellation control register (NCCR) is used to select one of four sampling clock for the noise filter. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 406 ● 16-bit MPG output data register (upper) (OPDUR) and 16-bit MPG output data register (lower) (OPDLR) The 16-bit MPG output data register (upper) (OPDUR) and the 16-bit MPG output data register (lower) (OPDLR) are used to store the output data to the OPT5 to OPT0 pins. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 407 The 16-bit MPG compare clear register (upper) (CPCUR) and the 16-bit MPG compare clear register (lower) (CPCLR) are used to store the 16-bit value which is used to compare the value of the 16-bit up counter. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 408 16-bit MPG output data buffer register 0 (upper/lower) (OPDBRH0/OPDBRL0) is written. ● Selector 0 The selector 0 is used to select from either WTIN1 of the position detect circuit or external pin (TI1) to enable the count of the 16-bit reload timer. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 409 OPS[2:0] bits: Table 21.2-1 TOUT Trigger Edge Selection for WTIN0 OPS2 OPS1 OPS0 TOUT Trigger Edge for WTIN0 Rise and Fall Fall Rise and Fall Rise and Fall Fall Initial value of the OPS[2:0] bits MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 410 The noise filter is used to filter out the noise of the input signal in which there are 4 kind of sampling clock for selection. ● Selector The selector is used to select from either edge detect circuit or comparison circuit to generate data write time output signal to the data write control unit. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 411: Pins

    The TI1 pin functions as the input pin of the 16-bit reload timer for the multi-pulse generator. Set the corresponding bit in the port direction register (DDR) to "0" to use the TI1 pin as an input port. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 412: Interrupts

    12 pairs of 16-bit MPG output data buffer register (upper/lower) (OPDBRHB and OPDBRLB - OPDBRH0 and OPDBRL0) to the 16-bit MPG output data register (upper/lower) (OPDUR/OPDLR). This write timing output can be FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 413 CPD[2:0] bits in the IPCUR register match with those of the RDA[2:0] bits in the OPDUR register. For the respective interrupt request numbers of interrupt sources, refer to "■ INTERRUPT SOURCE TABLE" in the device data sheet. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
  • Page 414: Operations

    ■ Output Data Register Block Diagram Figure 21.5-1 Output Data Register Block Diagram 16-BIT RELOAD TIMER POSITION DETECT CIRCUIT 16-BIT PPG TIMER OUTPUT DATA REGISTER OP51/OP50 OPT5 OP41/OP40 OPT4 OP31/OP30 OPT3 OP21/OP20 OPT2 OP11/OP10 OPT1 OP01/OP00 OPT0 DTTI BNKF/RDA2 RDA1/RDA0 FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
  • Page 415 ■ OPTx Output Waveform Timing Diagram (WTS[1:0] = 0b00) Figure 21.5-2 OPTx Output Waveform Timing Diagram (WTS[1:0] = 0b00) OPx1, OPx0 0b00 0b01 0b11 0b10 (OPDUR, OPDLR) OPTx PPG Output PPG Inverted Output "L" Output "H" Output MN702-00009-2v0-E FUJITSU SEMICOND