TXZ Family CAN Controller Contents Preface ................................. 5 Related document ..............................5 Conventions ................................6 Terms and Abbreviations ............................8 Outlines ................................. 9 Block Diagram ............................. 10 Function and Operation ..........................11 3.1. Clock Supply ..............................11 3.2. CAN Interface ..............................11 3.3.
Page 3
TXZ Family CAN Controller [CANLAM]( Local Acceptance Mask Register) ......................39 [CANGAM](Global Acceptance Mask Register)......................40 [CANMCR](Master Control Register) ........................41 [CANGSR](Global Status Register) .......................... 42 [CANBCR1](Bit Configuration Register1) ......................... 43 [CANBCR2](Bit Configuration Register2) ......................... 43 [CANGIF](Global Interrupt Flag Register) ......................... 44 [CANGIM](Global Interrupt Mask Register) ......................
Page 4
TXZ Family CAN Controller List of Figures Figure 2.1 Block Diagram of CAN controller .................... 10 Figure 3.1 Configuration of Mailboxes ..................... 12 Figure 3.2 Timing when a Receive Message Lost Occurs ..............14 Figure 3.3 Receive filtering ........................16 Figure 3.4 Timer Stamp Counter......................
TXZ Family CAN Controller Preface Related document Document Name Clock Control and Operation Mode Memory Map Product Information 2018-10-30 5 / 54 Rev. 1.1...
TXZ Family CAN Controller Conventions Numeric formats follow the rules as shown below: Hexadecimal: 0xABC Decimal: 123 or 0d123 – Only when it needs to be explicitly shown that they are decimal numbers. Binary: 0b111 – It is possible to omit the "0b" when the number of bit can be distinctly understood from a sentence.
Page 7
TXZ Family CAN Controller *********************************************************************************************************************** Arm, Cortex and Thumb are registered trademarks of Arm Limited (or its subsidiaries) in the US and/or elsewhere. All rights reserved. *********************************************************************************************************************** The Flash memory uses the Super Flash® technology under license from Silicon Storage Technology, Inc. Super Flash®...
TXZ Family CAN Controller Terms and Abbreviations Some of abbreviations used in this document are as follows: Controller Area Network 2018-10-30 8 / 54 Rev. 1.1...
TXZ Family CAN Controller 1. Outlines The CAN can operate as a transmission/ reception circuit of 1channel per unit. The following shows the List of Function. Function Function Operation explanation classification Compliant with CAN version 2.0B Standard and extended formats supported active Max 1Mbps(fsys=48MHz(Min)) Protocol...
TXZ Family CAN Controller 2. Block Diagram Figure 2.1 shows the Block Diagram of CAN controller CANCLK INTCANRXD Control & Interrupt INTCANTXD INTCANGLB Transmit buffer Transmit data Control CANTX interface CAN protocol controller CANRX Receive data Prio rity Comarison regi ster Receive buffer Mailbox Data output...
TXZ Family CAN Controller 3. Function and Operation 3.1. Clock Supply When you use CAN, please set an applicable clock enable bit to "1" (clock supply) in fsys supply stop register A ([CGFSYSENA], [CGFSYSMENA]), fsys supply stop register B ([CGFSYSENB], [CGFSYSMENB]), and fc supply stop registers ([CGFCEN]).
TXZ Family CAN Controller 3.3. Function Mailbox The mailboxes consist of a single port RAM (accessible from the internal CAN core and the CPU). The CPU controls the CAN controller by changing the settings of the mailboxes and control registers. The settings of the mailboxes and control registers are used for such processes as reception filtering, message transmission, and interrupt processing.
TXZ Family CAN Controller Transmit Control Register Transmission control consists of two registers. One is the transmission request set register [CANTRS], and the other is the transmission request reset register [CANTRR]. Therefore it is possible to clear the transmission request without generating a conflict in the handling of the transmission mailboxes in the state-machine. This mechanism also prevents clearing the transmission request of a mailbox to which transmission is already in progress.
TXZ Family CAN Controller Receive Control Register The ID of a received message is compared to the ID of the mailbox set as the receive mailbox. The comparison of the IDs depends on the [CANMBnID]<GAME_LAME> values of the global/local acceptance mask enable bit and the data held in the global/local acceptance mask registers [CANGAM]/[CANLAM].
TXZ Family CAN Controller Remote Frame Control Register After a remote frame is received, the remote frame ID is compared to the mailbox ID. The comparison of the IDs depends on the [CANMBnID]<GAME_LAME> values of the global/local acceptance mask enable bit [CANMBnID] in the mailbox and the data held in the global/local acceptance mask registers [CANGAM]/[CANLAM].
TXZ Family CAN Controller Receive Filtering For mailboxes 0 to 30, the global acceptance mask register [CANGAM] will be used if the global bit in the mailbox is set. The receiving message will be stored in the first mailbox with a matching ID. Only if there is no matching ID in the mailboxes 0 to 30, the receiving message will be compared to the receive-only mailbox (mailbox 31).
TXZ Family CAN Controller Time Stamp Function There is a free-running 16-bit time stamp counter [CANTSC] implemented in the CAN controller to show the time of message reception and transmission. The content of the [CANTSC] is written into the time stamp value (TSV) of the corresponding mailbox when a received message has been stored or a message has been transmitted.
TXZ Family CAN Controller Interrupt Control The CAN controller has the following interrupt sources. And these interrupt sources are divided into three groups and each group has one interrupt output. ● CAN transmission completion interrupt (INTCANTXD) It occurs at the completion of transmission ●...
TXZ Family CAN Controller <MBRIF[31]> <MBIM[31]> <MBRIF[30]> INTCANRXD <MBIM[30]> Pulse <MBTIF[30]> INTCANTXD INTCANGLB 32 sources for receive 31 sources for transmit Pulse <MBRIF[0]> <MBIM[0]> <MBTIF[0]> [CANGIF]<RFPF> [CANGIM]<RFPM> Pulse 8 sources from global interrupt [CANGIF]<WLIF> [CANGIM]<WLIM> Figure 3.5 Block Diagram of CAN interrupt signals The CAN receive completion interrupt signal INTCANRXD is the OR of the signal for which the 32 sources issued by the mailbox receive interrupt flag register [CANMBRIF] that are ANDed with each bit of the mailbox interrupt mask register [CANMBIM].
TXZ Family CAN Controller 3.4. Operation Mode Configuration Mode The CAN controller needs initial setup before starting operation (setting of the bit configuration registers, [CANBCR1] and [CANBCR2]). Writes to the [CANBCR1] and [CANBCR2] are possible only when the CAN controller is in configuration mode. After reset, the [CANMCR]<CCR>...
TXZ Family CAN Controller Switch to configuration mode Initialize CAN after reset from normal operation mode CAN is in configuration mode: CAN is in normal operation mode: [CANMCR]<CCR> = 1 & [CANMCR]<CCR> = 0 & [CANGSR]<CCE> = 1 [CANGSR]<CCE> = 0 Set bit timing parameters in Configuration mode [CANBCR1] &...
TXZ Family CAN Controller Sleep Mode Sleep mode is requested by a write of “1” to the <SMR> bit in the [CANMCR] register. After the CAN controller has entered into sleep mode, the [CANGSR]<SMA> bit is set to “1”. The read value of the [CANGSR] register is “0x0001F040”. This means that there is no message in the transmission buffer and sleep mode is active where the <SMA>...
TXZ Family CAN Controller Test Loop Back Mode In test loop back mode, the CAN controller can receive its own transmitted message and generates its own acknowledge bit. No other CAN node is necessary for the operation. The test loop back mode can be enabled or disabled only when the CAN controller is in suspend mode. In test loop back mode, the CAN controller can transmit a message from a mailbox and receive it in another mailbox.
TXZ Family CAN Controller Enable/disable test loop back mode and test error mode CAN is in normal operation mode: [CANMCR]<CCR> = 0 & [CANGSR]<CCE> = 0 [CANMCR]<SUR> = 0 & [CANGSR]<SUA> = 0 Suspend mode request: [CANGSR]<SUA> = 1 ? Setup [CANMCR]<TSTLB>...
TXZ Family CAN Controller 3.5. Bit Configuration The length of a bit is determined by the parameters [CANBCR2]<TSEG1>, [CANBCR2]<TSEG2>, and [CANBCR1]<BRP>. All controllers on the CAN bus must have the same baud rate and bit length. At different clock frequencies of the individual controllers, the baud rate has to be adjusted by the above-mentioned parameters.
TXZ Family CAN Controller Information processing time (IPT) is the time segment starting with the sample point reserved for processing of the sampled bit level. The information processing time is equal to three CAN system clock cycles. [CANBCR2]<SJW[1:0]> indicates how much the time quantum (T ) value in bit length is allowed to be lengthened or shortened When resynchronizing.
Page 27
TXZ Family CAN Controller <SJW> should always be set to the highest value possible. <SJW> is not allowed to be greater than > <TSEG2>. The three-time sampling of the bus cannot be set because of the condition that [CANBCR1] <BRP[9:0]> is smaller than "4".
TXZ Family CAN Controller 4. Register 4.1. Register list The control registers and their addresses are shown as follows: Base address Function Channel/Unit TYPE 1 CAN controller 0x40005000 Register Name Address(+Base) CAN Mailbox see “4.1.1” 0x0000 to 0x03E0 Mailbox Configuration Register [CANMC] 0x0400 Mailbox Direction Register...
TXZ Family CAN Controller CAN Mailbox The address of each mailbox is as follows. Function name Mail Box No Address(+Base) No.0 0x0000 No.1 0x0020 No,2 0x0040 No.3 0x0060 No.4 0x0080 No.5 0x00A0 No.6 0x00C0 No.7 0x00E0 No.8 0x0100 No.9 0x0120 No.10 0x0140 No.11...
TXZ Family CAN Controller 4.2. Details of Registers [CANMBnID]( Message ID Field Register) Bit Symbol After Reset Type Function ID Extension bit 0: Standard format (11-bit ID) from <ID28> to <ID18> used 1: Extended format (29-bit ID) from <ID28> to <ID0> used Sets the mailbox by selecting whether to receive or transmit the extended format (<IDE>=1) or the standard format (<IDE>=0).
TXZ Family CAN Controller [CANMBnTSVMCF]( Time Stamp Values Message Control Field Register) Bit Symbol After Reset Type Function Time stamp counter value The 16-bit time stamp counter values read when message have been successfully received or 31:16 TSV[15:0] transmitted are stored. No value is set when message reception or transmission fails. For the details of the entire time stamp counter function, Refer to “3.3.6Time Stamp Function”.
TXZ Family CAN Controller [CANMBnDL](Data fields Register ) Bit Symbol After Reset Type Function 31:24 D3[7:0] Transmitted and received data is stored. 23:16 D2[7:0] Transmitted and received data is stored. 15:8 D1[7:0] Transmitted and received data is stored. D0[7:0] Transmitted and received data is stored. For transmission, data is transmitted according to the data byte count set in the [CANMBnTSVMCF]<DLC[3:0]>...
TXZ Family CAN Controller [CANMC](Mailbox Configuration Register) Bit Symbol After Reset Type Function Access configuration to the mailbox (Each bit corresponds to mailboxes 31 to 0) 0: The corresponding mailbox MBn is disabled for the CAN controller. 1: The corresponding mailbox MBn is enabled for the CAN controller. Write access from CPU 31:0 MC[31:0]...
TXZ Family CAN Controller [CANTRS](Transmission Request Set Register) Bit Symbol After Reset Type Function Read as "0" Transmit request set (Each bit corresponds to mailboxes 30 to 0.) Set <TRSn> requests the message transmission of corresponding mailbox n. When the transmission is requested for multiple mailboxes, the message is transmitted in 30:0 TRS[30:0] accordance with the priority corresponding to the [CANMCR]<MTOS>...
TXZ Family CAN Controller [CANTRR](Transmission Request Reset Register) Bit Symbol After Reset Type Function Read as "0" Transmit request reset (Each bit corresponds to mailboxes 30 to 0.) Setting <TRRn> cancels the message transmission of corresponding mailbox n. 30:0 TRR[30:0] A write of "1"...
TXZ Family CAN Controller [CANTA](Transmission Acknowledge Register) Bit Symbol After Reset Type Function Read as "0". Transmission acknowledge (Each bit corresponds to mailboxes 30 to 0) When the message in mailbox n has been successfully transmitted, the <TAn> bit is set to "1". 30:0 TA[30:0] The <TAn>...
TXZ Family CAN Controller [CANRMP](Receive Message Pending Register) Bit Symbol After Reset Type Function Receive message pending (Each bit corresponds to mailboxes 31 to 0.) After a message is received and the content of the received message is written in mailbox n, the 31:0 RMP[31:0] <RMPn>...
TXZ Family CAN Controller [CANRML](Receive Message Lost Register) Bit Symbol After Reset Type Function Receive message lost (Each bit corresponds to mailboxes 31 to 0.) When mailbox n for which the <RMPn> bit is set to "1" receives the next message, the content 31:0 RML[31:0] of the received message is overwritten to the mailbox n, and the <RMLn>...
TXZ Family CAN Controller [CANLAM]( Local Acceptance Mask Register) Bit Symbol After Reset Type Function Mask of the ID extension bit<IDE> (mailbox 31) 0: Not masked 1: Masked In case of <LAMI>=0, the message in the standard or the extended format is received, LAMI according to the <IDE>...
TXZ Family CAN Controller [CANGAM](Global Acceptance Mask Register) Bit Symbol After Reset Type Function Mask of the ID extension bit<IDE> ( mailboxes "0" to "30") 0: Not masked 1: masked GAMI In case if <GAMI> =0, the message of the standard or the extended format is received, according to the <IDE>...
TXZ Family CAN Controller [CANMCR](Master Control Register) Bit Symbol After Reset Type Function 31:12 Read as "0". Suspend mode request 0: Cancels suspend mode (normal operation) 1: Request suspend mode Read as "0". Test loop back TSTLB 0: Cancels test loop back mode (normal operation) 1: Request test loop back mode (This mode supports stand-alone operation.) Test error 0: Cancels test error mode (normal operation)
TXZ Family CAN Controller [CANGSR](Global Status Register) Bit Symbol After Reset Type Function 31:17 Read as "0". Message in slot Indicates the mailbox number of a message located in the transmission buffer. 00000: Message for mailbox 0 01011: Message for mailbox 11 10110: Message for mailbox 22 00001: Message for mailbox 1 01100: Message for mailbox 12 10111: Message for mailbox 23 00010: Message for mailbox 2 01101: Message for mailbox 13 11000: Message for mailbox 24 00011: Message for mailbox 3 01110: Message for mailbox 14 11001: Message for mailbox 25...
TXZ Family CAN Controller [CANBCR1](Bit Configuration Register1) Bit Symbol After Reset Type Function 31:10 Read as "0". Set the value of Baud rate prescaler BRP[9:0] value: 0 to 1023 [CANBCR2](Bit Configuration Register2) Bit Symbol After Reset Type Function 31:10 Read as "0". Resynchronization jump width 00: 1 ×...
TXZ Family CAN Controller [CANGIF](Global Interrupt Flag Register) Bit Symbol After Reset Type Function 31:8 Read as "0". Remote frame pending flag 0: No remote frame has been received. RFPF 1: Remote frames have been received. (in the receive mailbox) This bit will not be set when matching with the transmission mailbox for which the <RFH>...
TXZ Family CAN Controller [CANMBTIF](Mailbox Transmit Interrupt Flag Register) Bit Symbol After Reset Type Function Read as "0". Mailbox transmission interrupt flag (Each bit corresponds to mailboxes 30 to 0.) When the message in mailbox n has been successfully transmitted and the interrupt mask of the [CANMBIM] register is enabled (<MBIMn>=1), the <MBTIFn>...
TXZ Family CAN Controller [CANCDR](Change Data Request Register) Bit Symbol After Reset Type Function Read as "0". Change data request (Each bit corresponds to mailboxes 30 to 0.) When the <CDRn> bit of transmission mailbox n is set to "1", the transmission request of this mailbox n is ignored.
TXZ Family CAN Controller [CANCEC](CAN Error Counter Register) Bit Symbol After Reset Type Function 31:16 Read as "0". 8-bit transit error counter (After reset release) 15:8 TEC[7:0] 8-bit transit error counter ([CANMCR]<TSTERR>=1) 8-bit receive error counter (After reset release) REC[7:0] 8-bit receive error counter ([CANMCR]<TSTERR>=1) The CAN controller contains two error counters: the receive error counter <REC[7:0]>...
TXZ Family CAN Controller [CANTSP](Time Stamp Counter Prescaler Register) Bit Symbol After Reset Type Function 31:4 Read as "0". Time stamp counter prescaler TSP[3:0] Sets the value to be loaded to the prescaler for the 4-bit TSC. To ensure that the value of the [CANTSC] will not change during the write cycle to the mailbox, a hold register is implemented.
TXZ Family CAN Controller 5. Usage 5.1. Receive Messages Figure 5.1 shows an example flowchart of message reception using the CAN receive completion interrupt (INTCANRXD). Receiving messages Setup a mailbox for message reception Disable mailbox: New setup for set [CANMC]<MCn> to "0" the mailbox? Wait for INTCANRXD...
TXZ Family CAN Controller 5.2. Transmitting Message Figure 5.2 shows an example flowchart of message transmission using the CAN transmission completion interrupt (INTCANTXD). Setup a mailbox for Transmitting messages message transmission Disable mailbox: New setup for set [CANMC]<MCn> to "0" the mailbox? Update mailbox data?
TXZ Family CAN Controller 5.3. Remote Frame Handling Figure 5.3 shows an example flowchart of remote frame handling by using the automatic reply feature. This feature is available when the [CANMBnID]<RFH> bit of the transmission mailbox is set to "1". To avoid data inconsistency when updating the mailbox data, the [CANCDR] register controls transmission during data update of the mailbox.
TXZ Family CAN Controller 6. Revision History Table 6.1 Revision History Revision Date Description 2018-05-28 New Release - modified SST Trademark -2. Figure 2.1 & Table 2.1 : modified "CANx" to "CAN" -3.2 Modified “CANxRX” to “CANRX”, Modified “CANxTX” to 2018-10-30 “CANTX”...
Before customers use the Product, create designs including the Product, or incorporate the Product into their own applications, customers must also refer to and comply with (a) the latest versions of all relevant TOSHIBA information, including without limitation, this document, the specifications, the data sheets and application notes for Product and the precautions and conditions set forth in the "TOSHIBA Semiconductor Reliability Handbook"...