The M16C/6KA group of single-chip microcomputers are built using the high-performance silicon gate
CMOS process using a M16C/60 Series CPU core and are packaged in a 144-pin plastic molded QFP.
These single-chip microcomputers operate using sophisticated instructions featuring a high level of instruction efficiency. To communicate with host CPU, the LPC bus interface is built in. In this way, this MCU can
work as slave controller in the personal computer system.
2 (8 inputs shared with 1 interrupt request X 1;
8 inputs (with event latch) shared with1 interrupt request X 1)
_______
1 (P85 shared with NMI pin)
(built-in feedback resistor, and external ceramic)
Rev.1.00
Applications
Notebook PC, others
Rev.1.00 Jul 16, 2004 page 1 of 266
REJ03B0100-0100Z
Specifications written in this manual
are believed to be accurate, but are
not guaranteed to be entirely free of
error.
Specifications in this data sheet may
be changed for functional or performance improvements. Please make
sure your manual is the latest edition.
M16C/6KA GroupDescription
------Table of Contents------
Central Processing Unit (CPU) .....................13
Flash Memory Version ................................234
Rev.1.00 Jul 16, 2004 page 2 of 266
REJ03B0100-0100Z
M16C/6KA GroupDescription
The differences in M16C/6K (144-pin) group
Type name
Pin numbers
M306K7F8LRP(In mass production)
144-pin144-pin144-pin
M306K9FCLRP
(In mass production)
M306KAFCLRP(Under development)
RAM
ROM
Built-in ROM area
Address 03B4
Address 03B7
The power supply
for program/erase
FV
CC
16
16
pin
PWM output circuit
2
I
C bus interface
Key input interrupt
3K bytes5K bytes5K bytes
NEW DINOR
Flash memory 68K bytes
User ROM area
Address 0EF000
Boot ROM area
Address 0FF000
Flash memory recognition register
After reset 00000000
Flash memory control register
After reset XX000001
16
- 0FFFFF
16
- 0FFFFF
2
2
16
16
Vcc 3.0 - 3.6V
Not exist
NEW DINOR
Flash memory 128K bytes
User ROM area
Address 0E0000
Boot ROM area
Address 0FF000
Flash memory recognition register
After reset XXXXXX10
Flash memory control register
After reset 00000001
Vcc 3.0 - 3.6V
CC
3.0 - 3.6V
FV
The input pin of power supply
for program/erase
16
- 0FFFFF
16
- 0FFFFF
2
16
16
2
NEW DINOR
Flash memory 128K bytes
User ROM area
Address 0E0000
Boot ROM area
Address 0FF000
Flash memory recognition register
After reset XXXXXX11
Flash memory control register
After reset 00000001
Vcc 3.0 - 3.6V
Not exist
14-bit X 48-bit X 68-bit X 6
2 channels3 channels
8 inputs shared with 1 interrupt
request X 1
8 inputs (with event latch) shared
with 1 interrupt request X 1
Detected only in the falling edge
Can not be selected with 1 bit unit
8 inputs shared with 1 interrupt
request X 1
8 inputs (with event latch) shared
with 1 interrupt request X 1
Detected in either of the edges by
the edge selection
Can be selected with 1 bit unit
3 channels (I
1 and 2 can changed.)
8 inputs shared with 1 interrupt
request X 1
8 inputs (with event latch) shared
with 1 interrupt request X 1
Detected in either of the edges by
the edge selection
Can be selected with 1 bit unit
16
- 0FFFFF
16
- 0FFFFF
2
C bus interface pin of Channel
16
16
2
2
DMAC
D/A converter
Comparator Circuit
Interrupts
Serial I/O
Clock generation
circuits
Exist (2 channels)Exist (2 channels)Not exist
Exist (8-bit X 2 channels)Exist (8-bit X 2 channels)Not exist
Exist (8 channels)Exist (8 channels)Not exist
31 vector31 vector
• UART or clock
synchronous X 3
• clock
synchronous X 2
2 circuits2 circuits
Rev.1.00 Jul 16, 2004 page 3 of 266
REJ03B0100-0100Z
Note1 : ROM size depends on MCU type.
Note2 : RAM size depends on MCU type.
Port P15
8
Port P14
8
Fig.AA-2 Block diagram of M16C/6KA (144-pin version) group
Rev.1.00 Jul 16, 2004 page 5 of 266
REJ03B0100-0100Z
Port P13
8
Port P12
8
Port P11
8
M16C/6KA GroupDescription
Performance Outline
Table AA-1 is a performance outline of M16C/6KA (144-pin version) group.
Table AA-1 Performance outline of M16C/6KA (144-pin version) group
ItemPerformance
Number of basic instructions91 instructions
The Min. time of instruction execution62.5ns (f(XIN)=16MHz, with 0 wait, Vcc=3.3V)
Memory ROM(See the figure of ROM Expansion)
capacity RAM5K bytes
I/O port P0 to P10 (except P85)8 bits x 10, 7 bits x 1
P11 to P168 bitsx5, 2 bitsx1
Input port P851 bit x 1
Multifunction TA0, TA1, TA2, TA3, TA416 bits x 5
timer TB0, TB1, TB2, TB3, TB4, TB516 bits x 6
Serial I/O UART1(UART or clock synchronous) x 1
SI/O3, SI/O4(Clock synchronous) x 2
A-D converter10 bits x (8 + 2) channels
Watchdog timer15 bits x 1 (with prescaler)
Interrupt32 internal and 16 external sources, 4 software
sources, 7 levels
Host interface4 channels (LPC bus interface)
PWM8 bits x 6
I2C bus interface3 channels
PS2 interface3 channels
Serial interrupt output6 factors (2 fixed factors, 4 programmable factors)
Clock generating circuit1 built-in clock generation circuit
(built-in feedback resistor, and external ceramic)
Power consumption52.8mW (3.3V, f(XIN)=16MHz, with 0 wait)
I/O I/O withstand voltage3.3V
characteristics Output current5mA
Device configurationCMOS high performance silicon gate
Package144-pin plastic mold QFP
Rev.1.00 Jul 16, 2004 page 6 of 266
REJ03B0100-0100Z
M16C/6KA GroupDescription
Renesas plans to release the following products in the M16C/6KA (144-pin version) group:
(1) Support for flash memory version
(2) ROM capacity
(3) Package
Rev.1.00 Jul 16, 2004 page 7 of 266
REJ03B0100-0100Z
M16C/6KA GroupDescription
Type No.
M30 6KA F C XXX RP
Fig.AA-4 Type No., memory size, and package
Package type
RP : 144PFB-A
ROM No.
ROM type
C : 128Kbytes
Memory type
F : Flash version
M16C/6KA Group
M16C Family
Rev.1.00 Jul 16, 2004 page 8 of 266
REJ03B0100-0100Z
M16C/6KA GroupPin Description
Pin Description
Pin name
Vcc, Vss
____________
RESET
Signal name
Power supply
input
Reset input
I/O type
Input
Function
Apply 3.0 to 3.6 V to VCC . Apply 0V to VSS
A “L” on this input resets the microcomputer.
XIN
XOUT
M0,M1
AVCC
AVSS
VREF
P00 to P07
P10 to P17
P20 to P27
P30 to P37
P40 to P47
P50 to P57
Clock input
Clock output
Chip mode
setting
Analog power
supply input
Analog power
supply input
Reference
voltage input
I/O port P0
I/O port P1
I/O port P2
I/O port P3
I/O port P4
I/O port P5
Input
Output
Input
Input
Input/output
Input/output
Input/output
Input/output
Input/output
Input/output
These pins are provided for the main clock generating circuit.
Connect a ceramic resonator between the XIN and the XOUT
pins. To use an externally derived clock, input it to the XIN pin
and leave the XOUT pin open.
Connect to VSS
This pin is a power supply input for the A-D converter.
Connect this pin to VCC.
This pin is a power supply input for the A-D converter.
Connect this pin to VSS.
This pin is a reference voltage input for the A-D converter.
This is an 8-bit CMOS I/O port. It has an input/output port
direction register that allows the user to set each pin for input or output individually. When set for input, the user can
specify in units of four bits via software whether or not they
are tied to a pull-up resistor.
This port supports CMOS input level. And output type supports CMOS 3 state or N channel open drain selectable.
This is an 8-bit I/O port equivalent to P0. Pins in this port also
function as external interrupt pins or UART1 I/O pin selected
by software.
This is an 8-bit I/O port equivalent to P0. (Except that output
type just supports CMOS 3 state only). P20-P27 are available for directly driving LED's.
This is an 8-bit I/O port equivalent to P0. (Except that output
type just supports CMOS 3 state only). The port can be
used for LPC bus interface I/O pins by software selection.
This is an 8-bit I/O port equivalent to P0. (Except that output
type just supports CMOS 3 state only). By software selecting,
the port can also be used for LPC bus interface I/O pins,
Timer A0 to A2 output pins PWM output pins or serial interrupt
output I/O pins. P40 to P46 pins' level can be read regardless
the setting of input port or output port. If P40 or P43 are used
for output ports, the function that clears P40 or P43 to "0" after
the read of output data buffer from host CPU is available.
This is an 8-bit I/O port equivalent to P0. (Except that output type
is CMOS 3 state only). Key on wake interrupt 0 input function
support. P57 in this port outputs a divide-by-8 or divide-by-32
clock of XIN selected by software.
Rev.1.00 Jul 16, 2004 page 9 of 266
REJ03B0100-0100Z
M16C/6KA GroupPin Description
Pin Description
Pin name
P60 to P67
P70 to P77
P80 to P84,
P86,
P87,
P85
P90 to P97
P100 to P107
Signal name
I/O port P6
I/O port P7
I/O port P8
I/O port P85
I/O port P9
I/O port P10
I/O type
Input/output
Input/output
Input/output
Input/output
Input/output
Input
Input/output
Input/output
Function
This is an 8-bit I/O port equivalent to P0. (Except that P60 to
P63's output type is N channel open drain only; P64 to P67's
output type is CMOS 3 state only; P60 to P63 no internal
pull-up register support.) By software selecting, this port
can be used for I2C-BUS interface, UART1 input/output pin,
timerA3, A4 output pin. When P60 to P63 used as I2C-BUS
interface SDA, SCL, the input level of these pins are CMOS/
SMBUS selectable.
This is an 8-bit I/O port equivalent to P0. (Except that P70 to
P77 output type is N channel open drain only; no internal
pull-up register support.) By software selecting, this port
can be used for external interrupt input pin, timerA0 to A3
and timer B5 input pin, PS2 interface input/output pin, I2C
interface input/output pin. P70 to P75 pins' level can be read
regardless of the setting of input port or output port.
P80 to P84, P86, and P87 are I/O ports with the same functions as P0. (Except that P86 to P87's output type is CMOS
3 state only; P80 to P84's output type is N channel open
drain only; P85 is input port only; the P80 to P84 and P85 are
no internal pull-up register support.)
By software selecting, this port can be used for timer A4, B0
to B2, I2C-BUS interface I/O pins. The input level of P81 to
P84 and SDA, SCL inputs can be switched to CMOS/SMBUS
when these pins function as I2C bus interface. P85 is an
____________
input-only port that also functions for NMI. The NMI interrupt
is generated when the input at this pin changes from “H” to
______
“L”. The NMI function cannot be cancelled using software.
This is an 8-bit I/O port equivalent to P0. (Except that output
type is CMOS 3 state only.) By software selecting, the port
can be used for external interrupt, timer B3 to B4, A-D converter extended input pins, A-D trigger, SI/O3, SI/O4 I/O
pins, PWM, output pins.
This is an 8-bit I/O port equivalent to P0. (Except that output
type is CMOS 3 state only.) If the ports are set to input
mode, the pull-up resistor can be set in bit unit. By software
selecting, the port can be used for A-D converter, external
interrupt input pins.
Rev.1.00 Jul 16, 2004 page 10 of 266
REJ03B0100-0100Z
M16C/6KA GroupPin Description
Pin Description
Pin name
P110 to P117
P120 to P127
P130 to P137
P140 to P147
P150 to P157
P160, P161
Signal name
I/O port P11
I/O port P12
I/O port P13
I/O port P14
I/O port P15
I/O port P16
I/O type
Input/output
Input/output
Input/output
Input/output
Input/output
Input/output
Function
This is an 8-bit I/O port equivalent to P0. By software selecting, P110, P111 also function as clock output pins, which the
frequency is the same with XIN.
This is an 8-bit I/O port equivalent to P0. (Except that outp u t
type is CMOS 3 state only.) By software selecting, this port
can be used for external interrupt input pin.
This is an 8-bit I/O port equivalent to P0. (Except that output
type is N channel open drain only; no internal pull-up register support.)
This is an 8-bit I/O port equivalent to P0. The port can be
used for key on wake-up interrupt 1 input pins. P140 to P143
are available for directly driving LED's. In input mode, the
pull-up register can be set in one bit unit by software.
This is an 8-bit I/O port equivalent to P0. (Except that output
type is CMOS 3 state only.) By software selecting, these
ports can be used for timer A0 to A2's output or SI/O3 and
SI/O4 I/O pins.
This is an 2-bit I/O port equivalent to P0. (Except that output
type is CMOS 3 state only.) By software selecting, this port
can be used for timer B3 and B4 input or PWM output pin.
Rev.1.00 Jul 16, 2004 page 11 of 266
REJ03B0100-0100Z
M16C/6KA GroupMemory
Operation of Functional Blocks
The M16C/6KA (144-pin version) group accommodates certain units in a single chip. These units include
ROM and RAM to store instructions and data and the central processing unit (CPU) to execute arithmetic/
logic operations. Also peripheral units such as timers, serial I/O, A-D converter, host bus interface, PWM
output, I2C BUS interface, PS2 interface and I/O ports are included.
The following explains each unit.
Memory
Fig.CA-1 is the memory map. The address space extends up to 1M bytes from address 0000016 to FFFFF16.
There is 128K bytes of internal ROM from E000016 to FFFFF16. The vector table for fixed interrupts such as
the reset and NMI are mapped from FFFDC16 to FFFFF16. The starting address of the interrupt routine is
stored here. The address of the vector table for timer interrupts, etc., can be set as desired using the internal
register (INTB). See the section on interrupts for details.
From 0040016 to the address increasing direction RAM is allocated. For example, in the M306KAFCLRP, 5K
bytes of internal RAM is mapped to the space from 0040016 to 017FF16. In addition to storing data, the RAM
also stores the stack used when calling subroutines and when interrupts are generated.
The SFR area is mapped from 0000016 to 003FF16. This area accommodates the control registers for peripheral devices such as I/O ports, A-D converter, serial I/O, and timers, etc. Fig.CA-2 to CA-5 are location of
peripheral unit control registers. Any part of the SFR area that is not occupied is reserved and cannot be
used for other purposes.
The special page vector table is mapped from FFE0016 to FFFDB16. If the starting addresses of subroutines
or the destination addresses of jumps are stored here, subroutine call instructions and jump instructions can
be used as 2-byte instructions, reducing the number of program steps.
_______
00000
16
0040016
017FF16
E000016
FFFFF16
Fig.CA-1 Memory map
Rev.1.00 Jul 16, 2004 page 12 of 266
REJ03B0100-0100Z
SFR area
For details, see
Fig.CA-2 to Fig.CA-4
Internal RAM area
Inhibited
Internal ROM area
FFE0016
FFFDC16
FFFFF16
Special page
vector table
Undefined instruction
Overflow
BRK instruction
Address match
Single step
Watchdog timer
DBC
NMI
Reset
M16C/6KA GroupCPU
A
Central Processing Unit (CPU)
The CPU has a total of 13 registers shown in Fig.BA-1 Seven of these registers (R0, R1, R2, R3, A0, A1, and
FB) come in two sets; therefore, these have two register banks.
R0
R1
R2
R3
A0
A1
FB
(Note)
(Note)
(Note)
(Note)
(Note)
(Note)
(Note)
b15
b15
b15
b15
b15
b15
b15
b8 b7 b0
H
b8 b7 b0
H
L
b19
L
PC
b0
Program counter
Data
b0
registers
INTB
b19
H
b0
L
Interrupt table
register
b0
b0
b15
USP
b15
ISP
b0
User stack pointer
b0
Interrupt stack
pointer
Address
b0
registers
b15
SB
b0
Static base
register
b0
Frame base
b15
FLG
b0
Flag register
register
IPL
CDZSBOIU
Note: These registers consist of two register banks.
Fig.BA-1 Central processing unit register
(1) Data registers (R0, R0H, R0L, R1, R1H, R1L, R2, and R3)
Data registers (R0, R1, R2, and R3) are configured with 16 bits, and are used primarily for transfer and
arithmetic/logic operations.
Registers R0 and R1 each can be used as separate 8-bit data registers, high-order bits as (R0H/R1H), and
low-order bits as (R0L/R1L). In some instructions, registers R2 and R0, as well as R3 and R1 can use as 32bit data registers (R2R0/R3R1).
(2) Address registers (A0 and A1)
Address registers (A0 and A1) are configured with 16 bits, and have functions equivalent to those of data
registers. These registers can also be u2sed for address register indirect addressing and address register
relative addressing.
In some instructions, registers A1 and A0 can be combined for use as a 32-bit address register (A1A0).
Rev.1.00 Jul 16, 2004 page 13 of 266
REJ03B0100-0100Z
M16C/6KA GroupCPU
(3) Frame base register (FB)
Frame base register (FB) is configured with 16 bits, and is used for FB relative addressing.
(4) Program counter (PC)
Program counter (PC) is configured with 20 bits, indicating the address of an instruction to be executed.
(5) Interrupt table register (INTB)
Interrupt table register (INTB) is configured with 20 bits, indicating the start address of an interrupt vector
table.
(6) Stack pointer (USP/ISP)
Stack pointer comes in two types: user stack pointer (USP) and interrupt stack pointer (ISP), each configured
with 16 bits.
Your desired type of stack pointer (USP or ISP) can be selected by a stack pointer select flag (U flag). This
flag is located at the position of bit 7 in the flag register (FLG).
(7) Static base register (SB)
Static base register (SB) is configured with 16 bits, and is used for SB relative addressing.
(8) Flag register (FLG)
Flag register (FLG) is configured with 11 bits, each bit is used as a flag. Fig.BA-2 shows the flag register
(FLG). The following explains the function of each flag:
• Bit 0: Carry flag (C flag)
This flag retains a carry, borrow, or shift-out bit that has occurred in the arithmetic/logic unit.
• Bit 1: Debug flag (D flag)
This flag enables a single-step interrupt.
When this flag is “1”, a single-step interrupt is generated after instruction execution. This flag is cleared to
“0” when the interrupt is acknowledged.
• Bit 2: Zero flag (Z flag)
This flag is set to “1” when an arithmetic operation resulted in 0; otherwise, cleared to “0”.
• Bit 3: Sign flag (S flag)
This flag is set to “1” when an arithmetic operation resulted in a negative value; otherwise, cleared to “0”.
• Bit 4: Register bank select flag (B flag)
This flag chooses a register bank. Register bank 0 is selected when this flag is “0” ; register bank 1 is
selected when this flag is “1”.
• Bit 5: Overflow flag (O flag)
This flag is set to “1” when an arithmetic operation resulted in overflow; otherwise, cleared to “0”.
• Bit 6: Interrupt enable flag (I flag)
This flag enables a maskable interrupt.
An interrupt is disabled when this flag is “0”, and is enabled when this flag is “1”. This flag is cleared to “0”
when the interrupt is acknowledged.
Rev.1.00 Jul 16, 2004 page 14 of 266
REJ03B0100-0100Z
M16C/6KA GroupCPU
• Bit 7: Stack pointer select flag (U flag)
Interrupt stack pointer (ISP) is selected when this flag is “0” ; user stack pointer (USP) is selected when this
flag is “1”.
This flag is cleared to “0” when a hardware interrupt is acknowledged or an INT instruction of software
interrupt No. 0 to 31 is executed.
• Bits 8 to 11: Reserved area
• Bits 12 to 14: Processor interrupt priority level (IPL)
Processor interrupt priority level (IPL) is configured with the three bits, for specification of up to eight processor interrupt priority levels from level 0 to level 7.
If a requested interrupt has priority greater than the processor interrupt priority level (IPL), the interrupt is
enabled.
• Bit 15: Reserved area
The C, Z, S, and O flags are changed when instructions are executed. See the software manual for details.
IPL
b0b15
Flag register (FLG)
CDZSBOIU
Carry flag
Debug flag
Zero flag
Sign flag
Register bank select flag
Overflow flag
Interrupt enable flag
Stack pointer select flag
Reserved area
Processor interrupt priority level (CPU)
Reserved area
Fig.BA-2 Flag register (FLG)
Rev.1.00 Jul 16, 2004 page 15 of 266
REJ03B0100-0100Z
M16C/6KA GroupRESET
Reset
There are two kinds of resets; hardware and software. In both cases, operation is the same after the reset.
(See “Software Reset” for details of software resets.) This section explains the hardware reset.
When the supply voltage is in the range where operation is guaranteed, a reset is effected by holding the
reset pin level “L” (0.2VCC max.) for at least 20 cycles. When the reset pin level is then returned to the “H”
level while main clock is stable, the reset status is cancelled and program execution resumes from the
address in the reset vector table.
Fig.VB-1 shows the example reset circuit. Fig.VB-2 shows the reset sequence.
RESET
Example when V
Fig.VB-1 Example reset circuit
X
IN
More than 20 cycles are needed
RESET
Internal
clock Φ
Single chip
mode
Address
BCLK 24cycles
V
CC
CC
= 3.3V
RESET
FFFFC
3.3V
V
CC
0V
3.3V
0V
16
FFFFE
3.0V
0.6V
Content of reset vector
16
Fig.VB-2 Reset sequence
Rev.1.00 Jul 16, 2004 page 16 of 266
REJ03B0100-0100Z
M16C/6KA GroupRESET
Table VB-1 shows the statuses of the other pins while the RESET pin level is “L”. Fig.VB-3 and VB-4 show
____________
the internal status of the microcomputer immediately after the reset is cancelled.
Table VB-1 Pin status when RESET pin level is “L”
____________
Status
Pin name
P0
P1
P2, P3, P4
P4
4
P45 to P4
P5
0
P5
1
P5
2
0
7
to P4
I/O port (floating)
I/O port (floating)
3
I/O port (floating)
I/O port (floating)
I/O port (floating)
I/O port (floating)
I/O port (floating)
I/O port (floating)
CNVSS = V
(M0)
SS
P5
3
P5
4
P5
5
P5
6
P5
7
P6, P7, P80 to P84,
P86, P87, P9, P10
P11, P12, P13, P14
P15, P16
I/O port (floating)
I/O port (floating)
I/O port (floating)
I/O port (floating)
I/O port (floating)
I/O port (floating)
I/O port (floating)
I/O port (floating)
Rev.1.00 Jul 16, 2004 page 17 of 266
REJ03B0100-0100Z
Port P9 direction register
Port P10 direction register
(148)
(149)
Pull-up control register 0
(150)
Pull-up control register 1
Pull-up control register 2
(151)
Port control register 0
(152)
(153)
Data registers (R0/R1/R2/R3)
(154)
1
Address registers (A0/A1)
Frame base register (FB)
(155)
Interrupt table register (INTB)
(156)
(157)
User stack pointer (USP)
(158)
Interrupt stack pointer (ISP)
(159)
Static base register (SB)
(160)
Flag register (FLG)
0016
0016
0016
0016
0016
0016
0016
0016
0000000
0016
0016
0016
0016
0016
0016
000016
000016
000016
0000016
000016
000016
000016
000016
x : Nothing is mapped to this bit
? : Undefined
The content of other registers and RAM is undefined when the microcomputer is reset. The initial values must therefore be set.
(Note1) This register exists only in the flash memory version.
Fig.VB-5 Device's internal status after a reset is cleared (3)
Rev.1.00 Jul 16, 2004 page 20 of 266
REJ03B0100-0100Z
M16C/6KA GroupRESET
Serial interrupt control register 0
(161)
(162)
Serial interrupt control register 1
(163)
IRQ request register 0
(164)
IRQ request register 1
(165)
IRQ request register 2
(166)
IRQ request register 3
(167)
IRQ request register 4
Serial interrupt control register 2
(168)
LPC1 address register L
(169)
(170)
LPC1 address register H
LPC2 address register L
(171)
(172)
LPC2 address register H
LPC3 address register L
(173)
(174)
LPC3 address register H
(175)
LPC control register
Port function selection register 2
(176)
(177)
Pull-up resistor control register 5
Pull-up resistor control register 6
Note 1: The areas that nothing are allocated in SFR are reserved. Read and Write to the areas are inhibited.
Fig.CA-4 Location of peripheral unit control registers (3)
Rev.1.00 Jul 16, 2004 page 24 of 266
REJ03B0100-0100Z
M16C/6KA GroupSFR
03C0
0380
16
Count start flag
0381
16
One-shot start flag
0382
16
Trigger select register
0383
16
Up-down flag
0384
16
0385
16
0386
16
TimerA0
0387
16
0388
16
TimerA1
0389
16
038A
16
TimerA2
038B
16
038C
16
TimerA3
038D
16
038E
16
TimerA4
038F
16
0390
16
TimerB0
0391
16
0392
16
TimerB1
0393
16
0394
16
TimerB2
0395
16
TimerA0 mode register
0396
16
TimerA1 mode register
0397
16
TimerA2 mode register
0398
16
0399
16
TimerA3 mode register
TimerA4 mode register
039A
16
TimerB0 mode register
039B
16
TimerB1 mode register
039C
16
TimerB2 mode register
039D
16
039E
16
039F
16
03A0
16
03A1
16
03A2
16
03A3
16
03A4
16
03A5
16
03A6
16
03A7
16
UART1 transmit/receive mode register (U1MR)
03A8
16
UART1 communication speed register (U1BRG)
03A9
16
03AA
16
UART1 tranmit buffer register (U1TB)
03AB
16
UART1 transmit/receive control register0 (U1C0)
03AC
16
UART1 transmit/receive control register1 (U1C1)
03AD
16
03AE
16
UART1 receive buffer register (U1RB)
03AF
16
UART transmit/receive control register2 (UCON)
03B0
16
03B1
16
03B2
16
03B3
16
Flash memory identification register (FTR)
03B4
16
Flash memory control register1 (FMR1)
03B5
16
03B6
16
Flash memory control register0 (FMR0)
03B7
16
03B8
16
03B9
16
03BA
16
03BB
16
03BC
16
03BD
16
03BE
16
03BF
16
(TA0)
(TA1)
(TA2)
(TA3)
(TA4)
(TB0)
(TB1)
(TB2)
(TABSR)
(UDF)
(ONSF)
(TRGSR)
(TA0MR)
(TA1MR)
(TA2MR)
(TA3MR)
(TA4MR)
(TB0MR)
(TB1MR)
(TB2MR)
Note 1: The areas that nothing are allocated in SFR are reserved. Read and Write to the areas are inhibited.
16
A-D register0 (AD0)
03C1
16
03C2
16
A-D register1 (AD1)
03C3
16
03C4
16
A-D register2 (AD2)
03C5
16
03C6
16
A-D register3 (AD3)
03C7
16
03C8
16
A-D register4 (AD4)
03C9
16
03CA
16
A-D register5 (AD5)
03CB
16
03CC
16
A-D register6 (AD6)
03CD
16
03CE
16
A-D register7 (AD7)
03CF
16
03D0
16
03D1
16
03D2
16
03D3
16
A-D control register2 (ADCON2)
03D4
16
03D5
16
03D6
16
A-D control register0 (ADCON0)
03D7
16
A-D control register1 (ADCON1)
03D8
16
03D9
16
03DA
16
03DB
16
03DC
16
03DD
16
03DE
16
03DF
16
03E0
16
Port P0 (P0)
03E1
16
Port P1 (P1)
Port P0 direction register (P0D)
03E2
16
03E3
16
Port P1 direction register (P1D)
03E4
16
Port P2 (P2)
03E5
16
Port P3 (P3)
Port P2 direction register (P2D)
03E6
16
03E7
16
Port P3 direction register (P3D)
03E8
16
Port P4 (P4)
Port P5 (P5)
03E9
16
Port P4 direction register (P4D)
03EA
16
Port P5 direction register (P5D)
03EB
16
03EC
16
Port P6 (P6)
Port P7 (P7)
03ED
16
Port P6 direction register (P6D)
03EE
16
Port P7 direction register (P7D)
03EF
16
Port P8 (P8)
03F0
16
Port P9 (P9)
03F1
16
Port P8 direction register (P8D)
03F2
16
Port P9 direction register (P9D)
03F3
16
Port P10 (P10)
03F4
16
03F5
16
Port P10 direction register (P10D)
03F6
16
03F7
16
03F8
16
03F9
16
03FA
16
03FB
16
03FC
16
Pull-up control register0 (PUR0)
Pull-up control register1 (PUR1)
03FD
16
Pull-up control register2 (PUR2)
03FE
16
Port control register0 (PCR0)
03FF
16
Fig.CA-5 Location of peripheral unit control registers (4)
Rev.1.00 Jul 16, 2004 page 25 of 266
REJ03B0100-0100Z
M16C/6KA Group
Software Reset
Software Reset
Writing “1” to bit 3 of the processor mode register 0 (address 000416) applies a (software) reset to the
microcomputer. A software reset has almost the same effect as a hardware reset. The contents of internal
RAM are retained.
Processor Mode
(1) Types of Processor Mode
The single-chip mode is supported in processor mode.
• Single-chip mode
In single-chip mode, only internal memory space (SFR, internal RAM, and internal ROM) can be accessed.
Ports P0 to P16 can be used as programmable I/O ports or as I/O ports for the internal peripheral functions.
Fig. BG-1 shows the structure of processor mode register 0 and processor mode register 1.
Processor mode register 0 (Note 1)
b7 b6 b5 b4 b3 b2 b1 b0
00000
SymbolAddressWhen reset
PM00004
PM00
PM01
Reserved bitMust always be set to “0”
PM03
Reserved bitMust always be set to “0”
Note 1: Set bit 1 of the protect register (address 000A16) to “1” when writing new
values to this register.
Processor mode register 1 (Note 1)
b7 b6 b5 b4 b3 b2 b1 b0
00
00
SymbolAddressWhen reset
PM10005
0
Reserved bit
Nothing is assigned.
In an attempt to write to these bits, write “0”. The value, if read, turns out
to be indeterminate.
The device is reset when this bit is set
to “1”. The value of this bit is “0” when
read.
00000XX0
2
Must always be set to “0”
WR
WR
Reserved bit
PM17Wait bit
Note 1: Set bit 1 of the protect register (address 000A
Fig.BG-1 Processor mode register 0 and 1
Rev.1.00 Jul 16, 2004 page 26 of 266
REJ03B0100-0100Z
values to this register.
Must always be set to “0”
0 : No wait state
1 : Wait state inserted
16
) to “1” when writing new
M16C/6KA Group
Bus control
Bus control
(1) Software wait
A software wait can be inserted by setting the wait bit (bit 7) of the processor mode register 1 (address
000516) (Note) .
A software wait is inserted in the internal ROM/RAM area by setting the wait bit of the processor mode
register 1. When set to “0”, each bus cycle is executed in one BCLK cycle. When set to “1”, each bus cycle
is executed in 2 BCLK cycles. After the microcomputer has been reset, this bit defaults to “0”.
Set this bit after referring to the recommended operating conditions (main clock input oscillation frequency)
of the electric characteristics.
The SFR area is always accessed in two BCLK cycles regardless of the setting of these control bits.
Table.EF-1 shows the software wait and bus cycles. Fig.EF-1 shows example bus timing when using software waits.
Note: Before attempting to change the contents of the processor mode register 1, set bit 1 of the protect
register (address 000A16) to “1”.
Table.EF-1 Software waits and bus cycles
AreaWait bit
SFR
Internal
ROM/RAM
Invalid2 BCLK cycles
01 BCLK cycle
12 BCLK cycles
Bus cycle
Rev.1.00 Jul 16, 2004 page 27 of 266
REJ03B0100-0100Z
M16C/6KA Group
Bus control
No wait
With wait
BCLK
Write signal
Read signal
Data bus
Address bus
Chip select
BCLK
Write signal
Read signal
Bus cycle
(Note 1)
Address
Bus cycle
(Note 1)
Output
Bus cycle
(Note 1)
Input
Address
Bus cycle
(Note 1)
Data bus
Address bus
Address
Chip select
Note 1: This timing sample shows the lenth of bus cycle. It is possible that the read cyles, write cycle
comes after this cycle in succession.
Fig.EF-1 Typical bus timings using software wait
Output
Input
Address
Rev.1.00 Jul 16, 2004 page 28 of 266
REJ03B0100-0100Z
M16C/6KA Group
Clock Generating Circuit
Clock Generating Circuit
The clock generating circuit contains two oscillator circuits that supply the operating clock sources to the
CPU and internal peripheral units.
Table.WA-1 Main clock generating circuits
Main clock generating circuit
Use of clock• CPU’s operating clock source
• Internal peripheral units’
operating clock source
Usable oscillatorCeramic oscillator
Pins to connect oscillatorXIN, XOUT
Oscillation stop/restart functionAvailable
Oscillator status immediately after resetOscillating
OtherExternally derived clock can be input
Example of oscillator circuit
Fig.WA-1 shows some examples of the main clock circuit, one using an oscillator connected to the circuit,
and the other one using an externally derived clock for input. Circuit constants in Fig.WA-1 vary with oscillator used. Use the values recommended by the manufacturer of your oscillator.
Microcomputer
(Built-in feedback resistor)
X
IN
C
IN
Note: Insert a damping resistor if required. The resistance will vary depending on the oscillator and the oscillation drive
capacity setting. Use the value recommended by the maker of the oscillator.
When the oscillation drive capacity is set to low, check that oscillation is stable.
Apply the feedback register between X
X
OUT
(Note)
R
d
C
OUT
IN
and X
OUT
if required by oscillator maker.
Fig.WA-1 Examples of main clock
Microcomputer
(Built-in feedback resistor)
X
IN
Externally derived clock
Vcc
Vss
X
OUT
Open
Rev.1.00 Jul 16, 2004 page 29 of 266
REJ03B0100-0100Z
M16C/6KA Group
Clock Generating Circuit
Clock Control
Fig.WA-2 shows the block diagram of the clock generating circuit.
RESET
Software reset
NMI
Interrupt request
level judgment
output
CM10 “1”
Write signal
WAIT instruction
Q
S
R
QS
R
X
IN
Main clock
X
OUT
CM02
f
1
f
AD
f
8
f
32
c
b
Divider
d
a
f1SIO2
f8SIO2
f32SIO2
BCLK
CM0i : Bit i at address 0006
CM1i : Bit i at address 0007
Fig.WA-2 Clock generating circuit
b
a
16
16
1/21/21/21/2
CM06=0
CM17,CM16=10
CM06=0
CM17,CM16=01
CM06=0
CM17,CM16=00
CM06=1
CM06=0
CM17,CM16=11
Details of divider
c
1/2
d
Rev.1.00 Jul 16, 2004 page 30 of 266
REJ03B0100-0100Z
Loading...
+ 238 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.