TMP86C909XB Toshiba, TMP86C909XB Datasheet

no-image

TMP86C909XB

Manufacturer Part Number
TMP86C909XB
Description
EMULATION CHIP FOR TMP86F SDIP
Manufacturer
Toshiba
Datasheet

Specifications of TMP86C909XB

Accessory Type
Adapter
For Use With/related Products
TMP86F SDIP
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
8 Bit Microcontroller
TLCS-870/C Series
TMP86F409NG

Related parts for TMP86C909XB

TMP86C909XB Summary of contents

Page 1

Bit Microcontroller TLCS-870/C Series TMP86F409NG ...

Page 2

... Unintended Usage of Toshiba products listed in this document shall be made at the customer's own risk. 021023_B The products described in this document shall not be used or embedded to any downstream products of which manufacture, use and/or sale are prohibited under any applicable laws and regulations ...

Page 3

Date Revision 2006/10/5 1 2007/2/14 2 2007/2/14 3 2007/2/21 4 2007/3/1 5 2008/8/29 6 Revision History First Release Periodical updating. No change in contents. Periodical updating. No change in contents. Contents Revised Contents Revised Contents Revised ...

Page 4

Caution in Setting the UART Noise Rejection Time When UART is used, settings of RXDNC are limited depending on the transfer clock specified by BRG. The com- bination "O" is available but please do not select the combination "–". The ...

Page 5

...

Page 6

Table of Contents TMP86F409NG 1.1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

Page 7

