1.The information contained herein can change without notice owing to product and/or technical improvements. Before using the
product, please make sure that the information being referred to is up-to-date.
2.The outline of action and examples for application circuits described herein have been chosen as an explanation for the
standard action and performance of the product. When planning to use the product, please ensure that the external conditions
are reflected in the actual circuit, assembly, and program designs.
3.When designing your product, please use our product below the specified maximum ratings and within the specified operating
ranges including, but not limited to, operating voltage, power dissipation, and operating temperature.
4.Oki assumes no responsibility or liability whatsoever for any failure or unusual or unexpected operation resulting from
misuse, neglect, improper installation, repair, alteration or accident, improper handling, or unusual physical or
electrical stress including, but not limited to, exposure to parameters beyond the specified maximum ratings or
operation outside the specified operating range.
5.Neither indemnity against nor license of a third party’s industrial and intellectual property right, etc. is granted by us in
connection with the use of the product and/or the information and drawings contained herein. No responsibility is assumed by
us for any infringement of a third party’s right which may result from the use thereof.
6.The products listed in this document are intended for use in general electronics equipment for commercial applications (e.g.,
office automation, commun ication equipment, measurement equipment, consumer electronics, etc.). These products are n ot
authorized for use in any system or application that requires special or enhanced quality and reliability characteristics nor in
any system or application where the failure of such system or application may result in the loss or damage of property, or death
or injury to humans.
Such applications include, but are not limited to, traffic and automotive equipment, safety devices, aerospace equipment,
nuclear power control, medical equipment, and life-support systems.
7.Certain products in this document may need government approval before they can be exported to particular countries. The
purchaser assumes the responsibility of determining the legality of export of these products and will take appropriate and
necessary steps at their own expense for these.
8.No part of the contents contained herein may be reprinted or reproduced without our prior permission.
Copyright 2001 Oki Electric Industry Co., Ltd.
Page 3
Preface
This manual describes the hardware and operation of the MSM9225B CAN Controller
which conforms to the CAN protocol specification (Bosch, V2.0 part B/Active).
In this manual, additions and modifications that have been made on the upgrade to the
MSM9225B from the MSM9225 are indicated by “ ” on their respective pages.
This document is subject to change without notice.
B
Page 4
Notation
A
ClassificationNotationDescription
♦ Numeric valuexxhex, xxh, xxHIndicates a hexadecimal number. x: Any value in the range of 0 to F
xxbIndicates a binary number; “b” may be omitted. x: A value 0 or 1
♦ Symbolx0hexx indicates any value in the range of 0 to F of the high-order 4 bits.
6
3
= 1000
-3
-6
-9
♦ Terminology“H” level, “1” levelIndicates high voltage signal levels V
and VOH as specified by the
IH
electrical characteristics.
“L” level, “0” levelIndicates low voltage signal levels V
and VOL as specified by the
IL
electrical characteristics.
♦ Register descrip tion
Read/write attribute: R indicates a readable bit and W indicates a writable bit.
MSB/LSB:Most significant bit of the 8-bit register (memory)/least significant bit of the 8-bit register
4.3.2CAN Bus Interface................................................................................................................................4-7
4.3.2.1Electrically Isolated from Bus Transceiver (PCA82C250)..............................................................4-7
4.3.2.2Directly Connected to Bus Transceiver (PCA82C250)................................................................... 4-7
4.3.2.3Monitoring the CAN Bus.................................................................................................................4-8
5.2.1Separate Bus Mode ...............................................................................................................................5-5
5.2.3Multiplexed Bus Mode.......................................................................................................................... 5-7
Appendix A Package Dimensions ...................................................................................................................... A-1
Appendix B MSM9225B Memory Map............................................................................................................. A-2
Appendix C MSM9225B User’s Manual Contents of Revision From 2nd Version to 3rd Version................. A-10
Contents – 2
Page 7
Chapter 1
Overview
Page 8
MSM9225B User’s Manual
Chapter 1 Overview
Chapter 1Overview
1.1Overview
The MSM9225B is a microcontroller peripheral LSI which conforms to the CAN protocol for high-speed LANs
in automobiles.
1.2Features
•Conforms to CAN protocol specification (Bosch, V2.0 part B/Active)
•Maximum of 1 Mbps bit rate
•Communicatio n me t hod :
Transmission line is bi-directional, two-wire serial communication
NRZ (Non-Return to Zero) system using bit stuff function
Multi-master system
Broadcast system
•Up to 16 message boxes can be used, and messages up to 8 b ytes long can be transmitted or received for each
message box.
Number of received messages can be extended by group message function (up to 2 groups can be set)
B
Overwrite flag is provided
•Priority control by identifier
2032 types in standard format, 2032 × 2
•Microcontroller interface
Corresponding to both parallel and serial interface
Parallel interface: Separate address/data bus type (with address latch signal/no address latch signal) and
multiplexed address/data bus type
Serial interface:Synchronous communication type
Three interrupt sources: transmission/receive/error
•Error control:
Bit error/stuff error/CRC error/form error/acknowledgment error detection functions
Retransmission/error status monitoring function when error occurs
B
Bit error flag/stuff error flag/CRC error flag/form error flag/acknowledge error flag are provided
•Communication control by remote data request function
Chip select pin. When “L”, PALE, PWR, PRD/SRW, SCLK and SDO pins
CS10I
A7-0
AD7-0/
D7-0
PWR26I
PRD/
SRW
PALE27I
SDI7I
SDO5O
SCLK8I
41-44,
1-4
31-38I/O
9I
(microcontroller interface pins) are valid.
When “H”, these pins are invalid.
Address bus pins (when using separa te buses). If used with a multiplex ed bus
I
or if used in the serial mode, fix these pins at “H” or “L” levels.
Multiplexed bus: Address/data pins (AD7-0)
Separate buses: Data pins (D7-0)
If used in the serial mode, fix these pins at a “L” level.
Write input pin if used in the parallel mode. Data is captured when this pin is
at a “L” level.
If used in the serial mode, fix this pin at a “L” level.
Parallel mode: Read signal pin (PRD)
When at a “L” level, data is output from the data pins.
Serial mode: Read/write signal pin (SRW)
When at a “H” level, data is output from the SDO pin.
When at a “L” level, the SDO pin is at high impedance, and data is captured
beginning with the second byte of data input from the SDI pin.
Address latch signal pin
When at a “H” level, addresses are captured.
If used in the parallel mode and the address latch signal is unnecessary or in
the serial mode, fix this pin at a “H” or “L” level.
Serial data input pin
Addresses (1st byte) and data (beginning from the 2nd byte) are input to this
pin, LSB first. If used in the parallel mode, fix this pin at a “H” or “L” level.
Serial data output pin
When the CS pin is at a “H” level, this pin is at high impedance. When CS is at
a “L” level, data is output from this pin, LSB first.
If used in the parallel mode, fix this pin at a “H” or “L” level.
Shift clock input pin for serial data
At the rising edge of the shift clock, SDI pin data is captured. At the falling
edge, data is output from the SDO pin.
Ready output pin
When required by the MSM9225B, a signal may be output to extend the bus
cycle until the internal access is completed.
PRDY/
SWAIT
16O
Parallel mode
(PRDY)
Serial mode
(SWAIT)
Internal access in progressAfter completion of access
12, 20, 24, 40—Power supply pin: Connect all VDD pins to the power supply source.
6, 15, 17, 21, 28,
39
—GND pin: Connect all GND pins to ground.
00No address latch signal
01
10
11Serial mode
Interrupt request output pin
When an interrupt request occurs, a “L” level is output. This pin automatically
outputs a “H” level after 32 Ts (T = 1/fosc).
Three types of interrupts share this pin: transmission complete, reception
complete, and error.
Reset pin
System is reset when this pin is at a “L” level.
Clock pins. If internal oscillator is used, connect a crystal (ceramic resonator).
If external clock is used, in put clock via X T pin. The XT pin should be left open.
Parallel mode
Separate
buses
Multiplexed buses
MSM9225B User’s Manual
Chapter 1 Overview
With address latch signal
1 – 5
Page 13
Chapter 2
Register Descriptions
Page 14
MSM9225B User’s Manual
E
F
(
)
Chapter 2 Register Descriptions
Chapter 2Register Descriptions
2.1Memory Space
The MSM9225B has 256 bytes of memory space for the message memory and control registers. Before starting
communication, messages for communication and various control registers must be set.
Figure 2-1 shows the configuration of memory space.
The message memory and the control registers are selected by an 8-bit address.
The message memory consists of 16 message boxes (message box 0 to message box F). Each message box is
selected by the high-order 4 bits (0hex to Fhex) of the address, and the message control register, the identifier,
and the area for storing the message contents are selected by the low-order 4 bits (0hex to Dhex) of the address.
It is possible to store a 2-byte (standard format) or a 5-byte (extended format) identifier and a message of a
maximum of 8 bytes can be stored in each message box. The control registers are selected by the low-order 4
bits (Ehex, Fhex) of the address. Table 2-1 shows the configuration of the control registers.
0EHCANCCAN control register
0FHCANICAN interrupt control register
1EHNMESMessage box count setting register
1FHBTR0CAN bus timing register 0
2EHBTR1CAN bus timing register 1
2FHTIOCCommunication input/out put con t rol regi ster
3EHGMR0Group message register 0
3FHGMR1Group message register 1
4EHGMSK00Message mask register 00
4FHGMSK01Message mask register 01
5EHGMSK02Message mask register 02
5FHGMSK03Message mask register 03
6EHGMSK10Message mask register 10
6FHGMSK11Message mask register 11
7EHGMSK12Message mask register 12
7FHGMSK13Message mask register 13
8EHSTBYStandby control register
8FHCANC2CAN control register 2
B
9EHTMNCommunication message box number register
9FHCANSCAN status register
AEHTECTransmiss ion error coun ter
AFHRECReceive error counter
BEHCANS2CAN status register 2
B
BFHBOCOBus off release counter
B
CEH
CFH
DEH
DFH
EEH
EFH
FEH
FFH
—Not used (reserve area)
2 – 2
Page 16
MSM9225B User’s Manual
Chapter 2 Register Descriptions
2.2Message Me mory
The message memory is the memory for setting and storing messages to be transmitted and received. The
message memory consists of 16 message boxes from message box 0 to message box F.
It is possible to transmit only the messages that have been stored in the message boxes, and the transmission is
done starting from the message box with the higher priority for which a transmission request is present.
Reception is possible only of messages having identifiers stored in the message boxes. When a message has
been received normally without generating an error, and if the identifier matches with the identifier stored in a
message box, the data of the message is stored in the corresponding message box in the message memory. Set
the highest message box number to be used in the register NMES (see Section 2.4.3).
Note when reading Message Memory Related Register
When the Message Memory Related Register (MCR, IDR0, IDR1, MSG0-7 in the case of the standard
format, IDR2-4 and TMSG0-7 in the case of the extended format) is polled, the same data are read out from
it as long as the same address is specified consecutively even if the Message Memory Related Register is
overwritten by the completion of message transfer between each polling.
However the MM A bit of Me ssage Co ntrol Regist er ( MCR, ×0hex) a nd Contr ol Re gi sters l ocat ed a t ×E hex
and ×Fhex addresses are excluded.
When the Message Memory Related Register is polled, insert the dummy read access to the different
address after each reading out.
disabled for remote frame reception.
Data frame automatic transmission
1
enabled for remote frame reception.
0Frame type specification
1See Table 2-2 for details.
Setting the transmission completion
0
interrupt request flag (ITF) is disabled.
Setting the transmission completion
1
interrupt request flag (ITF) is enabled.
Setting the receive completion interrupt
0
request flag (IRF) is disabled.
Setting the receive completion interrupt
1
request flag (IRF) is enabled.
0Cleared to “0” by the microcontroller.
1“1” is set at the completion of reception.
Cleared to “0” at the end of
0
transmission.
Write a “1” for transmission
1
(transmission request).
B
Writing disabled from the microcontroller to the message box. Transmission and reception are
0
possible.
Writing enabled from the microcontroller to the message box. Transmission and reception
1
stopped.
0No message overwrite
1Message has been overwritten
Figure 2-2 Message Control Register (MCR)
2 – 4
Page 18
MSM9225B User’s Manual
Chapter 2 Register Descriptions
(1) Automatic transmission: ARES
If the automatic transmission of the data frame is used for remote frame reception, set this bit to “1”.
At reset, the ARES bit is set to “0”. The ARES bit is invalid if the message is speci fied as a group
message.
Notes on Automatic Transmission
Following shows how the transmission is carried out for the messages for which ARES is set to “1”
when a remote frame is received.
The MSM9225B detects the transmission priority of all the messages for which the TRQ (transmission
request) bit is set to “1”, then transmits the messages in sequence from the one with the highest priority.
Note, therefore, that messages for which automatic transmission is set will not always be transmitted
immediately after remote frame reception if there are any other messages to be transmitted.
Also in cases where there are some messages for which TRQ is set to “1”, whereas the TIRS bit of
CANC is not set to “1” because it is not yet desired to transmit them, those messages for which TRQ bit
is set to “1” will be transmitted.
(2) Frame type setting: FRM
This flag sets the frame type of the message to be transmitted/received. A message of a frame type oth er
than the specified frame type cannot be transmitted/received.
Table 2-2 shows the relationship between setting and frame type.
At reset, the FRM bit is set to “0”.
Table 2-2 Frame Types
Specified as group messageFRMTransmission frameReceive frame
This is a flag to enable setting (“1”) the transmission interrupt request flag (ITF) when transmission
completes.
Set this flag from the microcontroller.
The EIT bit is valid when the EINTT bit of the CANI register is “1”. (See Section 2.4.2.)
At reset, the EIT bit is set to “0”.
(4) Receive completion interrupt enable: EIR
This is a flag to enable setting (“1”) the receive interrupt request flag (IRF) when receiving completes.
Set this flag from the microcontroller.
The EIR bit is valid when the EINTR bit of the CANI register is “1”. (See Section 2.4.2.)
At reset, the EIR bit is set to “0”.
(5) Receive status: RCS
When receiving completes, the RCS bit becomes “1”. Write “0” to the RCS bit before the microcontroller reads receive data. When receiving the remote frame, the RCS bit becomes “1” just after the
reception. When receiving the data frame, it becomes “1” after receive data is written to the message
box.
At reset, the RCS bit is set to “0”.
When a message box is used for transmissio n, write “1” to this bit from the microcontroller. When
transmission ends normally, “0” is written to this bit. This means that the TRQ bit is “1” during
transmission. Therefore, to request transmission, confirm that the TRQ bit is “0” first, and then write “1”
to the TRQ bit. Set the TIRS bit of CANC to start transmissio n.
When the remote frame is received while the ARES bit is “1”, the TRQ bit is set to “1”.
At reset, the TRQ bit is set to “0”
(7) Overwrite flag: OW
B
When the RCS bit is “1”, this bit is set to “1” if data has been received by the same message box again.
That is, OW is a flag to indicate that receive data has been overwritten.
At reset, the OW bit is set to “0”.
(8) Message box access request/enable bit: MMA
Be sure to write a “1” to the MMA bit before writing to a message box from the microcontroller. T hen
read the MMA bit. If “1” is read, the message box is accessible. If “0” is read, write a “1” in a loop
until the MMA bit actually becomes “1”.
After a “1” has been written to the MMA bit and the message box has been rewritten, be sure to write a
“0” to the MMA bit. Then read the MMA bit. If “1” is read, write a “0” in a loop until the MMA bit
actually becomes “0”.
The initialization bit INIT of the CAN control register (CANC: 0Ehex) has priority over the MMA bit.
That is, when INIT is “1”, the MMA bit is read as “1” irrespective of whether the MMA bit content is
“0” or “1”, so that the message box becomes accessible. In addition, after INIT is reset to “0”, all the
MMA bits will be set to “0”.
At reset, the MMA bit is set to “0”. It is possible to rewrite the contents of the other bits in the message
control register (MCR) at the same time that the MMA bit is overwritten.
When the MMA bit of a message box is set to “1”, do not set the MMA bit of other message box to “1”.
2 – 6
Page 20
MSM9225B User’s Manual
Chapter 2 Register Descriptions
2.3.2 Identifier 0 (IDR0: x1hex)
This register sets the frame format, data length code, and a part of the identifier.
The bit configuration is as follows:
DLC3 DLC2 DLC1 DLC0 Number of bytes of a data field
00000
00011
•••••
•••••
01117
10008
0Standard format (ID = 11 bits)
1Extended format (ID = 29 bits)
Figure 2-3 Identifier 0 (IDR0)
(1) Identifier: IDB28 to IDB26
These bits set the identifier field.
For standard format (IDFM = 0), the higher 3 bits (ID28 to ID26) of the 11 bits (ID28 to ID18) are set.
For extended format (IDFM = 1), the higher 3 bits (ID28 to ID26) of the 29 bits (ID28 to ID0) are set.
At reset, these bits are undefined.
Note on Identifier
B
The identifier field (ID28 to ID18 for standard format, and ID28 to ID0 for extended format) is
overwritten with the received message’s identifier, when the message box for which the group message
function has been specified receives the message.
(2) Data length code: DLC3 to DLC0
These bits set the number of bytes of a data field. 0 to 8 can be set. Do not set values other than 0 to 8.
At reset, these bits are undefined.
Notes on Data Length Code
When the received data length code (hereafter DLC) matches the DLC set in the message box, the
number of bytes of data indicated by the received DLC is received and written to the message box.
When the received DLC does not match the DLC set in the message box, the MSM9225B operates as
B
follows:
- The received DLC is written into the DLC field in the message box.
- The number of bytes of data indicated by the received DLC is received a nd written to the message box.
(3) Frame format setting: IDFM
This bit sets the frame format.
At reset, the IDFM bit is undefined.
IDFMOperation
0Standard format (ID = 11 bits)
1Extended format (ID = 29 bits)
These bits set the 8 bits of the identifier.
For standard format (IDFM = 0), the lower 8 bits (ID25 to ID18) of the 11 bits (ID28 to ID18) are set.
For extended format (IDFM = 1), ID25 to ID18 of the 29 bits (ID28 to ID0) are set.
At reset, these bits are undefined.
2.3.4 Identifiers 2, 3, 4/Messages 0-7 (MSG0-7 in the case of standard format; IDR2-4, TMSG0-7 in the
case of extended format: x3 to xDhex)
In the case of the standard format (IDFM = 0), the addresses x3 to xAhex (MSG0-7) become the registers for
storing the transmit/receive data.
In the case of the extended format (IDFM = 1), the addresses x3 to x5hex (IDR2-4) are used for setting the
identifier field and the addresses x6 to xDhex (TMSG0-7) are used for the registers for storing the
transmit/receive data.
In either case, the transmit/receive data can be stored up to a maximum of 8 bytes, and it is necessary to set
beforehand the number of bytes that can be transmitted or received by the data length code. (See the
explanation about the data length code (DLC) in Section 2.3.2.)
The contents of these registers after a reset will not be definite.
The bit configurations are shown below.
2 – 8
Page 22
MSM9225B User’s Manual
Chapter 2 Register Descriptions
* The top rows indicate the ID for the extended format setting and the botto m rows indicate the con tent of message 0
A message has the priority determined by the identifier setting. To determine priority, identifiers of
messages are compared from the higher bit, and the identifier (set to “0”) detected first has the higher
priority (see the example below).
In this example, priority is determined at the shaded bits.
Figure 2-16 Message Priority
•When same identifiers are set to multiple messages boxes
When same identifiers are set to multiple message boxes, operations are as follows:
1.Transmit operation
Messages are transmitted sequentially from the smaller message box number.
2.Receive operation
Data is always written to the message box with the smallest message box number, and never written
to other message boxes.
For example, if the same identifier is set at message box numbers 1 to 4, as shown in Figure 2-17,
operations are as follows:
• Transmit operation
If every message box below is set for transmission, messages are transmitted sequentiall y in the
order of message box number 5 → 0 → 6 → 1 → 2 → 3 → 4.
• Receive operation
When the identifier “11100111001” is received from the CAN bus, received data is always
written to the message box which is indicated by the message box number 1.
Message boxIdentifier
number
000001111111
11 11 0 0 11 1 0 0 1
21 11 0 0 11 1 0 0 1The range in which the same
31 11 0 0 11 1 0 0 1identifier is set
41 11 0 0 11 1 0 0 1
500000000111
610000000011
0Transmission operation halted
1Transmission operation is in progress
0Receive operation halted
1Receive operation is in progress
Unused bit
Write a “0”.
* TIRS is in the read-only state when “0”, and CANA, TxF, RxF are read-only bits.
Figure 2-18 CAN Control Register (CANC)
(1) Initialization bit: INIT
This is the bit for setting the initialization mode of the communication control section.
At the time of initialization, start the initialization after writing a “1” to INIT and reading it to ensure
that INIT has been set to “1”. Also, at the end of initialization, write a “0” to INIT, then read this bit to
make sure that it has been set to “0”. In either case, make sure to carry out the above operations
because neither “1” nor “0” will be set immediately. Note that data cannot be written to the INIT bit
while the CAN bus is at the dominant level.
If INIT is set to “1” during transmission or reception, the initialization is started after completing the
communication. Although the communication operation stops when INIT is set to “1”, the contents of
the message memory and the control registers will be retained, except the content of the MMA bit of the
message control register within the message box.
To initialize the message memory, first write the number of message boxes to be used in the message
box count setting register NMES, and then write the message control register, identifier 1, and identifier
2 in sequence from the message box number 0 for all the message boxes to be used.
At reset, INIT is set to “1”.
When this bit is set, the identifiers are scanned starting from the message box 0 up to last message box
specified by NMES, the messages with the transmission request bit TRQ set to “1” are detected, and the
transmission is started from the one with the highest priority. TIRS will be set to “0” when all the
messages with the transmission request TRQ set to “1” have been transmitted, or when no message box
with TRQ being “1” is detected as a result of the search.
Writing a “0” to TIRS when it has already been set to “1” will stop the trans mission of the messa ge after
the transmission which has already been started is completed.
At reset, TIRS is set to “0”.
* See Appendix C “Transmission Failure of MSM9225B” for transmission operation.
(3) Bit synchronization: SYNC
This bit is used to set the bit synchronization edge to synchronize at the CAN bus.
When SYNC is “0”, the synchronization edge is set at the falling edge of data.
When SYNC is “1”, the synchronization edge is set at both the rising and falling edges of data.
At reset, SYNC is set to “0”.
(4) CAN write flag: CANA
This bit is used to indicate receive data write status to the message box. CANA is “1” while CAN is
writing receive data to the message box.
This is a read-only flag.
(5) Transmission flag: TxF
This bit is used to indicate transmission operation status.
When TxF is “0”, CAN is in transmission operation stop status.
When TxF is “1”, CAN is in transmission operation status.
This is a read-only flag.
(6) Receive flag: RxF
This bit is used to indicate receive operation status.
When RxF is “0”, CAN is in receive operation stop status.
When RxF is “1”, CAN is in receive operation status.
This is a read-only flag.
2 – 18
Page 32
2.4.2 CAN Interrupt Control Register (CANI: 0Fhex)
This register controls CAN interrupts.
The bit configuration is as follows:
This bit is used to output transmission complete interrupt signal INTT from interrupt pin INT when
transmission completes.
When EINTT is “0”, a transmission complete interrupt signal is not output from the interrupt pin.
When EINTT is “1”, a transmission complete interrupt signal is output from the interrupt pin.
At reset, EINTT is set to “0”.
This bit is used to output receive complete interrupt signal INTR from interrupt pin INT when reception
completes.
When EINTR is “0”, a receive complete interrupt signal is not output from the interrupt pin.
When EINTR is “1”, a receive complete interrupt signal is output from the interrupt pin.
At reset, EINTR is set to “0”.
When an error occurs, this bit is used to output error interrupt signal INTE from interrupt pin INT.
When EINTE is “0”, an error interrupt signal is not output from the interrupt pin.
When EINTE is “1”, an error interrupt signal is output from the interrupt pin.
At reset, EINTE is set to “0”.
ITF becomes “1” when a transmission complete interrupt is generated. Only “0” can be written to this
bit.
At reset, ITF is set to “0”.
(5) Receive complete interrupt request flag: IRF
IRF becomes “1” when a receive complete interrupt is generated. Only “0” can be written to this bit.
At reset, IRF is set to “0”.
(6) Error interrupt request flag: IEF
IEF becomes “1” when an error occurs. Only “0” can be written to this bit.
At reset, IEF is set to “0”.
(7) Master interrupt control enable: MEINT
This bit is used to set enable/disable of interrupts.
The outline of interrupt control is shown in Figure 2-20.
When MEINT is “0”, interrupt request control is disabled.
When MEINT is “1”, interrupt request control is enabled.
At reset, MEINT is set to “0”.
MEINT
0
INTpin
INT
pin
* INT signal generator circuit
This signal changes to “L”
from “H” when an interrpt
request is generated, and is
automatically set to “H” again
after 32 Ts (T-1/fosc).
1
EINTT
0
1
0
1
0
1
INTT
EINTR
INTR
EINTE
INTE
ITF
IRF
IEF
Figure 2-20 Interrupt Control
Interrupt cause (transmission completed)
EIT (for each message box)
This is a register to set the number of message boxes to be used.
A maximum of 16 message boxes can be set, with message box numbers 0 to F.
Writing to NMES is enabled when initialize bit INIT of the CAN control register (CANC: 0Ehex) is “1”.
At reset, NMES is set to “00000000”
The bit configuration and relationship between message box number and number of message boxes are as
follows:
The MSM9225B has an internal baud rate prescaler that generates the BTL (Bit Timing Logic) signal by
dividing the system clock by a factor of 1 to 64. BTL is the system clock for the communication function.
The register BTR0 sets the baud rate prescaler and the SJW width.
Writing to BTR0 is enabled only when the initialization bit INIT of the CAN control register (CANC: 0Ehex)
has been set to “1”.
The bit configuration is shown below.
This is a 6-bit field to set the BTL cycle time of the basic clock for communication operation.
Table 2-5 shows the relationship between the bit content and BTL.
The BTL cycle time is given by the following equation:
BTL cycle time = 2 × (BRP setting value + 1)/f
where f
is the oscillation frequency.
OSC
OSC
At reset, BRP5 to BRP0 are set to “000000”.
Table 2-5 BTL Cycle Time Setting
BRP5BRP4BRP3BRP2BRP0BRP0BTL cycle time
000000 1 × System clock period
000001 2 × System clock period
•
•
•
111110 63 × System clock period
111111 64 × System clock period
•
•
•
•
•
•
•
•
•
System clock: the clock 1/2 the frequency of the oscillation frequency
•
•
•
(2) SJW: SJWA, SJWB
This is a 2-bit field to set SJW.
Table 2-6 shows the relationship between bit content and SJW.
At reset, SJWA and SJWB are set to “00”.
This register sets the sampling point used for bus timing.
Writing to the BTR1 bit is enabled, when the INIT bit of the CAN control register (CANC: 0Ehex) is “1”.
The bit configuration is as follows:
MSBNot
used
Initial
value:
TSEG22 TSEG21 TSEG20 TSEG13 TSEG12 TSEG11 TSEG10
00000000
TSEG13 TSEG12 TSEG11 TSEG10
00001 × BTL cycle
00012 × BTL cycle
•
•
111015 × BTL cycle
111116 × BTL cycle
TSEG22 TSEG21 TSEG20
000 1 × BTL cycle
001 2 × BTL cycle
•
•
110 7 × BTL cycle
111 8 ×
•
•
•
•
•
•
TSEG2
•
•
BTL cycle
•
•
•
•
Figure 2-23 CAN Bus Timing Register 1 (BTR1)
LSBBTR1 (2Ehex), R/W: R/W
TSEG1
•
•
Unused bit.
Write a “0”.
(1) Time segment 1: TSEG13 to TSEG10
This is a 4-bit field to set the sampling point.
Table 2-7 shows the relationship between bit content and TSEG1.
At reset, TSEG13 to TSEG10 are set to “0000”.
Table 2-7 TSEG1 Setting
TSEG13TSEG12TSEG11TSEG10TSEG1
00001 × BTL cycle
00012 × BTL cycle
•
•
•
111015 × BTL cycle
111116 × BTL cycle
•
•
•
•
•
•
•
•
•
(2) Time segment 2: TSEG22 to TSEG20
This is a 3-bit field to set TSEG2.
Table 2-8 shows the relationship between the bit content and TSEG2.
At reset, TSEG22 to TSEG20 are set to “000”.
Bit timing is set by CAN bus timing registers 0 and 1 (BTR0, 1). Figure 2-24 shows the relationship
between 1 bit time of a message and CAN bus timing.
Table 2-8 TSEG2 Setting
•
•
•
•
•
•
1 bit time
•
•
•
SYNC-SEG
1BTL
cycle
PROP-SEG
SJW1
(BTR0 : SJWB/A)
(BTR1 : TSEG13-10)
PHASE-SEG1PHASE-SEG2
TSEG1
Sampling
point
TSEG2
(BTR1 : TSEG22-20)
SJW2
(= SJW1)
Transmit
point
Figure 2-24 Bit Timing
Explanation of Terms Used
•Sync segment: The segment in which the falling edge is detected and the bit synchronization is started.
•Prop segment: The segment for compensating for the delay of the output buffer, the CAN bus, and the
input buffer. Set so as to wait until ACK is returned before the start of phase segment 1.
Period of prop segment time ≥ (output buffer delay + CAN bus delay + input buffer delay)
•Phase segment 1, 2: These are the segments for compensating the error in the data bit time. Although a
larger tolerance can be established when these are large, the communication speed becomes slower.
•SJW1, 2: These are the bits for setting the range of bit synchronizatio n. SJW is the abbreviation for
reSynchroni zation Jump Width.
If setting is :
BTR0 = “01000001”SJWB = “0”, SJWA = “1”, BRP5-0 = “000001”
BTR1 = “00000001”TSEG2 = “000”, TSEG1 = “0001”
then the bit timing is as follows:
Figure 2-26 Resynchronization outside the period of SJW
2 – 26
SJW2
Sampling Point
Page 40
MSM9225B User’s Manual
Chapter 2 Register Descriptions
2.4.6 Communication Input/Output Control Register (TIOC: 2Fhex)
This register sets the input/output mode and output driver format of output pins Tx0 and Tx1.
Writing to the TIOC bit is enabled when the INIT bit of the CAN control register (CANC: 0Ehex) is “1”.
The bit configuration is as follows:
MSB 0CTP1 0CTN1
Initial
value:
00000000
0CTP1 0CTN1
These bits specify
the output driver
format of the Tx1 pin.
See Table 2-10 for
details.
0CPOL1 0CTP0 0CTN0 0CPOL0 0CMD1 0CMD0
0CMD1 0CMD0
00
01
10Single-phase mode
11Clock output mode
0CPOL1 0CTP0 0CTN0 0CPOL0
These bits specify
the output driver
format of the Tx0 pin.
See Table 2-10 for
details.
LSBTIOC (2Fhex), R/W: R/W
Output mode of Tx0, Tx1 Input mode of Rx0, Rx1
Disabled
Differential input mode
Differential input mode
Rx0
+
–
Rx1
Figure 2-27 Communication Input/Output Control Register (TIOC)
These bits are used to set the output mode of output pins Tx0 and Tx1 and the input mode of input pins
Rx0 and Rx1.
Table 2-9 shows the relationship between the bit content and input/output mode.
At reset, OCMD1 to OCMD0 are set to “00”.
Table 2-9 Input/output Mode Setting
OCMD1 OCMD0Output mode of Tx0 and Tx1Input mode of Rx0, Rx1
00
01
[Disabled]
[Single-phase mode]
Same bit string data is output from both Tx0 and Tx1.
Output example
[differential input mode]
10
11
Data
Tx0
Tx1
[Clock output mode]
Bit string data is output from Tx0.
Synchronization clock is output from Tx1.
Output example
Data
Tx0
Tx1
101010
101010
Rx0
+
–
Rx1
2 – 28
Page 42
MSM9225B User’s Manual
Chapter 2 Register Descriptions
(2) Output d r iver format setting: OCPOL, OCTN, OCTP
OCPOL is used to set the polarity of output.
OCTN is used to set the open drain mode of the Nch transistor of the output driver.
OCTP is used to set the open drain mode of the Pch transistor of the output driver.
Figure 2-26 shows the circuit configuration of the output driver, and Table 2-10 the relationship between
bit content and output driver format.
V
DD
P
ch
Output data
Output control
circuit
N
ch
GND
V
DD
Tx0
Synchronization
clock
Figure 2-28 Circuit Configuration of Output Driver
2.4.7 Group Message Register (GMR0: 3Ehex, GMR1: 3Fhex)
These are registers to set the group message function.
Group Message Function
If the group message function is used, a part of an identifier can be masked. This can increase the
number of receivable identifiers.
To use the group message function, set the message box number of the target message box to set the
group message function in the GMR register. Then set the bits to be masked in the GMSK register.
If a received message corresponds to both a message box for which the group message function is
B
specified and a message box for which that is not specified, the message will be received in the
message box for which the group message functio n is not specified.
If the identifier of received message fits with the identifier of both group messages, the received
message will be written to the message box whose identifier (unmasked identifier set in the
identifier field) has the high priority.
The group message function can be set for two message boxes.
The group message function is valid when the EGM0/EGM1 bit is “1”.
Using GMR03 to GMR00 and GMR13 to GMR10, set the message box numbers of the message boxes for
which the group message function is to be set.
The numbers of the message boxes for which the group message function is to be set must be specified in the
descending order of box numbers in the range of message box numbers that correspond to the message box
count predetermined by the message box count setting register (NMES: 1Ehex).
If any message box numbers outside that range are specified, all bits in GMR0 and GMR1 are set to “0”.
At reset, all bits are set to “0”. (See Figure 2-31.)
The bit configuration is as follows:
MSB
Initial
value:
MSB
Initial
value:
EGM0
00000000
EGM1
00000000
Not
used
Not
used
Not
used
Not
used
Not
GMR03 GMR02 GMR01 GMR00
used
Not
GMR13 GMR12 GMR11 GMR10
used
Write a “0” to the unused bits.
Figure 2-29 Group Message Register (GMR0, GMR1)
LSBGMR0 (3Ehex), R/W: R/W
LSBGMR1 (3Fhex), R/W: R/W
2 – 30
Page 44
MSM9225B User’s Manual
Chapter 2 Register Descriptions
2.4.8 Group Message Mask Register (GMSK)
These are registers to mask the identifier of the message box specified by the group message registers GMR0
and GMR1.
Using MnID28 to MnID0 (n = 0, 1) , set the bits to mask the identifier. Setting “1” masks the bit, and setting
“0” does not mask the bit.
29 bits M0ID28 to M0ID0 and M1ID28 to M1ID0 are used for the extended format setting.
11 bits M0ID28 to M0ID18 and M1ID28 to M1ID18 are used for the standard format setting.
At reset, all bits are set to “0”.
The bit configuration is as follows:
When setting the Group Message (GM) function in the message box that selects the extended format as a
frame format, specify the message box numbers consecutively, beginning with the message box with the
largest message box number.
Figure 2-31 (a) shows an example of how to set the GM function in two message boxes when 16
message boxes are used. First, set NMES0 to NMES3 of the message box count setting register
(NMES: 1Ehex) to “1111”. Next procedure is to set the GM function in the message boxes F and E.
To do so, set GMR03 to GMR00 of the GMR0 (group message register) and GMR13 to GMR10 of the
GMR1 to “1111” (FH) (message box number) and “1110” (EH) (message box number), respectively.
In this case, it is also possible to set GMR03 to GMR00 to “E” (message box number) and GMR13 to
GMR10 to “F” (message box number).
Figure 2-31 (b) shows an example of how to set the GM function when 6 message boxes are used.
Specify the number
of message boxes
to be used using
NMES0 to NMES3
of NMES (1 Ehex).
NMES3 to NMES0:
“1111”
NMES3 - NMES0:
“0101”
Message box
number
0
1
2
3
4
5
6
7
8
9
A
B
C
D
EGM1← Set the GM function (GMR1)
FGM0← Set the GM function (GMR0)
(a) When 16 message boxes are used
Message box
number
00
11
22
33
44GM0 or GM1
5GM0 or GM15GM1 or GM0
(b) When 6 message boxes are used
Message box
To set the GM function, specify the
message box numbers consecutively,
beginning with the largest message box
number.
GMR0 (3Ehex)
EGM0: “1”, GMR03 to GMR00: “1111”
GMR1 (3Fhex)
EGM1: “1”, GMR13 to GMR10: “1110”
Message box
Message box
number
Message box
Figure 2-31 Example of how to set the GM function
2 – 32
Page 46
2.4.9 Standby Control Register (STBY: 8Ehex)
This register is used for setting the stop mode and the sleep mode.
A “0” is read after the stop or sleep mode is terminated.
The bit configuration is as follows:
MSM9225B User’s Manual
Chapter 2 Register Descriptions
MSBNot
used
Initial
value:
Not
used
00000000
Note:A “0” is read out after the sleep mode or the stop mode is terminated.
Not
used
Not
used
Not
used
Not
used
SLEEP STOP
LSBSTBY (8Ehex), R/W: R/W
0Normal operation
1Set stop mode
0Normal operation
1Set sleep mode
Unused bit.
Write a “0”.
Figure 2-32 Standby Control Register (STBY)
(1) Stop mode: STOP
If STOP is set to “1”, the MSM9225B wi ll enter the stop mode when the CAN bus is idle.
In stop mode, the contents of the message memory and control registers are held but the oscillator and
all circuits stop to save power consumption. Access to/from external units is therefore disabled.
Stop mode is terminated by a reset signal input from the RESET pin or a “L” level input to the CS pin.
At reset, STOP is set to “0”.
(2) Sleep mode: SLEEP
If SLEEP is set to “1”, the MSM9225B will enter the sleep mode when the CAN bus is idle.
In sleep mode, the contents of the message memory and control registers are held and the differential
input of Rx0 and Rx1 operates, but the oscillator and other circuits stop operation. Access to/from
external units is therefore disabled.
Sleep mode is terminated by a reset signal input from the RESET pin or a “L” level input to the CS pin,
or by the differential input of Rx0 and Rx1.
When both stop mode and sleep mode are set at the same time, the MSM9225B enters stop mode.
At reset, SLEEP is set to “0”.
This is a register to control bus off release and error counter operation.
The bit configuration is shown below.
At reset, this register is set to “0000 0000”.
MSBNot
used
Initial
value:
Not
used
0000000 0
Not
used
RSTEC
Not
used
Not
used
Not
used
COMPAT
LSB CANC2 (8Fhex), R/W: R/W
Just as in the MSM9225, a bus off
state will be released if 11
0
consecutive “recessive” bits are
received 128 times.
If the INIT bit of the CANC register
1
(0Ehex) is set to “0” from “1”, the bu s
off release operation is started.
Unused bit.
Write a “0”.
0Error counter value is not reset.
1Error counter value is reset.
Unused bit.
Write a “0”.
Figure 2-33 CAN Control Register 2 (CANC2)
(1) Bus off release start timing: COMPAT
This bit specifies bus off release start operation.
When this bit is “0”, the bus off state will be released if 11 consecutive “recessive” bits have been
received 128 times since the time immediately after the bus off state was entered. T his is the same
operation as the MSM9225.
When this bit is “1”, the bus off state will be released if 11 consecutive “recessive” bits have been
received 128 times since the point of time that the INIT bit of the CAN control register (CANC: 0Ehex)
was set to “1”, then set to “0”.
(2) Error counter reset: RSTEC
This bit specifies whether to reset the error counters (both transmit error counter and receive error
counter).
Setting this bit to “0” does not reset the error counters.
The error counters will be reset if the RSTEC bit is set to “1” when the COMPAT bit is “1” and the INIT
bit of CANC is “1”. Set the RSTEC bit to “0” after setting it to “1”.
When the MSM9225B is in the bus off state, this operation is invalid. (Even if the above operation is
done, the error counters are not cleared and the bus off state also is not released.)
2 – 34
Page 48
Chapter 2 Register Descriptions
2.4.11 Communication Message Box Number Register (TMN: 9Ehex)
The message box number when a message is transmitted/received is stored in this register.
The bit configuration is as follows:
MSM9225B User’s Manual
MSBNot
used
Initial
Undefined Undefined Undefined Undefined
value:
Not
used
Figure 2-34 Communication Message Box Number Register (TMN)
(1) Communication message box number: TRSN3 to TRSN0
The message box number when a message is transmitted/received is stored.
When transmission completes, the transmitted message box number is stored. When receiving
completes, the received message box number is stored. And when an error occurs, the message box
number of the message box being transmitted/received at that time is stored.
This is a read-only register and is set to “0000” at reset.
Not
used
Not
TRSN3 TRSN2 TRSN1 TRSN0
used
0000
TRSN3 TRSN2 TRSN1 TRSN0Message box number
00000
00011
•
•
1110E
1111F
•
•
•
•
LSBTMN (9Ehex), R/W: R
•
•
Unused bit.
When it is read, the value is undefined.
This is a register to indicate the error status of the MSM9225B.
Bit 6 to bit 4 are flags for the transmitter and bit 1 and bit 0 are for the receiver, and this register is read-only.
The bit configuration is shown below.
0TEC < 128
1TEC ≥ 128, transmit error passive state
0TEC < 256
1TEC ≥ 256, bus off state
Unused bit.
Figure 2-35 CAN Status Register (CANS)
(1) Receive Error Warning: REW
When the Receive Error Counter (REC) ≥ 96, REW becomes “1”. If REW = “1”, it is probable that the
bus has been damaged. Testing the bus for this condition is recommended.
At reset or when REC < 96, REW becomes “0”.
(2) Receive Error Passive: REP
When the Receive Error Counter (REC) ≥ 128, REP becomes “1” (error passive).
At reset or when REC < 128, REP becomes “0” (error active).
(3) Transmit Error Warning: TEW
When the Transmit Error Counter (TEC) ≥ 96, TEW becomes “1”.
If TEW = “1”, it is probable that the bus has been damaged. Testing the bus for this condition is
recommended.
At reset or when TEC < 96, TEW becomes “0”.
(4) Transmit Error Passive: TEP
When the Transmit Error Counter (TEC) ≥ 128, TEP becomes “1” (error passive).
At reset or when TEC < 128, TEP becomes “0” (error active).
(5) Bus Off: BOFF
This flag indicates the CAN bus status.
When the Transmit Error Counter (TEC) ≥ 256, BOFF becomes “1” and the CAN bus is in the bus off
state.
At reset or when TEC < 256, BOFF becomes “0”.
2 – 36
Page 50
Chapter 2 Register Descriptions
2.4.13 Transmit Error Counter (TEC: AEhex)
TEC is a register to indicate the Transmit Error Counter value. This register is read-only.
At reset or when in the bus off state, TEC is set to “0000 0000”.
The bit configuration is shown below.
MSM9225B User’s Manual
MSB
Initial
value:
TEC7TEC6TEC5TEC4TEC3TEC2TEC1TEC0
00000000
Figure 2-36 Transmit Error Counter (TEC)
Figure 2-37 shows the relation between the Transmit Error Counter and the bus off flag (BOFF).
Bit 8 of the transmit error counter, which consists of 9 bits, indicates the BOFF value of the CAN status
register (CANS: 9Fhex); bit 7 indicates the TEP value of CANS.
Transmit Error
Counter
BOFF
1
Bus off state
CANS (9Fhex): bit 6 = BOFF, bit 5 = TEP
Figure 2-37 Relation between the Transmit Error Counter and the Bus OFF flag
2.4.14 Receive Error Counter (REC: AFhex)
LSBTEC (AEhex), R/W: R
TEC (AEhex)
6
7
543210
0
Error active state
1
Error passive state
MSB
Initial
value:
REC is a register to indicate the Receive Error Counter value. This register is read-only.
At reset or when in the bus off state, REC is set to “0000 0000”.
Bit 7 of the Receive Error Counter indicates the value of REP bit of the CAN status register (CANS: 9Fhex).
The bit configuration is shown below.
This is a register to indicate the error contents for when an error occurs.
If an error occurs, the corresponding flag is set to “1”. It is set to “0” when “0” is written to it from the
microcontroller.
Once a flag of this register is set to “1”, it will not be reset to “0” unless “0” is written to it. Therefore, when
a corresponding error flag is set to “1”, and after that if another error occurs when “0” is not written from the
microcontroller, it results in two error flags, the previous one and the current one, being set to “1”.
The bit configuration is shown below.
Not
MSBBOF
Initial
value:
used
00000000
Not
used
FEFCRC ACK STUF BITE LSBCANS2 (BEhex), R/W: R/W
0Bit error does not occur
1Bit error occurs
0Stuff error does not occur
1Stuff error occurs
0Acknowledgment error does not occur
1Acknowledgment error occurs
0CRC error does not occur
1CRC error occurs
0Form error does not occur
1Form error occurs
Unused bit.
Write a “0”.
0Bus off does not occur
Bus off occurs
Operation varies depending on the
value of the COMPAT bit of CANC2
(8Fhex):
COMPAT = 0: Holds “1” till “0” is
1
COMPAT = 1: Becomes “0” if “0” is
Figure 2-39 CAN Status Register 2 (CANS2)
written by the
microcontroller.
written by the
microcontroller or the
bus off state is
released.
(1) Bit error flag: BITE
This bit becomes “1” when a bit error occurs.
At reset or after release of the bus off state, this bit becomes “0”.
(2) Stuff error flag: STUF
This bit becomes “1” when a stuff error occurs.
At reset or after release of the bus off state, this bit becomes “0”.
2 – 38
Page 52
MSM9225B User’s Manual
Chapter 2 Register Descriptions
(3) Acknowledgment error flag: ACK
This bit becomes “1” when an acknowledgment error occurs.
At reset or after release of the bus off state, this bit becomes “0”.
(4) CRC error flag: CRC
This bit becomes “1” when a CRC error occurs.
At reset or after release of the bus off state, this bit becomes “0”.
(5) Form error flag: FEF
This bit becomes “1” when a form error occurs.
At reset or after release of the bus off state, this bit becomes “0”.
(6) Bus off flag: BOF
This bit becomes “1” when a bus off error occurs.
It is set to “0” when “0” is written from the microcontroller. Also, when the COMP AT bit of the CAN
control register 2 (CANC2: 8Fhex) is “1”, BOF is automatically set to “0” if the bus off state is released
(that is, if 11 consecutive “recessive” bits are received).
A bus off flag (BOFF: bit 6) is provided in the CAN status register (CANS: 9Fhex). This flag is
assigned to bit 8 of the transmit error counter. Therefore, when the transmit error counter is set to
“0_0000_0000” because of bus off release, BOFF is also set to “0”. For this reason, if the
microcontroller does not access the CANS register during the period from the time the bus off state is
entered to the time it is released, the microcontroller cannot detect whether the CAN controller has
entered a bus off state.
In the case of BOF, the CANS2 bus off flag, it holds “1” until “0” is written to it from the
microcontroller (when COMPAT = “0”) or the bus off release operation does not start before the
initialization bit INIT of the CAN control register (CANC: 0Ehex) is manipulated. Therefore, the
microcontroller can detect whether the CAN controller is (or was) in the bus off state.
At reset, BOF is set to “0”.
B
2.4.16 Bus Off Release Counter (BOCO: BFhex)
BOCO is a read-only register for checking the bus off release.
This counter is incremented by 1 every time 11 consecutive “recessive” bits are detected. If the counter has
been incremented up to a maximum of 128, the bus off state will be released.
If any change is found in the value of this register after the bus off state is entered, it can be confirmed that
the CAN bus is not fixed as “dominant” due to some effect.
At reset or after the bus off state is released, BOCO is set to “0”.
Figure 3-2 shows the transmit procedure.
* See Appendix C “Transmission Failure of MSM9225B” for transmission operation.
Start transmit setting
Set TIRS bit of CANC register
(0Ehex) to 0
Set MMA bit of the message
control register (x0hex) to 1
Read MMA bit
MMA = 1?
YES
Write message data to
message box
Set message control
register’s MMA = 0 and TRQ = 1
Read MMA bit
MMA = 0?
YES
Since the MMA bit cannot be set to 1 while
message boxes are being accessed from
the CAN side, read and verify its value.
NO
Since the MMA bit cannot be set to 0 while
message boxes are being accessed from
the CAN side, read and verify its value.
NO
All transmit
message box settings
complete?
YES
Set TIRS bit of CANC register
(0Ehex) to 1
Transmit setting complete
Transmission operation
Figure 3-2 Transmit Flowchart
NO
3 – 2
Page 56
3.1.3 Receive Proc ed ur e
Figure 3-3 shows the receive procedure.
Receive procedure
CANI
register’s (0Fhex)
IRF = 1?
Chapter 3 Operational Description
(MSM9225B)
Interrupt signal is generated when
reception is complete
INTpin
INT
pin H to L
Verify that the interrupt has been caused
NO
by the reception completion.
MSM9225B User’s Manual
YES
Set IRF bit of CANI register
(0Fhex) to 0
Verify received message box
number with TMN register (9Ehex)
Set RCS bit of message
control register (x0hex) to 0
Read receive data from
message box
Message
control register’s
RCS = 0?
YES
Processing of other interrupt causes
Check whether new receive data has
NO
been written to the same message box
while data was being read.
NO
CANC register’s (0Ehex)
CANA = 0?
YES
Receive complete
Figure 3-3 Receive Flowchart
Check whether receive data has been written
to another message box while data was being read.
This step may be omitted and evaluation performed
based on the interrupt signal.
The procedure to rewrite the Identifier (ID) and Data Length Code (DLC) during operation, excluding the
time that initial settings are made for the message boxes, is indicated belo w. T he number of message boxes
set in the NMES register at the initial setting is the number of (valid) message boxes that can be rewritten.
Start rewrite
Set MMA bit of message
control register (x0hex) to 1
Read MMA bit
MMA = 1?
YES
Rewrite
FRM, DLC3-DLC0, ID28-ID0
Set MMA bit of message
control register to 0
Read MMA bit
MMA = 0?
Since the MMA bit cannot be set to 1 while
message boxes are being accessed from
the CAN side, read and verify its value.
NO
Since the MMA bit cannot be set to 0 while
message boxes are being accessed from
the CAN side, read and verify its value.
NO
YES
All message box
settings complete?
YES
Rewrite complete
Figure 3-4 Message Box Rewrite Flowchart
NO
3 – 4
Page 58
Chapter 3 Operational Description
3.1.5 Remote Frame Operation
The following two methods are available for transmission after remote frame reception.
(1) Auto matic response: automatically transmit preset message data in message box
(2) Manual resp onse: set message data and then transmit
3.1.5.1Automatic Response
After remote frame reception, this method automatically transmits preset message data in message box.
Table 3-1 lists the settings of the message control register.
Table 3-1 Message Control Register Settings for Automatic Response
BitSymbolValueComments
Bit 5TRQ0When reception is complete, TRQ bit changes from 0 to 1.
Message
control register
(x0hex)
Figure 3-5 is the operation flowchart.
Bit 3EIR0/1To enable receive interrupts, set this bit to “1”.
Bit 2EIT1Set interrupt to verify the end of transmission.
Bit 1FRM0Specify remote frame as the receive frame type.
Bit 0ARES1Set automatic response.
Since the MMA bit cannot be set to 1 while
message boxes are being accessed from
the CAN side, read and verify its value.
Since the MMA bit cannot be set to 0 while
message boxes are being accessed from
the CAN side, read and verify its value.
Remote frame received?
YES
Data frame transmission
Transmission completion generates
interrupt
INT
pin H to L
INTpin
NO
Remote
transmission
verification
Set RSC bit of message
Remote transmission complete
CANC
register’s (0Fhex)
ITF is 1?
YES
Set ITF bit to 0
control register to 0
NO
Processing of other interrupt causes
Figure 3-5 Flowchart of Automatic Response after Remote Frame Reception
3 – 6
Page 60
3.1.5.2Manual Response
In this method, after remote frame reception, the transmit data is set and then transmission begins.
Table 3-2 lists the settings of the message control register.
* See Appendix C “Transmission Failure of MSM9225B” for transmission operation.
Table 3-2 Message Control Register Settings for Manual Response
BitSymbolValueComments
Bit 5TRQ0Set to receive message box.
Message
control register
(x0hex)
Bit 3EIR1Set interrupt to verify (remote frame) reception.
Bit 2EIT1Set interrupt to verify the end of transmission.
Bit 1FRM0Specify remote frame as the receive frame type.
Bit 0ARES0Specify that automatic response is disabled.
Figure 3-6 is the operation flow chart.
The basic operation is a combination of receive and transmit procedures.
Since the MMA bit cannot be set to 1 while
message boxes are being accessed from
the CAN side, read and verify its value.
interrupt
NT
in
INT
pin H to L
NO
Remote
transmission
Set MMA = 0 and TRQ = 1
(message control register bits)
Read MMA bit
MMA = 0?
YES
Set TIRS bit of CANC register
(0Ehex) to 1
Verify transmission is complete
Manual response complete
NO
Since the MMA bit cannot be set to 0 while
message boxes are being accessed from
the CAN side, read and verify its value.
Data frame transmission
Transmission completion generates
interrupt
NTpin
INT
pin H to L
Figure 3-6 Manual Response Operation Flowchart
3 – 8
Page 62
Chapter 4
Microcontroller Interface
Page 63
MSM9225B User’s Manual
Chapter 4 Microcontroller Interface
Chapter 4Microcontroller Interface
There are two methods of interfacing to the microcontroller.
(1) Synchronous serial interface (serial mode)
(2) Parallel bus interface (parallel mode)
Each interface is selected with the Mode1 and Mode0 pins.
Table 4-1 shows the relation between Mode1 and Mode0 pin values and interface selection.
Table 4-1 Interface Setting
Mode1Mode0Interface
00No address latch signal
01
10
11Serial mode
4.1Serial Interface
Figure 4-1 shows the transfer timing.
Address/data transfers begin when the CS pin is at a “L” level and end when it changes to a “H” level. B ecause
the MSM9225B has an address increment function, the basic transfer consists of “ transfer start address +
multiple data.” Therefore, to access a nonconsecutive address, the CS must be first pulled to a “H” level, and
then the address set.
Perform address/data transfers LSB first, in 8-bit units. During a transfer, an interval is necessary between
address and data and between consecutive data transfers. (Refer to Chapter 5, “Electrical Characteristics”, for
interval values.) Note that the SWAIT signal is only generated during the interval between address and data
transfers.
Parallel mode
Separate
buses
Multiplexed buses
With address latch signal
(1) Data write
Data write operations are performed with the following procedure.
After setting the CS pin and PRD/SRW pin to “L” levels, input an address to the SDI pin. Synchro nized
to the rising edge of synchronous clock SCLK, the MSM9225B captures the address in an internal register.
When 8 SCLK clocks are received, the MSM9225B loads the address into the internal address counter and
waits for data reception.
Next, input data to the SDI pin. An internal register captures data in a similar manner to the address
capture, at the rising edge of SCLK. When 8 bits of data have been captured, the MSM9225B writes the
data to the message memory or control register specified by the address that was received previously, and
then increments the address counter by 1. If data is to be written to consecutive addresses, continue the
data transfer. After all data has been transferred, set the CS pin to a “H” level.
(2) Data read
Data read operations are performed with the following procedure.
After setting the CS pin to a “L” level and the PRD/SRW pin to a “H” level, input an address to the SDI pin
in the same manner as for the data write operation. When 8 SCLK clocks are received, the MSM9225B
loads the address into the internal address counter, reads data from the message memory or control register
specified by the address, latches data into a shift register for data output and increments the address counter.
Then, when SCLK is input, latched data is output fro m the SDO pin synchronized to the falling edge of
SCLK. At this time, the contents of the data input from the SDI pin does not matter. If there exists
remaining data to be read, input another 8 SCLK clocks. After all the data at consecutive addresses has
been read, set the CS pin to a “H” level.
If the count value of the lower 4 bits of an address overflows (exceeds xFh), the address increment function
will reset the count value of the lower 4 bits to 0 without changing the upper 4 bits of the address, and will
continue counting.
4 – 1
Page 64
MSM9225B User’s Manual
A0
A1
A2
A3
A4
A5
A6
A7
D0
D1
D2
D3
D4
D5
D6
D7
D0
D1
D2
D3
D4
D5
D6
D7
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
SDI
SCLK
CS
SDO
SR
W
SWAIT
Address reception
Internal
processing
interval
Data reception
Internal processing
interval
Data reception
(Data write &
address + 1)
Internal processing
interval
(Data write &
address + 1)
A0
A1
A2
A3
A4
A5
A6
A7
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
SDI
SCLK
CS
SR
W
SWAIT
Address reception
Data transmission
Internal processing
interval
Data transmission
(Data read &
address +1 )
Internal processing
interval
(Data read &
address + 1)
**
*
*
*
*
*
*
*
D0
D1
D2
D3
D4
D5
D6
D7
D0
D1
D2
D3
D4
D5
D6
D7SDO
Internal
processing
interval
(Data read &
address + 1)
*
: Don’t Care
(1) Date write timing
(2) Date read timing
*
W
Chapter 4 Microcontroller Interface
Figure 4-1 Serial Interface Transfer Timing
CS
SR
4 – 2
CS
W
SR
Page 65
4.2Parallel Interface
The following three types of parallel interfaces are available.
(1) Address/data separate bus type, no address latch signal
(2) Address/data separate bus type, with address latch signal
(3) Multiplexed bus type
For transfer timings, refer to Section 5.2, “Timing Diagrams”.
MSM9225B User’s Manual
Chapter 4 Microcontroller Interface
4 – 3
Page 66
MSM9225B User’s Manual
r
I
CS
PRD
W
PWR
PRDY
A
A
RESET
XT
CSRDWR
WAIT
RESET
Chapter 4 Microcontroller Interface
4.3MSM9225B Connection Examples
The following examples are for recommendation only. Oki does not guarantee any operation on customer’s
systems.
4.3.1 Microcontroller Interface
4.3.1.1Address/Data Separate Bus (No Address Latch Signal)
+5 V
Microcontrolle
D7-0
INT
A7-0
Ω
10 k
4-1, 44-41
38-31
11
10
27
9
26
16
5
7
8
25
NT
PALE
/SR
/SWAIT
7-0
D7-0/D7-0
SDO
SDI
SCLK
MSM9225B
XT
Mode1
Mode0
CSTCV16M0X11Q
*
CSTCV16M0X51Q
13
14
10 kΩ
30
29
(5 pF)
If the clock is supplied
externally, input the
clock to the XT pin and
leave the XT pin open
in the same manner as
shown in Figure 4-5.
Reset signal
* Ceramic resonator of Murata MFG. (CSTCV16M0X11Q) is recommended. (125 kbps)
Figure 4-2 Address/Data Separate Bus (No Address Latch Signal)
4 – 4
Page 67
4.3.1.2Address/Data Separate Bus (With Address Latch Signal)
922
I
CS
PRD
W
PWR
PRDY
A
A
XT
CSRDWR
WAIT
RESET
RESET
922
I
CS
PRD
W
PWR
PRDY
A
A
XT
I
CSRDWR
WAIT
A
RESET
A
RESET
+5 V
Microcontroller
INT
ALE
A7-0
D7-0
Ω
10 k
4-1, 44-41
38-31
MSM
11
NT
10
27
PALE
9
/SR
26
16
5
7
8
25
/SWAIT
7-0
D7-0/D7-0
SDO
SDI
SCLKMode1
5B
Mode0
MSM9225B User’s Manual
Chapter 4 Microcontroller Interface
CSTCV16M0X11Q
*
CSTCV16M0X51Q
13
XT
14
10 kΩ
30
29
(5 pF)
+5 V
Reset signal
* Ceramic resonator of Murata MFG. (CSTCV16M0X11Q) is recommended. (125 kbps)
Figure 4-3 Address/Data Separate Bus (With Address Latch Signal)
4.3.1.3Address/Data Multiplexed Bus
+5 V
Microcontroller
NT
LE
D7-0
Ω
10 k
4-1, 44-41
38-31
MSM
11
NT
10
27
PALE
9
/SR
26
16
5
7
8
25
/SWAIT
7-0
D7-0/D7-0
SDO
SDI
SCLKMode1
5B
XT
Mode0
CSTCV16M0X11Q
*
CSTCV16M0X51Q
13
14
10 kΩ
30
29
(5 pF)
+5 V
Reset signal
* Ceramic resonator of Murata MFG. (CSTCV16M0X11Q) is recommended. (125 kbps)
Figure 4-4 Address/Data Multiplexed Bus
4 – 5
Page 68
MSM9225B User’s Manual
A
A
XT
Chapter 4 Microcontroller Interface
4.3.1.4Serial Interface
Microcontroller
INT
CS
R/W
WAIT
SDIN
SDOUT
SCLK
RESET
Ω
10 k
4-1, 44-41
+5 V
38-31
MSM9225B
11
INT
10
CS
27
PALE
9
PRD/SRW
26
PWR
16
PRDY/SWAIT
7-0
D7-0/D7-0
5
SDO
7
SDI
8
SCLKMode1
25
RESET
XT
Mode0
If the built-in oscillator circuit is
used, connect an external oscillator
in the same manner as shown in
Figure 4-2.
13
14
Open
+5 V
30
29
Reset signal
CLK
Figure 4-5 Serial Interface
4 – 6
Page 69
4.3.2 CAN Bus Interfac e
A
4.3.2.1Electrically Isolated from Bus Transceiver (PCA82C250)
MSM9225B User’s Manual
Chapter 4 Microcontroller Interface
MSM9225B
R×1
R×0
T×1
T×0
Figure 4-6 Electrically Isolated from Bus Transceiver (PCA82C250)
19
18
23
22
Open
Ω
6.2 k
Ω
5.1 k
6N137
28
NODE
O.P.CATH
7
5
3
2
1
4
6
Open
Open
Open
Open
1
4
6
8
7
5
3
6N137
V
CC
E
GND
+5 V
PCA82C250
V
GND
4
RxD
CANH
CANL
Vref
1
TxD
CC
Rs
3
2
7
CAN BUS LINE
6
5
Open
8
4.3.2.2 Directly Connected to Bus Transceiver (PCA82C250)
MSM9225B
19
R×1
18
R×0
23
T×1
Open
22
T×0
From microcontroller (port pin)
(Normal “L” Output)
PCA82C250
5
4
1
8
Vref
RxD
TxD
Rs
GND
CANH
CANL
3
V
CC
2
7
6
CAN BUS LINE
Figure 4-7 Directly Connected to Bus Transceiver (PCA82C250)
4 – 7
Page 70
MSM9225B User’s Manual
STB
T
Chapter 4 Microcontroller Interface
4.3.2.3Monitoring the CAN Bus
Battery
MSM9225B
Microcontroller
+5 V
10
13
19
R×1
1
R×0
T×1
T×0
Port
Port
Port
18
23
Open
22
3
2
5
4
6
Figure 4-8 Monitoring the CAN Bus
14
V
BA
CC
GND
INH
PCA82C252
RxD
TxD
NERR
EN
7
WAKE
RTH
CANH
CANL
RTL
8
11
CAN BUS LINE
12
9
4 – 8
Page 71
Chapter 5
Electrical Characteristics
Page 72
Chapter 5Electrical Characteristics
5.1Electrical Characteristics
5.1.1 Absolute Maximum Ratings
ParameterSymbolConditionRatingUnit
Power Supply VoltageV
Input VoltageV
Output VoltageV
Power DissipationP
Operating TemperatureT
Storage TemperatureT
DD
I
O
D
OP
STG
5.1.2 Recommended Operating Conditions
ParameterSymbolConditionMin.Typ.Max.Unit
Power Supply VoltageV
Operating TemperatureT
Applies to all inputs—0.8V
Applies to all inputs—–0.3+0.2 V
XT325µA
Other inputs
XT–25–3µA
Other input
INT, PRDY/SWAITI
AD7-0/D7-0I
INT, PRDY/SWAITI
AD7-0/D7-0I
PRDY/SWAIT
AD7-0/D7-0
ParameterSymbolConditionMin.Max.Unit
ALE Address Setup Timet
ALE Address Hold Timet
PRD Output Data Delay Timet
PRD Output Data Hold Timet
ALE “H” Level Widtht
AS
AH
RDLY
RDH
WALEH
When PRDY is not
Max Access
Cycle
generated
When PRDY is
t
cyc
generated
Address Hold Time from PRDt
ALE Delay Time from PRDt
PRD “H” Level Widtht
PRDY “L” Delay Timet
PRDY “L” Level WidthtData Output Delay Time from PRDYt
PWR Hold Time from PRDYt
Input Data Setup Timet
Input Data Hold Timet
PRD Delay Timet
PWR Delay Timet
Address Hold Time from PWRt
ALE Delay Time from PWRt
PWR “H” Level Widtht
PWR “L” Level Widtht
CS Delay Time from PRDt
CS Delay Time from PWRt
RAH
HRA
WRDH
ARLDLY
WRDYL
ARDDLY
ARWDLY
WDS
WDH
RS
WS
WAH
HWA
WRH
WRL
HRC
HWC
The values with *1 indicate those when PRDY is not generated.
The values with *1 w hen PRDY is generated are defined by “Data Output D e lay T ime from PRDY” t
Note: The PRDY signal may be output depending on the internal state of the MSM9225B.
Figure 5-1 Read Access Timing
Write access timing
t
cyc
A7-0
t
WAH
AD7-0/
D7-0
t
WS
t
WRL
t
WDS
t
WDH
t
HWC
t
WRH
t
t
WRDYL
ARWDLY
/SWAIT
t
ARLDLY
Note: The PRDY signal may be output depending on the internal state of the MSM9225B.
Figure 5-2 Write Access Timing
5 – 5
Page 77
MSM9225B User’s Manual
CS
A
A
PRD
W
PRDY
CS
PWR
PRDY
Chapter 5 Electrical Characteristics
5.2.2 Separate Bus/Address Latch Mode
Read access timing
t
WALEH
t
t
HRC
HRA
PALE
7-0
t
AS
t
AH
t
cyc
don’t care
D7-0/
D7-0
/SR
/SWAIT
t
ARLDLY
t
RS
t
RDLY
t
ARDDLY
t
WRDYL
t
RDH
Note: The PRDY signal may be output depending on the internal state of the MSM9225B.
Figure 5-3 Read Access Timing
Write access timing
t
HWC
t
WRDH
t
PALE
A7-0
WALEH
t
AS
t
AH
t
cyc
don’t care
t
HWA
AD7-0/
D7-0
/SWAIT
t
WRL
WDS
t
ARWDLY
t
WS
t
t
WRDYL
t
ARLDLY
t
WDH
t
WRH
Note: The PRDY signal may be output depending on the internal state of the MSM9225B.
Figure 5-4 Write Access Timing
5 – 6
Page 78
5.2.3 Multiplexed Bus Mode
CS
PRD
W
PRDY
CS
PWR
PRDY
Read access timing
t
WALEH
PALE
AD7-0/
D7-0
/SR
MSM9225B User’s Manual
Chapter 5 Electrical Characteristics
t
HRC
t
HRA
t
AS
t
AH
t
RS
t
RDLY
t
WRDYL
t
ARDDLY
t
cyc
t
RDH
t
WRDH
/SWAIT
t
ARLDLY
Note: The PRDY signal may be output depending on the internal state of the MSM9225B.
Figure 5-5 Read Access Timing
Write access timing
t
HWC
t
PALE
AD7-0/
D7-0
WALEH
t
AS
t
AH
t
WS
t
WRL
t
WRDYL
t
t
WDS
t
ARWDLY
cyc
t
WDH
t
HWA
t
WRH
/SWAIT
t
ARLDLY
Note: The PRDY signal may be output depending on the internal state of the MSM9225B.
Figure 5-6 Write Access Timing
5 – 7
Page 79
MSM9225B User’s Manual
C
P
P
C
Chapter 5 Electrical Characteristics
5.2.4 Serial Mode
Read access timing
S
t
CS
SCLK
t
CP
t
CW
t
CW
t
t
DS
DH
t
t
WAIT
CH
SDI
SDO
t
CSODLY
A0A1A6A7
DMY0DMY1DMY6DMY7D0
t
RS
Don’t Care
t
PD
PRD/SRW
t
t
SRDLY
WRDY
PRDY/SWAIT
Note:The SWAIT signal will be output during the interval between address and data transfers.
Figure 5-7 Read Access Timing
Write access timing
S
t
SCLK
CS
t
CP
t
CW
t
CW
t
t
DS
DH
t
WAIT
t
CSZDLY
t
RH
t
CH
SDI
SDO
t
CSODLY
A0A1A6A7
*** **
t
RS
D0
t
CSZDLY
t
RH
RD/SRW
t
t
SRDLY
WRDY
RDY/SWAIT
Note:The SWAIT signal will be output during the interval between address and data transfers.
* : don’t care
Figure 5-8 Write Access Timing
5 – 8
Page 80
5.2.5 Other Timing
RESET
INT
t
WRSTL
t
WINTL
t
WRSTH
MSM9225B User’s Manual
Chapter 5 Electrical Characteristics
CLK
(XT)
t
clkcy
Figure 5-9 Other Timing
t
clkcy
5 – 9
Page 81
Appendixes
Page 82
Appendix APackage Dimensions
QFP44-P-910-0.80-2K
Mirror finish
MSM9225B User’s Manual
Appendixes
(Unit: mm)
Package materialEpoxy resin
Lead frame material42 alloy
Pin treatment
5
Notes for Mounting the Surface Mount Type Package
The surface mount type packages are very susceptible to heat in reflow mounting and humidity absorbed in storage.
Therefore, before you perform reflow mounting, contact Oki’s responsible sales person on the product name, package
name, pin number, package code and desired mounting conditions (reflow method, temperature and times).
The following is the memory map of the entire memory space of the MSM9225B.
The symbols ‘Mn’ (for example, M0MCR, M0MSG0, M0IDR2, etc., n = 0 to 15) correspond to the number of the
respective message box among the message boxes 0 to 15.
An asterisk (∗) in the address column indicates that there is a bit that is not present in that register.
A bit can be missing at address 00x5h only in the case of the extended format.
A dash “—” indicates that the memory space is not used in the case of the standard format.
An asterisk (∗) in the address column indicates that there is a bit that is not present in that register.
A bit can be missing at address 00x5h only in the case of the extended format.
A dash “—” indicates that the memory space is not used in the case of the standard format.
An asterisk (∗) in the address column indicates that there is a bit that is not present in that register.
A bit can be missing at address 00x5h only in the case of the extended format.
A dash “—” indicates that the memory space is not used in the case of the standard format.
An asterisk (∗) in the address column indicates that there is a bit that is not present in that register.
A bit can be missing at address 00x5h only in the case of the extended format.
A dash “—” indicates that the memory space is not used in the case of the standard format.
(*1) Upper 4 bits are undefined and lower 4 bits are set to “0000”. Represented as “XXXX0000[b]” in binary notation.
standardextendedstandardextended
NameAbbreviated name
number register
R/WAccessValue at reset [H]
TMNR8(*1)
An asterisk (∗) in the address column indicates that there is a bit that is not present in that register.
A bit can be missing at address 00x5h only in the case of the extended format.
A dash “—” indicates that the memory space is not used in the case of the standard format.
An asterisk (∗) in the address column indicates that there is a bit that is not present in that register.
A bit can be missing at address 00x5h only in the case of the extended format.
A dash “—” indicates that the memory space is not used in the case of the standard format.
An asterisk (∗) in the address column indicates that there is a bit that is not present in that register.
A bit can be missing at address 00x5h only in the case of the extended format.
A dash “—” indicates that the memory space is not used in the case of the standard format.
An asterisk (∗) in the address column indicates that there is a bit that is not present in that register.
A bit can be missing at address 00x5h only in the case of the extended format.
A dash “—” indicates that the memory space is not used in the case of the standard format.
standardextendedstandardextended
NameAbbreviated name
R/WAccessValue at reset [H]
A – 9
Page 91
MSM9225B User’s Manual
Appendixes
Appendix CMSM9225B User’s Manual Contents of Revision From 3rd
Version To 4th Ver s ion
2.2 Mes sage Memory
•
(4th Ver) “Note when reading Message Memory Related Register” was added.
2.4.1
•
(5) Transmission flag: TxF
(4th Ver) “TxF becomes “0” when transmission co mpletes” was deleted.
2.4.6
•
(4th Ver) “Two phase mode and Ex-NOR input mode” was deleted.
The same is as in Table 2-9.
2.4.10
•
(2) Error counter reset: RSTEC
(4th Ver) “When the MSM9225B is in the bus off state, this operation is invalid. (Even if the above operation is
done, the error counters are not cleared and the bus off state also is not released.)” was added.
4.3 MSM9225B Connection Examples
•
The recommended ceramic resonator was changed.
Chapter 5 Electrical Characteristics
•
5.1.4 Rx0, Rx1 Characteristics:
(4th Ver) “Ex-NOR mode” was deleted.
5.1.6 “AC Characteristics” was reviewed.
5.2Timing Diagrams
5.2.1 “Separate Bus Mode” was reviewed.
5.2.2 “Separate Bus/Address Latch Mode” was reviewed.
5.2.3 “Multiplexed Bus Mode” was reviewed.
3rd Version Appendix C “Transmission Failure of MSM9225B” was deleted.
•
A – 10
Page 92
MSM9225B
User’s Manual
Version 1.0:May 2000
Version 2.0: September 2000
Version 3.0:February 2001
Version 4.0:July 2001
2001 Oki Electric Industry Co., Ltd.
FEUL9225B-04
Loading...
+ 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.