The MSM9225 is a microcontroller peripheral LSI which conforms to the CAN protocol for
high-speed LANs in automobiles.
FEATURES
•Conforms to CAN protocol specification (Bosch Co., V.2.0 part b/Full CAN)
• Maximum 1 Mbps real-time communication control (programmable)
• Communication system:
Transmission line is bi-directional, two-wire serial communications
NRZ (Non-Return to Zero) system using bit stuff function
Multi-master system
Broadcast system
• Maximum 16 messages ¥ 8 bytes of message buffer
Number of messages can be extended by group message function (max: 2 groups)
• Priority control by identifier
Normally 2032 types, 2032 ¥ 218 types at extension
• 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
Interrupt is used for three outputs: transmission/receive/error
• Error control:
Bit error/stuff error/CRC error/form error/acknowledge error detection functions
Retransmission / error status monitoring function when error occurs
• Communication control by transmission request function
Chip select pin. When "L", PALE, PWR, PRD/SRW, SCLK and SDO pins are valid.
Address bus pins (when using separate buses). If used with a multiplexed bus or if
used in the serial mode, fix these pins at "H" or "L" levels.
Multiplexed bus: Address/data pins
Separate buses: Data pins
If used in the serial mode, fix these pins at "H" or "L" levels.
Write input pin during parallel mode. Data is captured when this pin is at a "L" level.
If used in the serial mode, fix this pin at a "H" or "L" level.
Parallel mode: Read signal pin.
When at a "L" level, data is output from the data pin.
Serial mode: Read/write signal pin.
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.
If the microcontroller's bus cycle is fast, a signal is output to extend the bus cycle
until the internal access is completed.
Internal access in progressAfter completion of access
Parallel mode
Serial mode
Interrupt request output pin.
When an interrupt request occurs, a "L" level is output.
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 oscillator. If external
clock is input, input clock via XT pin. The XT pin should be left open.
Receive input pin. Differential amplifier included.RX0, RX1I18, 19
Transmission output pin.TX0, TX1O22, 23
—
Internal logic power supply pin.V
Internal logic GND pin.GND—
Power supply pin for receive input differential amplifier.AV
—20
GND pin for receive input differential amplifier.AGND—17
5/73
¡ Semiconductor
MSM9225
FUNCTIONAL DESCRIPTION
Data Memory
Before starting communication, messages for communication and various control registers
must be set at the data memory.
Addresses X0hex to XDhex are the message memory, which stores control registers, identifiers
and the contents of each message.
In this address space, the higher 4 bits of an address corresponds to the number of messages,
and a maximum of 16 (0Xhex to FXhex) can be stored. Each message has an area to store a
maximum of 8 bytes of data memory, 1 byte of control register, and a maximum of 5 bytes of
an identifier.
This means that the data memory capacity for messages is: 16 messages ¥ (8 bytes for a message
+ 1 byte for a control register + 5 bytes for an identifier) = 224 bytes.
Addresses XEhex to XFhex are allocated to the control registers.
The configuration of data memory is as follows
The message memory stores messages to be transmitted/received.
For transmission, only messages stored in the message memory can be transmitted. A message
with the highest priority among messages requested for transmission is sent.
For receiving, only messages that have an identifier stored in the message memory can be
received. When a message is received normally, and its identifier matches with the identifier
stored in the message memory, data of the received message is written to the message area of
the corresponding message in the message memory.
The message memory can store a maximum of 16 messages. Set messages at the NMES register.
1. Inside message control register (X0hex)
This register performs various controls for a message.
Set this register for each message.
The bit configuration is as follows:
Address MSB
¥ 0h
76543210
LSB
ARES : Automatic transmission
FRM : Message format setting
EIT : Transmission completion interrupt enable
EIR : Receive completion interrupt enable
RCS : Receive status
TRQ : Transmission request
Not used
MMA : Message memory access enable
(1) Message memory access request/enable bit: MMA
This bit prevents contention between the microcontroller and CAN when accessing the
message memory.
When the microcontroller accesses the message memory, "1" is written to the MMA bit
regularly. The microcontroller confirms that the MMA bit is "1", and then accesses the
message memory. Write "0" to the MMA bit when the microcontroller accessing ends.
Operations by the MMA bit are shown in the following table.
At reset, the MMA bit is set to "0".
MMA
0
1
Microcontroller
Accesses from microcontroller
to message memory are disabled
Accesses from microcontroller
to message memory are enabled
Reception
Operate
Reading of received data
Stop
Rewriting of control area
Transmission
Operate
Stop
Rewriting of control area
Rewriting of transmission data
7/73
¡ Semiconductor
(2)Transmission request: TRQ
When a message is transmitted, the microcontroller writes "1" to this bit. When
transmission ends normally, CAN writes "0". This means that the TRQ bit is "1" during
transmission. Therefore, to request transmission, confirm that the TRQ bit is "0" first,
then write "1" to the TRQ bit. 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".
(3)Receive status: RCS
When receiving completes, the RCS bit becomes "1". Write "0" to the RCS bit before the
microcontroller calls up receive data. When receiving the remote frame, the RCS bit
becomes "1" just after the reception.
At reset, the RCS bit is set to "0".
(4)Receive completion interrupt enable: EIR
The microcontroller sets interrupt request signal generation disable/enable when
receiving completes.
The EIR bit is valid when the EINTR bit of the CANI register is “1”.
At reset, the EIR bit is set to "0".
MSM9225
(5)Transmission completion interrupt enable: EIT
The microcontroller sets interrupt request signal generation disable/enable when
transmission completes.
The EIT bit is valid when the EINTT bit of the CANI register is “1”.
At reset, the EIT bit is set to "0".
(6)Message format setting: FRM
The microcontroller sets the format of the message to be sent/received. A message in a
format other than the specified format cannot be sent/received.
For the relationship between setting and format, see the table below.
When a message specified to a group message is received, the content of the RTR bit is
written.
At reset, the FRM bit is set to "0".
FRMMessage TypeTransmission FormatReceive Format
0
1
Standard messageData frameRemote frame
Group messageTransmission disableData frame
Standard message
Group message
Remote frame
Transmission disable
Data frame
Remote frame
(7)Automatic transmission : ARES
If the data frame is automatically transmitted after remote frame reception, the ARES bit
should be set to "1".
At reset, the ARES bit is set to "0".
8/73
¡ Semiconductor
g
2. Identifier 0 (X1hex)
This register sets the data length code and a part of the identifier.
Set this register for each message.
The bit configuration is as follows:
MSM9225
Address MSB
¥ 1h
76543210
(1)Format setting: IDFM
The microcontroller sets the message format.
At reset, the IDFM bit is undefined.
This is control field data to set the number of bytes of a data field. 0 to 8 can be set.
At reset, these bits are undefined.
(3)Identifier: IDB28 to IDB26
These bits set the identifier field.
For standard format (IDFM = 0), the higher 3 bits of the 11 bits 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.
9/73
¡ Semiconductor
3. Identifier 1 (X2hex)
This register sets the identifier.
Set this register for each message.
The bit configuration is as follows:
MSM9225
Address MSB
¥ 2h
76543210
LSB
IDB18 :
IDB19 :
IDB20 :
IDB21 :
Identifier
IDB22 :
IDB23 :
IDB24 :
IDB25 :
(1)Identifier: IDB25 to IDB18
These bits set the lower 8 bits of the 11 bits of the identifier field.
For standard format (IDFM = 0), the lower 8 bits of the 11 bits 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.
4. Address: X3 to XDhex
For standard format (IDFM = 0), addresses X3 to XAhex become the transmission/receive
data storage area.
For extended format (IDFM = 1), addresses X3 to X5hex are used to set the identifier field, and
addresses X6 to XDhex become the transmission/receive data storage area.
For both, a maximum of 8 bytes of transmission/receive data can be stored, but the number
of transmittable/receivable bytes must have been set by data length code.
At reset, message content is undefined.
The relationship between address and identifier bits for extended format (IDFM = 1) is as
follows:
10/73
¡ Semiconductor
MSM9225
Adderss MSB
¥ 3h
Address MSB
¥ 4h
LSB
76543210
IDB10 :
IDB11 :
IDB12 :
IDB13 :
Identifier 2
IDB14 :
IDB15 :
IDB16 :
IDB17 :
LSB
76543210
Address MSB
¥ 5h
IDB2 :
IDB3 :
IDB4 :
IDB5 :
Identifier 3
IDB6 :
IDB7 :
IDB8 :
IDB9 :
LSB
76543210
Not used (Don't care)
Not used (Don't care)
Not used (Don't care)
Not used (Don't care)
Not used (Don't care)
Not used (Don't care)
IDB0 :
Identifier 4
IDB1 :
11/73
¡ Semiconductor
Control Register
These registers listed below control various operations of CAN.
MSM9225
AddressSymbol
0EHCANC
0FHCANI
1EHNMESNumber of message specification registers
1FHBTR0CAN bus timing register 0
2EHBTR1CAN bus timing register 1
2FHTIOCCommunication input/output control register
3EHGMR0Group message register 0
3FHGMR1Group message register 1
4EHGMSK00 Message mask register 00
4FHGMSK01Message mask register 01
5EHGMSK02 Message mask register 02
5FHGMSK03Message mask register 03
6EHGMSK10 Message mask register 10
6FHGMSK11Message mask register 11
7EHGMSK12 Message mask register 12
7FHGMSK13Message mask register 13
8EHSTBYStandby control register
8FHNot used (reserve area)
9EHTMNCommunication message number register
9FHCANSCAN status register
AEHTECTransmission error counter
AFHRECReceive error counter
BEH
BFH
CEH
CFH
DEH
DFH
EEH
EFH
FEH
FFH
CAN control register
CAN interrupt control register
Not used (reserve area)
Name
12/73
¡ Semiconductor
1. CAN control register (CANC: 0Ehex)
This register controls the operation of CAN.
The bit configuration is as follows:
MSM9225
Address MSB
0Eh
76543210
LSB
INIT : Initialize
TIRS : Transmission identifier retrieval
Not used
SYNC : Bit synchronization
CANA : CAN write flag
T x F : Transmission flag
R x F : Receive flag
Not used
(1)Initialize: INIT
This bit is used to initialize the communication control area. To start initialization, write
"1" to INIT, read INIT and confirm that INIT is "1", then initialize. To end initialization,
write "0" to INIT, read INIT, and confirm that INIT is "0". For both, initialization mode
is not set/cleared until the above procedure is executed.
If the INIT bit is set to "1" during the transmission or receive operation, the initialization
will start after the communication completes.
When the INIT bit is set to "1", the communication operation stops but the error counter
and data memory are held.
To initialize message memory, write the number of messages to be used to the number
of messages setting register, NMES, then write the inside message control register,
identifier 1, and identifier 2 sequentially from message 0 for all messages.
At reset, INIT is set to "1".
(2)Transmission identifier retrieval: TIRS
This bit is used to scan identifiers sequentially from message 0 to the last message of the
message memory, detecting priority of the message for which the transmission request
TRQ is "1" and starting to transmit the messages. TIRS will be set to "0" when there are
no transmission request messages after scanning or transmitting.
At reset, TIRS is set to "0".
(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".
13/73
¡ Semiconductor
p
(4)CAN write flag: CANA
This bit is used to indicate receive data write status to the message memory. CANA is
"1" while CAN is writing receive data to the message memory.
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. TxF becomes "0" when
transmission completes.
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. RxF becomes "0" when receiving
completes.
This is a read-only flag.
MSM9225
2. CAN interrupt register (CANI: 0Fhex)
This register controls CAN interrupts.
The bit configuration is as follows:
Address MSB
0Fh
76543210
(1)Transmission interrupt output enable: EINTT
This bit is used to output transmission interrupt signal INTT from interrupt pin INT
when transmission completes.
When EINTT is "0", a transmission interrupt signal is not output from the interrupt pin.
When EINTT is "1", a transmission interrupt signal is output from the interrupt pin.
At reset, EINTT is set to "0".
LSB
EINTT : Transmission interrupt output enable
EINTR : Receive interrupt output enable
EINTE : Error interrupt output enable
Not used
ITF : Transmission interrupt request flag
IRF : Receive interrupt request flag
IEF : Error interrupt request flag
MEINT : Master interru
t control enable
(2)Receive interrupt output enable: EINTR
This bit is used to output receive interrupt signal INTR from interrupt pin INT when
reception completes.
When EINTR is "0", a receive interrupt signal is not output from the interrupt pin.
When EINTR is "1", a receive interrupt signal is output from the interrupt pin.
At reset, EINTR is set to "0".
14/73
¡ Semiconductor
(3)Error interrupt output enable: EINTE
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".
(4)Transmission interrupt request flag: ITF
ITF becomes "1" when a transmission interrupt is generated. Only "0" can be written to
this bit.
At reset, ITF is set to "0".
(5)Receive interrupt request flag: IRF
IRF becomes "1" when a receive 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".
MSM9225
(7)Master interrupt control enable: MEINT
This bit is used to set enable/disable of communication interrupts.
The flowchart of interrupt control is shown below.
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
1
0
1
0
1
INT pin
0
1
EINTT
EINTR
EINTE
ITF
Interrupt factor
(transmission completion)
EIT (each message)
IRF
Interrupt factor
(reception completion)
EIR (each message)
IEF
Interrupt factor (An error occurs)
15/73
¡ Semiconductor
3. Number of messages specification register (NMES: 1Ehex)
This is a register to set the number of messages to be stored in the message memory.
A maximum of 16 messages can be set, with message numbers 0 to 15.
Writing to NMES is enabled when initialize bit INIT of the CAN control register (CANC:
OEhex) is "1".
At reset, NMES is set to "0000".
The bit configuration and relationship between message number and number of messages
are as follows:
MSM9225
Address MSB
1Eh
***
*
****
****
········
····· · · ·
****
****
: Don't Care
*
4. CAN bus timing register 0 (BTR0: 1Fhex)
This register sets the baud rate prescaler and synchronization jump width (SJW) used for bus
timing. Writing to the BTR0 bit is enabled, when the INIT bit of the CAN control register
(CANC: 0Ehex) is "1".
The bit configuration is as follows:
This is a 6-bit prescaler to set the BTL cycle time and SJW of the basic clock for
communication operation.
The relationship between the bit content and BTL is as follows:
At reset, BRP5 to BRP0 are set to "000000".
BRP5BRP3BRP2BRP1BRP0
BRP4
00000
00001
·····
·····
11110
1
0
0
·
·
1
11111
The BTL cycle time is given by the following operation.
5. CAN bus timing register 1 (BTR1: 2Ehex)
This register sets the sampling count, sampling point and transmit 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:
Address MSB
2Eh
76543210
LSB
(1)Time segment 1: TSEG13 to TSEG10
This is a 4-bit register to set the sampling point.
The relationship between bit content and TSEG1 is as follows:
At reset, TSEG13 to TSEG10 are set to "0000".
TSEG10 :
TSEG11 :
TSEG12 :
TSEG13 :
TSEG20 :
TSEG21 :
TSEG22 :
Not used :
Time
segment 1
Time
segment 2
TSEG13TSEG12TSEG11TSEG10TSEG1
0000
0001
····
····
1110
1111
1 ¥ BTL cycle
2 ¥ BTL cycle
·
·
15 ¥ BTL cycle
16 ¥ BTL cycle
(2)Time segment 2: TSEG22 to TSEG20
This is a 3-bit register to set the transmit point.
The relationship between the bit content and TSEG2 is as follows:
At reset, TSEG22 to TSEG20 are set to "000".
TSEG22TSEG21TSEG20TSEG2
000
001
···
···
110
111
1 ¥ BTL cycle
2 ¥ BTL cycle
·
·
7 ¥ BTL cycle
8 ¥ BTL cycle
18/73
¡ Semiconductor
(3)Bit timing
Bit timing is set by CAN bus timing registers 0 and 1. The relationship between 1 bit time
of a message and a CAN bus timing (the MSM9225 register) is as follows:
6. Communication input/output control register (TIOC: 2Fhex)
This register sets the communication mode and output buffer format.
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:
19/73
¡ Semiconductor
MSM9225
Address MSB
2Fh
76543210
LSB
OCMD0
OCMD1
OCPOL0
OCTN0
OCTP0
OCPOL1
OCTN1
OCTP1
:
Output mode
:
:
:
buffer format
:
:
:
buffer format
:
Tx0 output
Tx1 output
(1)Time segment 1: OCMD1 to OCMD0
These bits are used to set the output mode of output pins Tx0 and Tx1.
The relationship between the bit content and output mode is as follows:
At reset, OCMD1 to OCMD0 are set to “00”.
setting
OCMD1OCMD0
00
01
10
11
Output mode of Tx0 and Tx1
[Double layer mode]
Transmission data "0" is output from Tx0 and Tx1 altermately.
Output example
Data
Tx0
Tx1
[Disabled]
[Single layer mode]
Same bit string data is output from both Tx0 qnd Tx1.
Output example
Data
Tx0
Tx1
[Clock output mode]
Bit string data is output from Tx0.
Synchrinization clock is output from Tx1.
Output example
Data
101010
101010
101010
Tx0
Tx1
20/73
¡ Semiconductor
(2)Output driver 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.
The circuit configuration of the output driver and the relationship between bit content
and output driver format are as follows:
At reset, all bits are set to "0".
7. Group message register (GMR0: 3Ehex, GMR1: 3Fhex)
These are registers to set the group message mode.
Two messages can be set to the group message mode.
At reset, all bits are set to "0".
The group message mode is valid when the EGM0/EGM1 bit is "1".
Using GMR03 to GMR00 and GMR13 to GMR10, set the message numbers of messages that
are to be set to the group message mode.
The bit configuration is as follows:
Address MSB
3Eh
3Fh
EGM0
EGM1000GMR11GMR12GMR11GMR10
000GMR03GMR02GMR01GMR00
LSB
8. Group message mask register (GMSK)
This is a register to judge identifiers when a message with a message number specified by the
group message mode GMR is received.
Using MiID28 to MiID0, set the bits to mask the identifier of a message set by the GMR bit.
Setting "1" masks the bit, setting "0" does not mask the bit.
(M0ID28 to M0ID0 are for GMR0, and M1ID28 to M1ID0 are for GMR1.)
At reset, all bits are set to "0".
The bit configuration is as follows:
Address MSB
4Eh
4Fh
M0ID28
M0ID20M0ID19M0ID18M0ID17M0ID16M0ID15M0ID14M0ID13
M0ID27M0ID26M0ID25M0ID24M0ID23M0ID22M0ID21
LSB
GMR0
GMR1
GMSK00
GMSK01
5Eh
5Fh
Address MSB
6Eh
6Fh
7Eh
7Fh
M0ID12
M0ID4M0ID3M0ID2M0ID1M0ID0000
M1ID28
M1ID20M1ID19M1ID18M1ID17M1ID16M1ID15M1ID14M1ID13
M1ID12
M1ID4M1ID3M1ID2M1ID1M1ID0000
M0ID11M0ID10M0ID9M0ID8M0ID7M0ID6M0ID5
LSB
M1ID27M1ID26M1ID25M1ID24M1ID23M1ID22M1ID21
M1ID11M1ID10M1ID9M1ID8M1ID7M1ID6M1ID5
GMSK02
GMSK03
GMSK10
GMSK11
GMSK12
GMSK13
23/73
Loading...
+ 51 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.