Undefined Instruction Interrupt (INTUNDEF 3.7 Address Trap Interrupt (INTATRAP) . ...

Page 8

Pulse Width Measurement Mode............................................................................................................ 76 8.3.6 Programmable Pulse Generate (PPG) Output Mode ............................................................................. 79 9. 8-Bit TimerCounter (TC3, TC4) 9.1 Configuration . . . . . . . . . . . . . . . . . . ...

Page 9

MISO/MOSI pins ................................................................................................................................. 117 11.4.3 SS pin ................................................................................................................................................. 117 11.5 SEI Transfer Formats . . . . . . . . . . . . . . . . . . . . . . . . . . ...

Page 10

Serial PROM Mode 15.1 Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

Page 11

Recommended Oscillating Conditions 185 17.8 Handling Precaution . ...

Page 12

... The information contained herein is presented only as a guide for the applications of our products. No responsibility is assumed by TOSHIBA for any infringements of patents or other rights of the third parties which may result from its use. No license is granted by impli- cation or otherwise under any patent or patent rights of TOSHIBA or others. 021023_C • ...

Page 13

Features 9. 8bit Serial Expansion Interface (SEI): 1 channel (MSB/LSB selectable and max. 4Mbps at 16MHz) 10. 10-bit successive approximation type AD converter - Analog input 11. Key-on wakeup : 4 channels 12. Clock operation Single clock ...

Page 14

Pin Assignment ( STOP VSS P37 (AIN5/STOP5 XIN P36 (AIN4/STOP4 XOUT P35 (AIN3/STOP3 TEST P34 (AIN2/STOP2 VDD P33 (AIN1 (XTIN) P21 P32 (AIN0 (XTOUT) P22 P31 (TC4/ ...

Page 15

Block Diagram 1.3 Block Diagram Figure 1-2 Block Diagram Page 4 TMP86F409NG ...

Page 16

Pin Names and Functions The TMP86F409NG has MCU mode, parallel PROM mode, and serial PROM mode. Table 1-1 shows the pin functions in MCU mode. The serial PROM mode is explained later in a separate chapter. Table 1-1 Pin ...

Page 17

Pin Names and Functions Table 1-1 Pin Names and Functions(2/2) Pin Name P35 AIN3 STOP3 P34 AIN2 STOP2 P33 AIN1 P32 AIN0 P31 TC4 PDO4/PWM4/PPG4 P30 TC3 PDO3/PWM3 XIN XOUT RESET TEST VDD VSS Pin Number Input/Output IO 30 ...

Page 18

Operational Description 2.1 CPU Core Functions The CPU core consists of a CPU, a system clock controller, and an interrupt controller. This section provides a description of the CPU core, the program memory, the data memory, and the reset ...

Page 19

System Clock Controller The data memory contents become unstable when the power supply is turned on; therefore, the data memory should be initialized by an initialization routine. Example :Clears RAM to “00H”. (TMP86F409NG) SRAMCLR: 2.2 System Clock Controller The ...

Page 20

High-frequency clock XIN XOUT XIN (a) Crystal/Ceramic (b) External oscillator resonator Figure 2-3 Examples of Resonator Connection Note:The function to monitor the basic clock directly at external is not provided for hardware, however, with dis- abling all interrupts and watchdog ...

Page 21

System Clock Controller 2.2.2 Timing Generator The timing generator generates the various system clocks supplied to the CPU core and peripheral hardware from the basic clock (fc or fs). The timing generator provides the following functions. 1. Generation of ...

Page 22

Timing Generator Control Register TBTCR (0036H) (DVOEN) (DVOCK) Selection of input to the 7th stage DV7CK of the divider Note 1: In single clock mode, do not set DV7CK to “1”. Note 2: Do not set “1” ...

Page 23

System Clock Controller (2) IDLE1 mode In this mode, the internal oscillation circuit remains active. The CPU and the watchdog timer are halted; however on-chip peripherals remain active (Operate using the high-frequency clock). IDLE1 mode is started by SYSCR2<IDLE> ...

Page 24

Switching back and forth between SLOW1 and SLOW2 modes are performed by SYSCR2<XEN>. In SLOW1 and SLEEP modes, the input clock to the 1st stage of the divider is stopped; output from the 1st to 6th stages is also stopped. ...

Page 25

System Clock Controller IDLE1 mode (a) Single-clock mode IDLE2 mode SLEEP2 mode SLEEP1 mode (b) Dual-clock mode Note 1: NORMAL1 and NORMAL2 modes are generically called NORMAL; SLOW1 and SLOW2 are called SLOW; IDLE0, IDLE1 and IDLE2 are called ...

Page 26

System Control Register 1 SYSCR1 (0038H) STOP RELM RETM OUTEN STOP STOP mode start Release method for STOP RELM mode Operating mode after STOP RETM mode OUTEN Port output during STOP mode Warm-up time at releasing WUT ...

Page 27

System Clock Controller Note 8: Before setting TGHALT to “1”, be sure to stop peripherals. If peripherals are not stopped, the interrupt latch of peripherals may be set after IDLE0 or SLEEP0 mode is released. 2.2.4 Operating Mode Control ...

Page 28

Example 2 :Starting STOP mode from NORMAL mode with an INT5 interrupt. PINT5: TEST (P2PRD). 0 JRS F, SINT5 LD (SYSCR1), 01010000B DI SET (SYSCR1). 7 SINT5: RETI STOP pin XOUT pin NORMAL operation Confirm by program that the STOP ...

Page 29

System Clock Controller STOP pin XOUT pin NORMAL operation STOP mode started by the program. STOP mode is released by the following sequence the dual-clock mode, when returning to NORMAL2, both the high-frequency and low ...

Page 30

Figure 2-9 STOP Mode Start/Release Page 19 TMP86F409NG ...

Page 31

System Clock Controller 2.2.4.2 IDLE1/2 mode and SLEEP1/2 mode IDLE1/2 and SLEEP1/2 modes are controlled by the system control register 2 (SYSCR2) and maskable interrupts. The following status is maintained during these modes. 1. Operation of the CPU and ...

Page 32

Start the IDLE1/2 and SLEEP1/2 modes After IMF is set to "0", set the individual interrupt enable flag (EF) which releases IDLE1/2 and SLEEP1/2 modes. To start IDLE1/2 and SLEEP1/2 modes, set SYSCR2<IDLE> to “1”. • Release the IDLE1/2 ...

Page 33

System Clock Controller Figure 2-11 IDLE1/2 and SLEEP1/2 Modes Start/Release Page 22 TMP86F409NG ...

Page 34

IDLE0 and SLEEP0 modes (IDLE0, SLEEP0) IDLE0 and SLEEP0 modes are controlled by the system control register 2 (SYSCR2) and the time base timer control register (TBTCR). The following status is maintained during IDLE0 and SLEEP0 modes. 1. Timing ...

Page 35

System Clock Controller • Start the IDLE0 and SLEEP0 modes • Release the IDLE0 and SLEEP0 modes of TBT and TBTCR<TBTEN>. cleared to “0” and the operation mode is returned to the mode preceding IDLE0 and SLEEP0 modes. Before ...

Page 36

Figure 2-13 IDLE0 and SLEEP0 Modes Start/Release Page 25 TMP86F409NG ...

Page 37

System Clock Controller 2.2.4.4 SLOW mode SLOW mode is controlled by the system control register 2 (SYSCR2). The following is the methods to switch the mode with the warm-up counter. (1) Switching from NORMAL2 mode to SLOW1 mode First, ...

Page 38

Switching from SLOW1 mode to NORMAL2 mode First, set SYSCR2<XEN> to turn on the high-frequency oscillation. When time for stabilization (Warm up) has been taken by the timer/counter (TC4,TC3), clear SYSCR2<SYSCK> to switch the main system clock to the ...

Page 39

System Clock Controller Figure 2-14 Switching between the NORMAL2 and SLOW Modes Page 28 TMP86F409NG ...

Page 40

Reset Circuit The TMP86F409NG has four types of reset generation procedures: An external reset input, an address trap reset, a watchdog timer reset and a system clock reset. Of these reset, the address trap reset, the watchdog timer and ...

Page 41

Reset Circuit 2.3.2 Address trap reset If the CPU should start looping for some cause such as noise and an attempt be made to fetch an instruction from the on-chip RAM (when WDTCR1<ATAS> is set to “1”), DBR or ...

Page 42

Page 31 TMP86F409NG ...

Page 43

Reset Circuit Page 32 TMP86F409NG ...

Page 44

Interrupt Control Circuit The TMP86F409NG has a total of 17 interrupt sources excluding reset, of which 1 source levels are multiplexed. Interrupts can be nested with priorities. Four of the internal interrupt sources are non-maskable while the rest are ...

Page 45

Interrupt enable register (EIR) Note: In main program, before manipulating the interrupt enable flag (EF) or the interrupt latch (IL), be sure to clear IMF to "0" (Disable interrupt by DI instruction). Then set IMF newly again as required ...

Page 46

Example 1 :Enables interrupts individually and sets IMF DI LDW : : EI Example 2 :C compiler description example unsigned int _io (3AH) EIRL; _DI(); EIRL = 10100000B; : _EI(); ← ; IMF 0 (EIRL), 1110100010100000B ; EF15 to EF13, ...

Page 47

Interrupt enable register (EIR) Interrupt Latches 15 14 ILH,ILL (003DH, 003CH) IL15 IL14 IL15 to IL2 Note 1: To clear any one of bits IL7 to IL4, be sure to write "1" into IL2 and IL3. Note 2: In ...

Page 48

Interrupt Source Selector (INTSEL) Each interrupt source that shares the interrupt source level with another interrupt source is allowed to enable the interrupt latch only when it is selected in the INTSEL register. The interrupt controller does not hold ...

Page 49

Interrupt Sequence 1-machine cycle Interrupt request Interrupt latch (IL) IMF Execute Execute instruction instruction a − Note 1: a: Return address entry address, b: Entry address, c: Address which RETI instruction is ...

Page 50

Example :Save/store register using PUSH and POP instructions PINTxx: PUSH (interrupt processing) POP RETI SP SP PCL PCH PSW At acceptance of At execution of an interrupt PUSH instruction 3.4.2.2 Using data transfer instructions To save only a specific register ...

Page 51

Software Interrupt (INTSW) 3.4.3 Interrupt return Interrupt return instructions [RETI]/[RETN] perform as follows. As for address trap interrupt (INTATRAP required to alter stacked data for program counter (PC) to restarting address, during interrupt service program. Note:If [RETN] ...

Page 52

Debugging Debugging efficiency can be increased by placing the SWI instruction at the software break point setting address. 3.6 Undefined Instruction Interrupt (INTUNDEF) Taking code which is not defined as authorized instruction for instruction causes INTUNDEF. INTUNDEF is gen- ...

Page 53

External Interrupts Source Pin INT0 INT0 INT1 INT1 INT3 INT3 INT4 INT4 INT5 INT5 Note 1: In NORMAL1/2 or IDLE1/2 mode signal with no noise is input on an external interrupt pin, it takes a maximum of ...

Page 54

External Interrupt Control Register EINTCR (0037H) INT1NC INT0EN INT3ES INT1NC Noise reject time select INT0EN P10/ pin configuration INT0 INT4 ES INT4 edge select INT3 ES INT3 edge select INT1 ES INT1 edge select Note 1: fc: ...

Page 55

External Interrupts Page 44 TMP86F409NG ...

Page 56

Special Function Register (SFR) The TMP86F409NG adopts the memory mapped I/O system, and all peripheral control and data transfers are per- formed through the special function register (SFR) or the data buffer register (DBR). The SFR is mapped on ...

Page 57

SFR Address 0026H 0027H 0028H 0029H 002AH 002BH 002CH 002DH 002EH 002FH 0030H 0031H 0032H 0033H 0034H 0035H 0036H 0037H 0038H 0039H 003AH 003BH 003CH 003DH 003EH 003FH Note 1: Do not access reserved areas by the program. Note ...

Page 58

DBR Address 0F80H : : 0F9FH Address 0FA0H : : 0FBFH Address 0FC0H : : 0FDFH Address 0FE0H 0FE1H 0FE2H 0FE3H 0FE4H 0FE5H 0FE6H 0FE7H 0FE8H 0FE9H 0FEAH 0FEBH 0FECH 0FEDH 0FEEH 0FEFH 0FF0H 0FF1H 0FF2H 0FF3H 0FF4H 0FF5H ...

Page 59

DBR Note 2: − ; Cannot be accessed. Note 3: Write-only registers and interrupt latches cannot use the read-modify-write instructions (Bit manipulation instructions such as SET, CLR, etc. and logical operation instructions such as AND, OR, etc.). Page 48 ...

Page 60

I/O Ports The TMP86F409NG have 4 parallel input/output ports as follows. Primary Function Port P0 8-bit I/O port Port P1 7-bit I/O port Port P2 3-bit I/O port Port P3 8-bit I/O port Each output port contains a latch, ...

Page 61

P0 (P07 to P00) Port (High Current) 5.1 P0 (P07 to P00) Port (High Current) The P0 port is an 8-bit input/output port shared with external interrupt input, SEI serial interface input/output, and UART and 16-bit timer counter input/output. ...

Page 62

P1 (P16 to P10) Port The P1 port is a 7-bit input/output port that can be specified for input or output bitwise. The P1 Port Input/output Control Register (P1CR) is used to specify this port for input or output. ...

Page 63

P2 (P22 to P20) Port 5.3 P2 (P22 to P20) Port The P2 port is a 3-bit input/output port shared with external interrupt input, STOP canceling signal input, and low- frequency resonator connecting pin. When using this port as ...

Page 64

P3 (P37 to P30) Port The P3 port is an 8-bit input/output port that can be specified for input or output bitwise, and is shared with analog input, key-on wakeup input, and 8-bit timer counter input/output. The P3 Port ...

Page 65

P3 (P37 to P30) Port 7 6 P37 P36 P3DR AIN5 AIN4 (0003H) STOP5 STOP4 R P3CR (000AH) Controls P3 port output (speci- P3CR fied bitwise) <P3 Port Input/Output> P3CR AINDS P3DR Note 1: When using the ...

Page 66

Time Base Timer (TBT) The time base timer generates time base for key scanning, dynamic displaying, etc. It also provides a time base timer interrupt (INTTBT). 6.1 Time Base Timer 6.1.1 Configuration MPX 23 15 fc/2 or fs/2 21 ...

Page 67

Time Base Timer Note 2: The interrupt frequency (TBTCK) must be selected with the time base timer disabled (TBTEN="0"). (The interrupt fre- quency must not be changed with the disable from the enable state.) Both frequency selection and enabling ...

Page 68

Divider Output ( DVO Approximately 50% duty pulse can be output using the divider output circuit, which is useful for piezoelectric buzzer drive. Divider output is from 6.2.1 Configuration Output latch D Q Data output MPX ...

Page 69

Divider Output (DVO) Example :1.95 kHz pulse output (fc = 16.0 MHz) Table 6-2 Divider Output Frequency ( Example : fc = 16.0 MHz 32.768 kHz ) DVOCK LD (TBTCR) , 00000000B LD (TBTCR) , 10000000B Divider ...

Page 70

Watchdog Timer (WDT) The watchdog timer is a fail-safe system to detect rapidly the CPU malfunctions such as endless loops due to spu- rious noises or the deadlock conditions, and return the CPU to a system recovery routine. The ...

Page 71

Watchdog Timer Control 7.2 Watchdog Timer Control The watchdog timer is controlled by the watchdog timer control registers (WDTCR1 and WDTCR2). The watch- dog timer is automatically enabled after the reset release. 7.2.1 Malfunction Detection Methods Using the Watchdog ...

Page 72

Watchdog Timer Control Register WDTCR1 (0034H) (ATAS) WDTEN Watchdog timer enable/disable Watchdog timer detection time WDTT [s] WDTOUT Watchdog timer output select Note 1: After clearing WDTOUT to “0”, the program cannot set it to “1”. ...

Page 73

Watchdog Timer Control 7.2.3 Watchdog Timer Disable To disable the watchdog timer, set the register in accordance with the following procedures. Setting the reg- ister in other procedures causes a malfunction of the microcontroller. 1. Set the interrupt master ...

Page 74

Watchdog Timer Reset When a binary-counter overflow occurs while WDTCR1<WDTOUT> is set to “1”, a watchdog timer reset request is generated. When a watchdog timer reset request is generated, the internal hardware is reset. The reset time is maximum ...

Page 75

Address Trap 7.3 Address Trap The Watchdog Timer Control Register 1 and 2 share the addresses with the control registers to generate address traps. Watchdog Timer Control Register WDTCR1 (0034H) Select address trap generation in ATAS ...

Page 76

Address Trap Reset While WDTCR1<ATOUT> is “1”, if the CPU should start looping for some cause such as noise and an attempt be made to fetch an instruction from the on-chip RAM (while WDTCR1<ATAS> is “1”), DBR or the ...

Page 77

Address Trap Page 66 TMP86F409NG ...

Page 78

TimerCounter 1 (TC1) 8.1 Configuration Figure 8-1 TimerCounter 1 (TC1) Page 67 TMP86F409NG ...

Page 79

TimerCounter Control 8.2 TimerCounter Control The TimerCounter 1 is controlled by the TimerCounter 1 control register (TC1CR) and two 16-bit timer registers (TC1DRA and TC1DRB). Timer Register 15 14 TC1DRA (0011H, 0010H) TC1DRB (0013H, 0012H) TimerCounter 1 Control Register ...

Page 80

Note 4: Auto-capture can be used only in the timer, event counter, and window modes. Note 5: To set the timer registers, the following relationship must be satisfied. TC1DRA > TC1DRB > 1 (PPG output mode), TC1DRA > 1 (other ...

Page 81

Function 8.3 Function TimerCounter 1 has six types of operating modes: timer, external trigger timer, event counter, window, pulse width measurement, programmable pulse generator output modes. 8.3.1 Timer mode In the timer mode, the up-counter counts up using the ...

Page 82

Timer start Source clock Counter 0 1 TC1DRA ? INTTC1 interruput request Source clock m − − 1 Counter m − 1 TC1DRB ? ACAP1 Figure 8-2 Timer Mode Timing Chart n − ...

Page 83

Function 8.3.2 External Trigger Timer Mode In the external trigger timer mode, the up-counter starts counting by the input pulse triggering of the TC1 pin, and counts up at the edge of the internal clock. For the trigger edge ...

Page 84

Count start TC1 pin input Source clock Up-counter TC1DRA INTTC1 interrupt request Count start TC1 pin input Source clock Up-counter TC1DRA INTTC1 interrupt request Figure 8-3 External Trigger Timer Mode Timing Chart ...

Page 85

Function 8.3.3 Event Counter Mode In the event counter mode, the up-counter counts up at the edge of the input pulse to the TC1 pin. Either the rising or falling edge of the input pulse is selected as the ...

Page 86

Window Mode In the window mode, the up-counter counts up at the rising edge of the pulse that is logical ANDed product of the input pulse to the TC1 pin (window pulse) and the internal source clock. Either the ...

Page 87

Function 8.3.5 Pulse Width Measurement Mode In the pulse width measurement mode, the up-counter starts counting by the input pulse triggering of the TC1 pin, and counts up at the edge of the internal clock. Either the rising or ...

Page 88

Example :Duty measurement (resolution fc/2 CLR LD DI SET PINTTC1: CPL JRS RETI SINTTC1 RETI : VINTTC1: DW TC1 pin INTTC1 interrupt request INTTC1SW 7 [Hz]) (INTTC1SW INTTC1 ...

Page 89

Function Count start TC1 pin input Internal clock Counter TC1DRB INTTC1 interrupt request Count start TC1 pin input Internal clock Counter TC1DRB INTTC1 interrupt request Trigger (a) Single-edge capture 0 1 ...

Page 90

Programmable Pulse Generate (PPG) Output Mode In the programmable pulse generation (PPG) mode, an arbitrary duty pulse is generated by counting per- formed in the internal clock. To start the timer, TC1CR<TC1S> specifies either the edge of the input ...

Page 91

Function Example :Generating a pulse which is high-going for 800 µs and low-going for 200 µs ( MHz) LD LDW LDW LD Example :After stopping PPG, setting the PPG pin to a high-level to restart PPG (fc ...

Page 92

Timer start Internal clock Counter TC1DRB n Match detect TC1DRA m PPG pin output INTTC1 interrupt request Count start TC1 pin input Trigger Internal clock Counter TC1DRB m TC1DRA PPG pin output ...

Page 93

Function Page 82 TMP86F409NG ...

Page 94

TimerCounter (TC3, TC4) 9.1 Configuration 11 3 fc fc/2 16-bit mode G fc TC4 pin H S TC4M ...

Page 95

Configuration 9.2 TimerCounter Control The TimerCounter 3 is controlled by the TimerCounter 3 control register (TC3CR) and two 8-bit timer registers (TTREG3, PWREG3). TimerCounter 3 Timer Register TTREG3 7 6 (001CH) R/W PWREG3 7 6 (001EH) R/W Note 1: ...

Page 96

Note 7: The timer register settings are limited depending on the timer operating mode. For the detailed descriptions, see Table 9- 3. Note 8: The operating clock fc in the SLOW or SLEEP mode can be used only as the ...

Page 97

Configuration The TimerCounter 4 is controlled by the TimerCounter 4 control register (TC4CR) and two 8-bit timer registers (TTREG4 and PWREG4). TimerCounter 4 Timer Register TTREG4 7 6 (001DH) R/W PWREG4 7 6 (001FH Note 1: Do ...

Page 98

Note 6: To the TimerCounter in the 16-bit mode, select the source clock by programming TC3CR<TC3CK>. Set the timer start control and timer F/F control by programming TC4S and TFF4, respectively. Note 7: The operating clock settings are limited depending ...

Page 99

Configuration Table 9-3 Constraints on Register Values Being Compared Operating mode 8-bit timer/event counter 8-bit PDO 8-bit PWM 16-bit timer/event counter Warm-up counter 16-bit PWM 16-bit PPG Note Register Value 1≤ (TTREGn) ≤255 1≤ ...

Page 100

Function The TimerCounter 3 and 4 have the 8-bit timer, 8-bit event counter, 8-bit programmable divider output (PDO), 8- bit pulse width modulation (PWM) output modes. The TimerCounter 3 and 4 (TC3, 4) are cascadable to form a 16- ...

Page 101

Configuration TC4CR<TC4S> Internal Source Clock Counter TTREG4 ? INTTC4 interrupt request 9.3.2 8-Bit Event Counter Mode (TC3 the 8-bit event counter mode, the up-counter counts up at the falling edge of the input pulse to the TCj ...

Page 102

Example :Generating 1024 Hz pulse using TC4 (fc = 16.0 MHz Note 1: In the programmable divider output mode, do not change the TTREGj setting while the timer is running. Since TTREGj is not in the shift ...

Page 103

Configuration Figure 9-4 8-Bit PDO Mode Timing Chart (TC4) Page 92 TMP86F409NG ...

Page 104

Pulse Width Modulation (PWM) Output Mode (TC3, 4) This mode is used to generate a pulse-width modulated (PWM) signals with bits of resolution. The up-counter counts up using the internal clock. When a match between ...

Page 105

Configuration Figure 9-5 8-Bit PWM Mode Timing Chart (TC4) Page 94 TMP86F409NG ...

Page 106

Timer Mode (TC3 and 4) In the timer mode, the up-counter counts up using the internal clock. The TimerCounter 3 and 4 are cascad- able to form a 16-bit timer. When a match between the up-counter and the ...

Page 107

Configuration 9.3.6 16-Bit Event Counter Mode (TC3 and 4) In the event counter mode, the up-counter counts up at the falling edge to the TC3 pin. The TimerCounter 3 and 4 are cascadable to form a 16-bit event counter. ...

Page 108

CLR (TC4CR).3: Stops the timer. CLR (TC4CR).7 : Sets the Note 3: To enter the STOP mode, stop the timer and then enter the STOP mode. If the STOP mode is entered with- out stopping of the timer when fc, ...

Page 109

Configuration Figure 9-7 16-Bit PWM Mode Timing Chart (TC3 and TC4) Page 98 TMP86F409NG ...

Page 110

Programmable Pulse Generate (PPG) Output Mode (TC3 and 4) This mode is used to generate pulses with up to 16-bits of resolution. The timer counter 3 and 4 are cascad- able to enter the 16-bit PPG mode. The ...

Page 111

Configuration Figure 9-8 16-Bit PPG Mode Timing Chart (TC3 and TC40) Page 100 TMP86F409NG ...

Page 112

Warm-Up Counter Mode In this mode, the warm-up period time is obtained to assure oscillation stability when the system clocking is switched between the high-frequency and low-frequency. The timer counter 3 and 4 are cascadable to form a 16-bit ...

Page 113

Configuration 9.3.9.2 High-Frequency Warm-Up Counter Mode (SLOW1 → SLOW2 → NORMAL2 → NORMAL1) In this mode, the warm-up period time from a stop of the high-frequency clock fc to the oscillation sta- bility is obtained. Before starting the timer, ...

Page 114

Asynchronous Serial interface (UART ) 10.1 Configuration UART control register 1 UARTCR1 3 2 INTTXD INTRXD S fc/ fc/26 C fc/52 fc/104 fc/208 fc/416 F INTTC3 G H fc/96 Baud rate generator Figure 10-1 ...

Page 115

Control 10.2 Control UART is controlled by the UART Control Registers (UARTCR1, UARTCR2). The operating status can be moni- tored using the UART status register (UARTSR). UART Control Register1 7 6 UARTCR1 (0025H) TXE RXE TXE Transfer operation RXE ...

Page 116

UART Status Register UARTSR (0025H) PERR FERR OERR RBFL PERR Parity error flag FERR Framing error flag OERR Overrun error flag RBFL Receive data buffer full flag TEND Transmit end flag TBEP Transmit data buffer empty ...

Page 117

Transfer Data Format 10.3 Transfer Data Format In UART, an one-bit start bit (Low level), stop bit (Bit length selectable at high level, by UARTCR1<STBT>), and parity (Select parity in UARTCR1<PE>; even- or odd-numbered parity by UARTCR1<EVEN>) are added ...

Page 118

Transfer Rate The baud rate of UART is set of UARTCR1<BRG>. The example of the baud rate are shown as follows. Table 10-1 Transfer Rate (Example) BRG 000 001 010 011 100 101 When TC3 is used as the ...

Page 119

STOP Bit Length 10.6 STOP Bit Length Select a transmit stop bit length (1 bit or 2 bits) by UARTCR1<STBT>. 10.7 Parity Set parity / no parity by UARTCR1<PE> and set parity type (Odd- or Even-numbered) by UARTCR1<EVEN>. 10.8 ...

Page 120

Status Flag 10.9.1 Parity Error When parity determined using the receive data bits differs from the received parity bit, the parity error flag UARTSR<PERR> is set to “1”. The UARTSR<PERR> is cleared to “0” when the RDBUF is read ...

Page 121

Status Flag UARTSR<RBFL> RXD pin Shift register RDBUF UARTSR<OERR> INTRXD interrupt Note:Receive operations are disabled until the overrun error flag UARTSR<OERR> is cleared. 10.9.4 Receive Data Buffer Full Loading the received data in RDBUF sets receive data buffer full ...

Page 122

TDBUF xxxx ***** 1 1xxxx0 Shift register TXD pin Start UARTSR<TBEP> INTTXD interrupt Figure 10-9 Generation of Transmit Data Buffer Empty 10.9.6 Transmit End Flag When data are transmitted and no data is in TDBUF (UARTSR<TBEP> = “1”), transmit end ...

Page 123

Status Flag Page 112 TMP86F409NG ...

Page 124

Serial Expansion Interface (SEI) SEI is one of the serial interfaces incorporated in the TMP86F409NG. It allows connection to peripheral devices via full-duplex synchronous communication protocols. The TMP86F409NG contain one channel of SEI. SEI is connected with an external ...

Page 125

SEI Registers 11.2 SEI Registers The SEI interface has the SEI Control Register (SECR), SEI Status Register (SESR), and SEI Data Register (SEDR) which are used to set up the SEI system and enable/disable SEI operation. 11.2.1 SEI Control ...

Page 126

Slave mode When the SEI is operating as a slave, the serial clock is input from the master and the setting of the SER bit has no effect. The maximum transfer rate is fc/4. Note: Take note of the ...

Page 127

SEI Operation 11.3 SEI Operation During a SEI transfer, data transmission (serial shift-out) and reception (serial shift-in) are performed simulta- neously. The serial clock synchronizes the timing at which information on the two serial data lines are shifted or ...

Page 128

SEI Pin Functions The TMP86F409NG have four input/output pins associated with SEI transfer. The functionality of each pin depends on the SEI device’s mode (master or slave). The SCLK pin, MOSI pin and MISO pin of all SEI devices ...

Page 129

SEI Transfer Formats 11.5 SEI Transfer Formats The transfer formats are set using CPHA and CPOL (SECR<CPHA,CPOL>). CPHA allows transfer protocols to be selected between two. 11.5.1 CPHA (SECR register bit format Figure 11-2 shows a ...

Page 130

SCLK cycle 1 2 SCLK (CPOL = 0) SCLK (CPOL = 1) MOSI MISO SECR<SEE> SS SEF Figure 11-3 Transfer Format where CPHA = 1 Table 11-5 Transfer Format Details where CPHA = 1 SCLK Level when Not Communicating (IDLE) ...

Page 131

Functional Description 11.6 Functional Description Figure 11-4 shows how the SEI master and slave are connected. When the master device sends data from its MOSI pin to a slave device’s MOSI pin, the slave device returns data from its ...

Page 132

Interrupt Generation The SEI for the TMP86F409NG uses INTSEI1. When the SESR<SEF> changes state from “0” to “1”, respective interrupts is generated. Table 11-6 SEI Interrupt SEI interrupt channel 1 (INTSEI1) 11.8 SEI System Errors The SEI has the ...

Page 133

Bus Driver Protection 11.9 Bus Driver Protection • One method to protect the device against latch-up due to collision of the bus drivers is the use of an open- drain option. This means changing the SEI pins’ CMOS outputs ...

Page 134

AD Converter (ADC) The TMP86F409NG have a 10-bit successive approximation type AD converter. 12.1 Configuration The circuit configuration of the 10-bit AD converter is shown in Figure 12-1. It consists of control register ADCCR1 and ADCCR2, converted value ...

Page 135

Register configuration 12.2 Register configuration The AD converter consists of the following four registers converter control register 1 (ADCCR1) This register selects the analog channels and operation mode (Software start or repeat) in which to per- form ...

Page 136

AD Converter Control Register ADCCR2 (000FH) IREFON DA converter (Ladder resistor) connection IREFON control AD conversion time select ACK (Refer to the following table about the con- version time) Note 1: Always set bit0 in ADCCR2 ...

Page 137

Register configuration EOCF ADBF Note 1: The ADCDR2<EOCF> is cleared to "0" when reading the ADCDR1. Therfore, the AD conversion result should be read to ADCDR2 more first than ADCDR1. Note 2: The ADCDR2<ADBF> is set to "1" when ...

Page 138

Function 12.3.1 Software Start Mode After setting ADCCR1<AMD> to “01” (software start mode), set ADCCR1<ADRS> to “1”. AD conver- sion of the voltage at the analog input pin specified by ADCCR1<SAIN> is thereby started. After completion of the AD ...

Page 139

Function ADCCR1<AMD> AD conversion start ADCCR1<ADRS> Conversion operation Indeterminate ADCDR1,ADCDR2 ADCDR2<EOCF> INTADC interrupt request ADCDR1 ADCDR2 12.3.3 Register Setting 1. Set up the AD converter control register 1 (ADCCR1) as follows: • Choose the channel to AD convert using ...

Page 140

Example :After selecting the conversion time 19.5 µ MHz and the analog input channel AIN3 pin, perform AD con- version once. After checking EOCF, read the converted value, store the lower 2 bits in address 0009EH nd store ...

Page 141

Analog Input Voltage and AD Conversion Result 12.5 Analog Input Voltage and AD Conversion Result The analog input voltage is corresponded to the 10-bit digital value converted by the AD as shown in Figure 12-4. 3FF H 3FE H ...

Page 142

... The internal equivalent circuit of the analog input pins is shown in Figure 12-5. The higher the output impedance of the analog input source, more easily they are susceptible to noise. Therefore, make sure the out- put impedance of the signal source in your design is 5 kΩ or less. Toshiba also recommends attaching a capac- itor external to the chip. ...

Page 143

Precautions about AD Converter Page 132 TMP86F409NG ...

Page 144

Key-on Wakeup (KWU) TMP86F409NG have four pins P34 to P37, in addition to the P20 ( mode. When using these P34 to P37 pin’s input to exit STOP mode, pay attention to the logic of P20 pin. In details, ...

Page 145

Control 13.2 Control The P34 to P37 (STOP2 to STOP5) pins can individually be disabled/enabled using Key-on Wakeup Control Reg- ister (STOPCR). Before these pins can be used to place the device out of STOP mode, they must be ...

Page 146

... The parallel PROM mode allows the flash memory to be accessed as a stand-alone flash memory by the program writer provided by the third party. High-speed access to the flash memory is available by control- ling address and data signals directly. For the support of the program writer, please ask Toshiba sales rep- resentative. ...

Page 147

Flash Memory Control 14.1 Flash Memory Control The flash memory is controlled via the flash memory control register (FLSCR) and flash memory stanby control resister (FLSSTB). Flash Memory Control Register FLSCR 7 6 (0FFFH) Flash memory command sequence exe- ...

Page 148

Transfer the control program of the FLSSTB register to the RAM area. 2. Jump to the RAM area. 3. Disable (DI) the interrupt master enable flag (IMF = “0”). 4. Set FLSSTB<FSTB> to “1”. 5. Execute the user program. ...

Page 149

Command Sequence 14.2 Command Sequence The command sequence in the MCU and the serial PROM modes consists of six commands (JEDEC compatible), as shown in Table 14-1. Addresses specified in the command sequence are recognized with the lower 12 ...

Page 150

Chip Erase (All Erase) This command erases the entire flash memory in approximately 30 ms. The next command sequence cannot be executed until the erase operation is completed. To check the completion of the erase operation, perform read operations ...

Page 151

Toggle Bit (D6) 14.3 Toggle Bit (D6) After the byte program, chip erase, and read protect command sequence is executed, any consecutive attempts to read from the same address is reversed bit 6 (D6) of the data (toggling between ...

Page 152

Access to the Flash Memory Area When the write, erase and read protections are set in the flash memory, read and fetch operations cannot be per- formed in the entire flash memory area. Therefore, to perform these operations in ...

Page 153

Access to the Flash Memory Area Example :After chip erasure, the program in the RAM area writes data 3FH to address F000H. ; #### Flash Memory Chip erase Process #### sLOOP1: ; #### Flash Memory Write Process #### sLOOP2: ...

Page 154

Flash Memory Control in the MCU mode In the MCU mode, write operations are performed by executing the control program in the RAM area. Before execution of the control program, copy the control program into the RAM area or ...

Page 155

Access to the Flash Memory Area Example :After sector erasure (E000H-EFFFH), the program in the RAM area writes data 3FH to address E000H. ; #### Flash Memory Sector Erase Process #### sLOOP1: ; #### Flash Memory Write Process #### ...

Page 156

Serial PROM Mode 15.1 Outline The TMP86F409NG has a 2048 byte BOOTROM (Mask ROM) for programming to flash memory. The BOOTROM is available in the serial PROM mode, and controlled by TEST, BOOT and tion is performed via UART. ...

Page 157

Serial PROM Mode Setting 15.3 Serial PROM Mode Setting 15.3.1 Serial PROM Mode Control Pins To execute on-board programming, activate the serial PROM mode. Table 15-2 shows pin setting to activate the serial PROM mode. Note: The BOOT pin ...

Page 158

XIN XOUT VSS GND Figure 15-2 Serial PROM Mode Pin Setting Note 1: For connection of other pins, refer to " Table 15-3 Pin Function in the Serial PROM Mode ". 15.3.3 Example Connection for On-Board Writing Figure 15-3 shows ...

Page 159

Serial PROM Mode Setting 15.3.4 Activating the Serial PROM Mode The following is a procedure to activate the serial PROM mode. " Figure 15-4 Serial PROM Mode Timing " shows a serial PROM mode timing. 1. Supply power to ...

Page 160

Interface Specifications for UART The following shows the UART communication format used in the serial PROM mode. To perform on-board programming, the communication format of the write controller must also be set in the same manner. The default baud ...

Page 161

Interface Specifications for UART Table 15-5 Operating Frequency and Baud Rate in the Serial PROM Mode Reference Baud Rate (bps) Baud Rate Modification (Note 3) Data Ref. Fre- Rating quency (MHz) (MHz 1.91 to 2.10 4 3.82 ...

Page 162

Operation Command The eight commands shown in Table 15-6 are used in the serial PROM mode. After reset release, the TMP86F409NG waits for the matching data (5AH). Table 15-6 Operation Command in the Serial PROM Mode Command Data Operating ...

Page 163

Operation Mode 6. Flash memory status output mode The status of the area from FFE0H to FFFFH, and the read protection condition are output as 7-byte code. The external controller reads this code to recognize the flash memory status. ...

Page 164

Flash Memory Erasing Mode (Operating command: F0H) Table 15-7 shows the flash memory erasing mode. Table 15-7 Flash Memory Erasing Mode Transfer Data from the External Transfer Byte Controller to TMP86F409NG 1st byte Matching data (5AH) 2nd byte - ...

Page 165

Operation Mode 2. The 5th byte of the received data contains the command data in the flash memory erasing mode (F0H). 3. When the 5th byte of the received data contains the operation command data shown in Table 15-6, ...

Page 166

Flash Memory Writing Mode (Operation command: 30H) Table 15-8 shows flash memory writing mode process. Table 15-8 Flash Memory Writing Mode Process Transfer Data from External Controller Transfer Byte to TMP86F409NG 1st byte Matching data (5Ah) 2nd byte - ...

Page 167

Operation Mode Description of the flash memory writing mode 1. The 1st byte of the received data contains the matching data. When the serial PROM mode is acti- vated, TMP86F409NG (hereafter called device), waits to receive the matching data ...

Page 168

After transmitting the checksum, the device waits for the next operation command data. Note 1: Do not write only the ...

Page 169

Operation Mode 15.6.3 RAM Loader Mode (Operation Command: 60H) Table 15-9 shows RAM loader mode process. Table 15-9 RAM Loader Mode Process Transfer Bytes 1st byte 2nd byte 3rd byte 4th byte 5th byte 6th byte 7th byte 8th ...

Page 170

Note error occurs during the reception of a password address or a password string, TMP86F409NG stops UART commu- nication and enters the halt condition. In this case, initialize TMP86F409NG by the PROM mode. Description of RAM loader ...

Page 171

Operation Mode 15.6.4 Flash Memory SUM Output Mode (Operation Command: 90H) Table 15-10 shows flash memory SUM output mode process. Table 15-10 Flash Memory SUM Output Process Transfer Bytes 1st byte 2nd byte 3rd byte 4th byte 5th byte ...

Page 172

Product ID Code Output Mode (Operation Command: C0H) Table 15-11 shows product ID code output mode process. Table 15-11 Product ID Code Output Process Transfer Data from External Controller Transfer Bytes to TMP86F409NG 1st byte Matching data (5AH) 2nd ...

Page 173

Operation Mode 5. After sending the checksum, the device waits for the next operation command data. Page 162 TMP86F409NG ...

Page 174

Flash Memory Status Output Mode (Operation Command: C3H) Table 15-12 shows Flash memory status output mode process. Table 15-12 Flash Memory Status Output Mode Process Transfer Data from External Con- Transfer Bytes troller to TMP86F409NG Matching data (5AH) 1st ...

Page 175

Operation Mode 15.6.7 Flash Memory Read Protection Setting Mode (Operation Command: FAH) Table 15-13 shows Flash memory read protection setting mode process. Table 15-13 Flash Memory Read Protection Setting Mode Process Transfer Bytes 1st byte 2nd byte 3rd byte ...

Page 176

FAH). If the 5th byte does not contain the operation command data, the device enters the halt condition after transmitting 3 bytes of operation command error code (63H). 4. The 7th through m’th bytes of the transmitted and ...

Page 177

Error Code 15.7 Error Code When detecting an error, the device transmits the error code to the external controller, as shown in Table 15-14. Table 15-14 Error Code Note password error occurs, TMP86F409NG does not transmit an ...

Page 178

Calculation data The data used to calculate the checksum is listed in Table 15-15. Table 15-15 Checksum Calculation Data Operating Mode Flash memory writing mode Data in the entire area of the flash memory Flash memory SUM output mode ...

Page 179

Intel Hex Format (Binary) 15.9 Intel Hex Format (Binary) 1. After receiving the checksum of a data record, the device waits for the start mark (3AH “:”) of the next data record. After receiving the checksum of a data ...

Page 180

RXD pin UART F0H 12H F1H 07H 01H 02H 03H 04H 05H 06H 07H 08H Example PNSA = F012H PCSA = F107H Password string = 01H,02H,03H,04H,05H 06H,07H,08H Figure 15-5 Password Comparison 15.10.1Password String The password string transmitted from the external ...

Page 181

Product ID Code 15.11Product ID Code The product ID code is the 13-byte data containing the start address and the end address of ROM. Table 15-17 shows the product ID code format. Table 15-17 Product ID Code Format Data ...

Page 182

Flash memory read pro- RPENA tection status The status from FFE0H BLANK to FFFFH. Some operation commands are limited by the flash memory status code 1. If the read protection is enabled, flash memory writing mode command and RAM loader ...

Page 183

Specifying the Erasure Area 15.13Specifying the Erasure Area In the flash memory erasing mode, the erasure area of the flash memory is specified by n−2 byte data. The start address of an erasure area is specified by ERASTA, and ...

Page 184

Port Input Control Register SPCR (0FEAH) Port input control in the serial PROM PIN mode Note 1: The SPCR register can be read or written only in the serial PROM mode. When the write instruction is executed ...

Page 185

Flowchart 15.15Flowchart Page 174 TMP86F409NG ...

Page 186

Timing Table 15-19 UART Timing-1 (VDD = 4 MHz, Topr = -10 to 40°C) Parameter Time from matching data reception to the echo back Time from baud rate modification data reception ...

Page 187

UART Timing Page 176 TMP86F409NG ...

Page 188

Input/Output Circuitry 16.1 Control Pins The input/output circuitries of the TMP86F409NG control pins are shown below. Control Pin I/O XIN Input XOUT Output Osc.enable XTIN Input XTOUT Input RESET Address trap reset Watchdog timer reset System clock reset TEST ...

Page 189

Input/Output Ports 16.2 Input/Output Ports Control Pin I/O P0 I/O Input from output latch P1 I/O P2 I/O Input from output latch P3 I/O Note: Input status on pins set for input mode are read in into the internal ...

Page 190

Electrical Characteristics 17.1 Absolute Maximum Ratings The absolute maximum ratings are rated values which must not be exceeded during operation, even for an instant. Any one of the ratings must not be exceeded. If any absolute maximum rating is ...

Page 191

Operating Conditions 17.2 Operating Conditions The Operating Conditions show the conditions under which the device be used in order for it to operate normally while maintaining its quality. If the device is used outside the range of Operating Conditions ...

Page 192

Serial PROM mode Parameter Symbol V Supply voltage DD V Except hysteresis input IH1 Input high voltage V Hysteresis input IH2 V Except hysteresis input IL1 Input low voltage V Hysteresis input,TEST IL2 Clock frequency fc XIN, XOUT Pins ...

Page 193

DC Characteristics 17.3 DC Characteristics Parameter Symbol V Hysteresis voltage HS I IN1 I Input current IN2 I IN3 R Input resistance IN3 I LO1 Output leakage current I LO2 V Output high voltage OH V Output low voltage ...

Page 194

AD Characteristics Paramete Symbol V Analog input voltage Non linearity error Zero point error Full scale error Total error Note 1: The total error includes all errors except a quanitization error, and is defined as a maximum deviation from ...

Page 195

AC Characteristics 17.5 AC Characteristics Parameter Machine cycle time High-level clock pulse width Low-level clock pulse width High-level clock pulse width Low-level clock pulse width Parameter Machine cycle time High-level clock pulse width Low-level clock pulse width High-level clock ...

Page 196

Recommended Oscillating Conditions XIN C 1 (1) High-frequency Oscillation Note 1: To ensure stable oscillation, the resonator position, load capacitance, etc. must be appropriate. Because these factors are greatly affected by board patterns, please be sure to evaluate operation ...

Page 197

Handling Precaution Page 186 TMP86F409NG ...

Page 198

Package Dimensions SDIP32-P-400-1.78 Rev 01 Page 187 TMP86F409NG Unit: mm ...

Page 199

Page 188 TMP86F409NG ...

Page 200

... This is a technical document that describes the operating functions and electrical specifications of the 8-bit microcontroller series TLCS-870/C (LSI). Toshiba provides a variety of development tools and basic software to enable efficient software development. These development tools have specifications that support advances in microcomputer hardware (LSI) and can be used extensively ...

Related keywords