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 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 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 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.
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...
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...
(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...
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...
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...
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...
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...
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...
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...
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 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...
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...
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...
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...
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...
"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...
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...
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...
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...
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...
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...
(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...
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...
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...
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...
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...
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...
CHAPTER 4 RESET This section describes the reset operation. Reset Operation Register Notes on Using Reset MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
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...
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...
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...
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...
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.
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...
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...
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...
(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...
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...
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...
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...
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...
• 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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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 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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
• 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...
• 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...
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...
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...
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...
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...
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...
(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...
(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...
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...
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...
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...
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...
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...
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...
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...
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...
• 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...
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...
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...
(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...
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...
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...
(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...
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...
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...
(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...
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...
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...
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...
• 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...
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...
• 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...
- 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...
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...
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...
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...
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...
• 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...
• 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...
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...
(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...
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...
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...
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...
(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...
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...
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...
• 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...
(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...
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...
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...
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...
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...
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...
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...
* 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...
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...
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...
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...
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...
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...
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...
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...
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...
• 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...
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...
(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...
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...
× : 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...
• 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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
● 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 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...
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...
• 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...
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...
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...
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...
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...
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...
(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...
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...
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...
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...
• 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...
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...
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...
• 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...
"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...
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...
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...
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...
- 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...
● 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...
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...
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...
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...
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...
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...
• 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...
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...
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...
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...
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...
(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...
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...
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...
(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...
: 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...
(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...
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...
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...
• 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...
• 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...
(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...
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...
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...
*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 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...
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...
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 417
Detects SNIx rising edge and SNIx/RDAx comparison match. Detects SNIx falling edge and SNIx/RDAx comparison match. Detects SNIx both edges and SNIx/RDAx comparison match. Note: When CMPE = 1, SEEx should be set to "0", setting SEEx = 1 is not recommended. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
The write timing output signal is generated from the data write control unit whenever a value is written to OPDBRH0 and OPDBRL0, and the data in OPDBRH0 and OPDBRL0 is transferred to OPDUR and OPDLR one cycle later. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Page 419
OUTPUT POSITION SNI2 to WTIN1 DETECTION SNI0 DATA WRITE CONTROL UNIT The 16-bit reload timer can be started by TIN input or a software trigger. The write signal is controlled by the 16-bit reload timer underflow. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 420
At this setting the16-bit reload timer is started by the compare match or effective edge input of the position detection circuit, write signal is then generated whenever the 16-bit reload timer is underflow. The compare match is triggered by any effective edge change in SNI2 to SNI0 pins. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Page 423
The data is transferred to the 16-bit MPG output data register (upper/lower) (OPDUR/OPDLR) sequentially. The 16-bit MPG output data buffer register (upper/lower) (OPDBRHx/ OPDBRLx) are not used if it is not set, e.g. No. 7 and No. 8 in Table 21.5-3. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
16-bit MPG output data register (upper). This does not apply to the OPDBRH0 and OPDBRL0 write method. In this write method, the BNKF bit and the RDA[2:0] bits are ignored. Always use the word access instruction to access OPDUR/OPDLR. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Page 425
Figure 21.5-12 Structure between OPDBRHx, OPDBRLx and OPDUR, OPDLR OPDBRH0, OPDBRL0 OPDBRH1, OPDBRL1 OPDBRH2, OPDBRL2 OPDBRH3, OPDBRL3 OPDBRH4, OPDBRL4 TO OUTPUT OPDBRH5, OPDBRL5 OPDUR, 12 TO 1 SELECTOR CONTROL OPDLR OPDBRH6, OPDBRL6 CIRCUIT OPDBRH7, OPDBRL7 OPDBRH8, OPDBRL8 OPDBRH9, OPDBRL9 OPDBRHA, OPDBRLA OPDBRHB, OPDBRLB MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Write signal is generated when theres is a comparison match between RDA[2:0] and SNI2-SNI0 or any effective edge input at SNI2-SNI0. The comparison is triggered by the input edge position detection input terminal SNIx. SNI2 SNI1 SNI0 MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
No. A BNKF, RDA2, 0b0100 0b0110 0b0010 0b0011 0b0001 0b0101 0b1010 0b1011 RDA1, RDA0 OPT5 OPT4 OPT3 OPT2 OPT1 OPT0 Write signal is generated by 16-bit reload timer underflow. 16-bit reload timer down-counting time SNI2 SNI1 SNI0 MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 432
16-bit reload timer. The operation of output data is renewed automatically. In order to use this method, use the 16-bit reload timer in one-shot mode. TIN0O must be longer than two machine cycles. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
SNI1 SNI0 Write signal is generated when theres is a comparison match between RDA[2:0] and SNI2-SNI0 or any effective edge input at SNI2-SNI0. The comparison is triggered by the input edge position detection input terminal SNIx. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
DTIE N can be 4, 8, 16, 32 depending on the N-CYCLE DELAY setting of D[1:0] bits CIRCUIT in the noise cancellation control register (NCCR). NOISE CANCELLATION SELECTOR NRSL DTIF DTTI INTERRURT AND CONTROL GENERATOR DTISP MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 440
* DTIF is cleared by writing “0” to it. Note: In the worst case the time from DTTI being recognized (after noise cancellation) to DTISP in effect takes 2 cycles, in best case it takes 1 cycle. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Page 441
DTTI has no effect on OPTx. DTTI takes effect. Noise filter is enabled. An "L" input at DTTI pin triggers the output of the inactive level set in PDRx. The DTTI interrupt is generated. DTTI has no effect on OPTx. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
16 MHz machine clock, the circuit can filter 0.25 µs to 2 µs width pulses. The control for the programming of the noise cancellation circuit of the SNIx and DTTI pins are separated. Section "21.6.9 16-bit MPG Noise Cancellation Control Register (NCCR)" shows the noise cancellation control register. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
An interrupt can be generated when the counter is cleared due to a match with the compare clear register. There is no interrupt when an overflow occurs. Note: To access the compare clear register and the timer buffer register, the word access instruction must be used. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 444
0xBFFF 0x7FFF 0x3FFF 0x0000 Time Reset Interrupt Figure 21.5-28 Clearing the Counter upon a Match with Compare Clear Register Counter value 0xFFFF Match Match 0xBFFF 0x7FFF 0x3FFF Time 0x0000 Reset Compare clear 0xBFFF register value Interrupt FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Page 445
Write Timing signal or the Position Detection signal, the counter is cleared in synchronization with the count timing. Figure 21.5-30 16-bit Timer Clear Timing MCLK Compare register value Prescaler clock Compare match 0x0000 0x0001 N - 1 0x0002 Counter value MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 447
Counter value Current counter value is latched into buffer. Timer is reset, which is triggered Timer is reset, which is triggered by write timing or position detection. by write timing or position detection. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
The DTTI pin input will pass through the noise filter. Note: When the noise cancellation circuit is enabled, the DTTI pin input becomes invalid in a mode such as stop mode in which the internal clock is stopped. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 450
When this bit is set to "1", and the write timing interrupt request flag bit (WTIF) is also set to "1", a write timing interrupt is generated. bit0 Details Writing "0" Disables the write timing interrupt. Writing "1" Enables the write timing interrupt. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
For details of the 16-bit MPG output data register (upper) (OPDUR), see "21.6.3.1 16-bit MPG Output Data Register (Upper) (OPDUR)". for details of the 16-bit MPG output data register (lower) (OPDLR), see "21.6.3.2 16-bit MPG Output Data Register (Lower) (OPDLR)". MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Indicates that the output of the PPG timer is output to the OPT5 pin. Reading "10" Indicates that the inverted output is output to the OPT5 pin. Reading "11" Indicates that "H" level is output to the OPT5 pin. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Page 455
Indicates that the output of the PPG timer is output to the OPT4 pin. Reading "10" Indicates that the inverted output is output to the OPT4 pin. Reading "11" Indicates that "H" level is output to the OPT4 pin. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Indicates that the output of the PPG timer is output to the OPT0 pin. Reading "10" Indicates that the inverted output is output to the OPT0 pin. Reading "11" Indicates that "H" level is output to the OPT0 pin. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
For details of the 16-bit MPG output data buffer register (upper) (OPDBRHx), see "21.6.4.1 16-bit MPG Output Data Buffer Register (Upper) (OPDBRHx)". For details of the 16-bit MPG output data buffer register (lower) (OPDBRLx), see "21.6.4.2 16-bit MPG Output Data Buffer Register (Lower) (OPDBRLx)". MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Selects the output of the PPG timer as the waveform to be output to the OPT5 pin. Writing "10" Selects the inverted output as the waveform to be output to the OPT5 pin. Writing "11" Selects "H" level as the waveform to be output to the OPT5 pin. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Page 459
Selects the output of the PPG timer as the waveform to be output to the OPT4 pin. Writing "10" Selects the inverted output as the waveform to be output to the OPT4 pin. Writing "11" Selects "H" level as the waveform to be output to the OPT4 pin. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Selects the output of the PPG timer as the waveform to be output to the OPT1 pin. Writing "10" Selects the inverted output as the waveform to be output to the OPT1 pin. Writing "11" Selects "H" level as the waveform to be output to the OPT1 pin. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Page 461
Selects the output of the PPG timer as the waveform to be output to the OPT0 pin. Writing "10" Selects the inverted output as the waveform to be output to the OPT0 pin. Writing "11" Selects "H" level as the waveform to be output to the OPT0 pin. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
For details of the 16-bit MPG input control register (upper) (IPCUR), see "21.6.5.1 16-bit MPG Input Control Register (Upper) (IPCUR)". For details of the 16-bit MPG input control register (lower) (IPCLR), see "21.6.5.2 16-bit MPG Input Control Register (Lower) (IPCLR)". FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
When this bit is set to "1", and the compare interrupt request flag bit (CPIF) is also set to "1", a compare interrupt is generated. bit4 Details Writing "0" Disables the compare interrupt. Writing "1" Enables the compare interrupt. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 464
If the RDA[2:0] bits are "111", a compare match occurs. [bit0] CMPE: Position detection compare enable bit This bit enables or disables the compare operation in position detection. bit0 Details Writing "0" Disables the compare operation. Writing "1" Enables the compare operation. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
SNI1 input does not pass through the noise cancellation circuit. Writing "1" SNI1 input passes through the noise cancellation circuit. bit3 Details Writing "0" SNI0 input does not pass through the noise cancellation circuit. Writing "1" SNI0 input passes through the noise cancellation circuit. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 466
Set this bit before setting the CMPE bit in the input control register (upper) (IPCUR) to "0". bit0 Details Writing "0" Disables the edge detection on the SNI0 pin. Writing "1" Enables the edge detection on the SNI0 pin. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
16-bit MPG compare clear register (lower) (CPCLR) are the same as the 16-bit timer counter value, the compare operation will not be performed until the next occasion in which the values of CPCUR and CPCLR are the same as the 16-bit timer counter value. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Use the "MOVW" instruction (use a 16-bit access instruction to read the TMBUR register address). • Use the "MOV" instruction to read or write TMBUR first and then TMBLR. ■ Register Configuration TMBUR Field Attribute Initial value TMBLR Field Attribute Initial value FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Reading "0" Indicates that no compare clear interrupt request has been generated. Reading "0" Indicates that a compare clear interrupt request has been generated. Writing "0" Clears this bit. Writing "1" Has no effect on operation. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 470
8 µs 16 µs 32 µs 128 µs Note: Since the count clock is changed immediately after these bits are updated, it is recommend to modify these bits while the 16-bit timer is in stop state. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
(NCCR), ensure that the noise cancellation function has been disabled (OPCUR:NRSL = 0). • Before modifying the S2[1:0], S1[1:0] and S0[1:0] bits in the NCCR register, ensure that the noise cancellation function has been disabled (IPCLR:SNC[2:0] = 0b000). FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Page 473
MPG and cannot work independently of the MPG. When the 16-bit PPG timer or the 16-bit reload timer is needed for other applications, disable the MPG first before using them for other applications. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
;Assumes that stack pointer (SP) has already been CLRI ;Interrupt disable ILR4,#00H ;Interrupt level 0 (top priority) MOVW A,#0064H MOVW PCSR1,A ;Sets the period of the PPG output MOVW A,#003CH MOVW PDUT1,A ;Sets the duty ratio of the PPG output MOVW A,#01100000000000110B FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Shift UART/SIO register serial output Serial data output data register for trans- Transmis- Parity ch. n mission sion bit operation count UART/SIO Port control serial mode control Set to registers 1, 2 each block ch. n MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 480
This register sets the transmit data. Data written to this register is serial-converted and then output. ■ Input Clock The UART/SIO uses the output clock (internal clock) from the dedicated baud rate generator or the input signal (external clock) from the UCKn pin as its input clock (serial clock). FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
UART/SIO serial mode control register 1 ch. n SMC2n UART/SIO serial mode control register 2 ch. n SSRn UART/SIO serial status and data register ch. n TDRn UART/SIO serial output data register ch. n RDRn UART/SIO serial input data register ch. n MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
● UIn Serial data input pin for UART/SIO. When it is to be used as a UART/SIO serial data input pin, make sure that it is set as input port by the corresponding port direction register. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
FER) is set to "1". These bits are set when a stop bit is detected. If receive interrupt enable bit has been enabled (SMC2n:RIE = 1), an interrupt request to the interrupt controller will be generated. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
*: 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 Read receive data. (RDRn) FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Page 486
Without P 8-bit data With P : Start bit : Stop bit : Parity bit D0 to D7: Data. The sequence can be selected from "LSB first" or "MSB first" by the direction control register (BDS bit) FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Page 487
The data received up to that point will not be transferred to the serial input data register. Figure 22.6-3 Receive Operation in Clock Asynchronous Mode (UART) D0 D1 D2 D3 D4 D5 D6 Sp Sp D0 D1 D2 RDRn read RDRF MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 488
Upon completion of reception of serial data, the overrun error bit (OVE) is set to "1" if the reception of the next data is performed before the previous receive data is read. Each flag is set at the position of the first stop bit. Figure 22.6-4 Setting Timing for Receive Errors Receive interrupt FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Page 489
"L" "L" Start bit detection Counter divided by 4 Data sampling clock (DSCLK) Sampling at three points to determine "0" or "1" on a majority basis when two bits out of three match Reception shift register MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 490
Figure 22.6-6 Transmission in Clock Asynchronous Mode (UART) TCPL TDRE Transmit interrupt When the STOP bit length is set to 1 bit When the STOP bit length is set to 2 bits FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Page 491
In clock asynchronous mode (UART), transmission and reception can be performed independently. Therefore, transmission and reception can be performed at the same time or even with transmitting and receiving frames overlapping each other in shifted phases. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Figure 22.6-9 Calculating Baud Rate Based on External Clock Baud rate value = [bps] External clock* More than 4 machine clock *: External clock More than 4 machine clock FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Page 493
The serial clock signal is output under control of the output for transmit data. When only reception is performed, therefore, set transmission control (SMC2n:TXE = 1) to write dummy transmit data to the UART/SIO serial output register. Refer to the device data sheet for the UCKn clock value. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 494
UART/SIO serial output data register to generate the serial clock signal and start reception. • Write transmit data to the TDRn register, then set the TXE bit to "1" to generate the serial clock signal and start reception. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Page 495
"1" by the reception for the preceding piece of data. Figure 22.6-13 Overrun Error UCKn D0 D1 ... D6 D7 D0 D1 ... D6 D7 D0 D1 ... D6 D7 Read to RDRn RDRF MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 496
When the transmit data is written to the TDRn register, the TDRE bit is cleared to "0". When serial transmission is started after transmit data is transferred from the TDRn register to the transmission shift register, the TDRE bit is set to "1". FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Page 497
As the transmitting side generates a serial clock, reception is influenced. If transmission stops during reception, the receiving side is suspended. It resumes reception when the transmitting side is restarted. See "22.4 Pins" for operation with serial clock output and operation with serial clock input. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
UART/SIO serial mode control register 2 ch. n 22.7.2 SSRn UART/SIO serial status and data register ch. n 22.7.3 RDRn UART/SIO serial input data register ch. n 22.7.4 TDRn UART/SIO serial output data register ch. n 22.7.5 FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Note: The setting of this bit is only valid for transmission operation in clock asynchronous mode (UART). In a receive operation, regardless of the setting of this bit, the UART/SIO completes the receive operation when detecting a stop bit (one bit), and sets the receive data register full flag bit (SSRn:RDRF) to "1". MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 500
Details Writing "0" Clock asynchronous mode (UART) Writing "1" Clock synchronous mode (SIO) Note: During data transmission or reception, do not modify the settings of the UART/SIO serial mode control register 1 ch. n (SMC1n). FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
This bit clears the receive error flags. The read value of this bit is always "1". bit5 Details Writing "0" Clears the receive error flags (PER, OVE and FER) in the SSRn register. Writing "1" Has no effect on operation. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 502
(SSRn:TDRE) is set to "1". bit0 Details Writing "0" Disables the transmit data register empty interrupt. Writing "1" Enables the transmit data register empty interrupt. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
When a framing error is detected at the same time as clearing this bit by writing "0" to the RERC bit, setting this bit to "1" is given priority. bit3 Details Reading "0" Indicates that no framing error has occurred. Reading "1" Indicates that a framing error has occurred. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 504
When transmit data is loaded to the shift register for the transmission and data transmission starts, this bit is set to "1". bit0 Details Reading "0" Indicates that there is transmit data in the TDRn register. Reading "1" Indicates that there is no transmit data in the TDRn register. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
RDRF bit to "0". When the character bit length (SMC1n:CBL[1:0]) is set to shorter than eight bits, the excess upper bits (beyond the set bit length) are set to "0". MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
TCPL bit is not set to "1". In the case of modifying the transmit data, make the TDRE bit become "1" once by writing "0" to the TXE bit before modifying the transmit data. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
CHAPTER 23 UART/SIO DEDICATED BAUD RATE GENERATOR This chapter describes the functions and operations of the dedicated baud rate generator for the UART/SIO. 23.1 Overview 23.2 Channel 23.3 Operations 23.4 Registers MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
The UART/SIO dedicated baud rate generator uses the output clock from the prescaler or the machine clock as its input clock. ■ Output Clock The UART/SIO dedicated baud rate generator supplies its clock to the UART/SIO. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
3846 3906 The baud rate can be set in UART mode within the following range. Table 23.3-2 Baud Rate Setting Range in Clock Asynchronous Mode (UART) PSS[1:0] BRS[7:0] 0b00 to 0b11 0x02 (2) to 0xFF (255) FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
This register sets the cycle of the 8-bit downcounter and can be used to set any baud rate clock (BRCLK). Stop the UART/SIO operation before writing a value to this register. In clock asynchronous mode (UART), do not set BRS[7:0] to "0x00" or "0x01". MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
This chapter describes functions and operations of the I C bus interface. 24.1 Overview 24.2 Configuration 24.3 Channel 24.4 Pins 24.5 Interrupts 24.6 Operations and Setting Procedure Example 24.7 Registers 24.8 Notes on Using I C Bus Interface MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
C bus interface includes a function to wake up the MCU from standby mode. Figure 24.1-1 Example of I C Bus Interface Configuration Static RAM/ Microcontroller A LCD driver EEPROM SDAn SCLn Gate array A/D converter Microcontroller B FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
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. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 519
The IDDRn register holds the transmit or receive shift data or address. When transmitted, the data or address written to this register is transferred from the MSB first to the bus. ■ Input Clock The I C bus interface uses the machine clock as the input clock (shift clock). MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
C bus control register 0 ch. n IBCR1n C bus control register 1 ch. n IBSRn C bus status register ch. n IDDRn C data register ch. n IAARn C address register ch. n ICCRn C clock control register ch. n FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
The SCLn pin is the serial clock I/O pin of the I C bus interface. When the I C bus interface is enabled (ICCRn:EN = 1), the SCLn pin is automatically set as a shift clock I/O pin to function as the SCLn pin. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
(IBCR1n:BEIE = 1). In the interrupt service routine, write "0" to the bus error interrupt request flag bit (IBCR1n:BER) to clear the interrupt request. When a bus error occurs, the IBCR1n:BER bit is set to "1" regardless of the value of the IBCR1n:BEIE bit. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Page 523
MCU from stop or watch mode has been enabled (IBCR0n:WUE = 1). In the interrupt service routine, write "0" to the MCU standby mode wakeup interrupt request flag bit (IBCR0n:WUF) to clear the interrupt request. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
*: 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. Execute any process. 2. Clear the bus error interrupt request flag. (IBCR1n:BER = 0) FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Data transfer is always ended in the master stop condition (P). However, the repeated start condition (S) can be used to transmit the address which indicates a different slave without generating a stop condition. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 526
"H". Data is transferred at one clock pulse per bit with MSB at the head. Sending and receiving an acknowledgment is required after each byte is transferred. Accordingly, nine clock pulses are required to transfer one complete data byte. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Page 527
SCLn cycle). Accordingly, if ACK is read when the IBCR0n:INTS bit is "1", you must write "0" to this bit in the transfer completion interrupt triggered by the eighth SCLn cycle so that another transfer completion interrupt will be triggered by the ninth SCLn cycle. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 528
If arbitration lost was detected, the module goes to slave mode and continues to receive data from the master. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Page 529
If the program triggers a start condition (by setting the IBCR1n:MSS bit to "1") when no start condition has been detected (IBSRn:BB = 0) and the SDAn and SCLn line pins are at the "L" level. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 530
SCLn pin or SDAn pin at "L" level "L" SCLn pin "L" SDAn pin C operation enabled (ICCRn:EN = 1) Master mode set (IBCR1n:MSS = 1) Arbitration lost detection bit (IBCR0n:ALF = 1) Bus busy (IBSRn:BB) Interrupt (IBCR1n:INT) FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Page 531
(Normal control means writing "0" to the IBCR1n:INT bit in the INT interrupt to clear IBCR0n:ALF to "0".) In other cases, perform control as normal (Normal control means writing "0" to the IBCR1n:INT bit in the INT interrupt to clear IBCR0n:ALF.) MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 532
Figure 24.6-6 Timing Diagram with Interrupt Generated with "IBCR0n:ALF = 1" Detected Interrupt in 9th clock cycle START condition SCLn pin Slave address Data SDAn pin ICCRn:EN IBCR1n:MSS Clear IBCR0n:ALF by software. IBCR0n:ALF IBSRn:BB Clear IBCR1n:INT by software IBCR1n:INT and release SCLn line. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
To receive the data byte correctly, the SCLn must be released in the first cycle after 100 s (assuming a minimum oscillation stabilization wait time of 100 s) from the start of I C transmission (falling edge detection of SDAn). MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 534
Figure 24.6-8 Sample Flow Chart 2 Procedure for transition to stop/watch mode IBSRn:BB = 0 Enable wakeup function by setting IBCR0n:WUE =1. IBSRn:BB = 0 IBCR0n:WUE = 0 Write "0" to IBCR0n:ALE Go to stop/watch mode. and clear AL interrupt FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
C bus control register 1 ch. n IBSRn 24.7.3 C bus status register ch. n IDDRn 24.7.4 C data register ch. n IAARn 24.7.5 C address register ch. n ICCRn 24.7.6 C clock control register ch. n MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
• If the data acknowledge depends on the content of the received data (such as packet error checking used by the SM bus), control the data acknowledge by setting the data acknowledge enable bit (IBCR1n:DACKE) after writing "1" to this bit (for example, using a previous transfer completion interrupt) to read latest received data. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Page 537
When read by the read-modify-write (RMW) type of instruction, this bit always returns "1". bit3 Details Reading "0" Indicates that no STOP condition has been detected. Reading "1" Indicates that a STOP condition has been detected. Writing "0" Clears this bit. Writing "1" Has no effect on operation. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 538
The values of the AACKX, INTS, and WUE bits in the IBCR0n register become "0" and non-writable either when the I C operation is disabled (ICCRn:EN = 0) or when a bus error occurs (IBCR1n:BER = 1). FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
This bit enables or disables the bus error interrupt. When this bit and the BER bit are both set to "1", a bus error interrupt request is generated. bit6 Details Writing "0" Disables the bus error interrupt. Writing "1" Enables the bus error interrupt. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 540
SCLn cycle during data reception. In slave mode, a data acknowledge is output in the ninth SCLn cycle only when an address acknowledgment has already been output. bit3 Details Writing "0" Disables data acknowledge output. Writing "1" Enables data acknowledge output. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Page 541
• During data reception, with the IBCR0n:INTS bit already set to "1", this bit becomes "1" after 1-byte data (not including an acknowledge) transfer is completed. If the INTS bit is set to "0", this bit becomes "1" after the transmission/reception of 1-byte data/address (including an acknowledge) is completed. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 542
• All bits in the IBCR1n register except the BER and BEIE bits are cleared to "0" either when the I C bus interface operation is disabled (ICCRn:EN = 0) or when a bus error occurs (IBCR1n:BER = 1). FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Indicates that the bus is in use and a repeated START condition has been detected. [bit5] Undefined bit The read value of this bit is always "0". Writing a value to this bit has no effect on operation. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 544
This bit is set to "0" when a START condition or a STOP condition has been detected. bit2 Details Reading "0" Indicates that the MCU has not undergone addressing in slave mode. Reading "1" Indicates that the MCU has undergone addressing in slave mode. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Page 545
• In slave mode, the device receives a general call address, but the IBCR1n:GACKE bit is "0". bit0 Details Reading "0" Indicates that the receive data is not the first byte in data reception. Reading "1" Indicates that the receive data is the first byte (address) in data reception. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
The received data or address can be read from this register at the transfer completion interrupt (IBCR1n:INT = 1). However, since the serial transfer register is directly read from when the received data or address is read, the receive data is valid only when the INT bit is "1". FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
■ Register Functions [bit7] Undefined bit The read value of this bit is always "0". Writing a value to this bit has no effect on operation. [bit6:0] A[6:0]: Address bits These bits set the slave address. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
• "0" is written to this bit. • The BER bit in the IBCR1n register is set to "1". bit5 Details Writing "0" Disables the I C bus interface operation. Writing "1" Enables the I C bus interface operation. FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Page 549
Writing "100" Writing "101" Writing "110" Writing "111" Note: If the standby mode wakeup function is not used, disable the I C bus interface operation before making the MCU transit to stop mode or watch mode. MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
In slave mode, a data acknowledge is generated if one of the following conditions is satisfied. - The received address matches the value in the address register (IAARn) and IBCR0n:AACKX is "0". - A general call address (0x00) is received and IBCR1n:GACKE is "1". FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
Page 551
IBCR0n:WUE to "0" after the MCU wakes up from stop mode or watch mode, regardless of whether the MCU has been woken up by to the I C wakeup function or the wakeup function of another resource (such as an external interrupt). MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 552
CHAPTER 24 I C BUS INTERFACE MB95630H Series 24.8 Notes on Using I C Bus Interface FUJITSU SEMICONDUCTOR LIMITED MN702-00009-2v0-E...
CHAPTER 25 EXAMPLE OF SERIAL PROGRAMMING CONNECTION This chapter describes the example of serial programming connection. 25.1 Basic Configuration of Serial Programming Connection 25.2 Example of Serial Programming Connection MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
1-line UART Flash memory (MB2146-07-E/ product user system MB2146-08-E) Table 25.1-1 Pins Used for Fujitsu Semiconductor Standard Serial Onboard Programming Function Details Power supply voltage The programming voltage (2.4 V to 5.5 V) is supplied from the user system. supply pin GND pin It is shared with the GND of the Flash microcontroller programmer.
The MCU enters the PGM mode at the following timing. ■ MCU Transiting to PGM Mode The MCU enters the PGM mode at the following timing. The serial programmer controls the DBG pin according to V input. Figure 25.2-1 Timing Diagram Transition to PGM Mode MN702-00009-2v0-E FUJITSU SEMICONDUCTOR LIMITED...
Page 556
In the case of using the BGM adaptor MB2146-07-E of Fujitsu Semiconductor Limited, it is recommended to use a pull-up resistor of approximately 2 k to 10 k .
(upper bank/lower bank) simultaneously. The dual operation Flash can use the following combinations: Upper bank Lower bank Read Read Program/sector erase Program/sector erase Read Chip erase Sector erase (erase suspend) Program Program Sector erase (erase