ROBERT BOSCH GMBH MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
WITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
ROBERT BOSCH GMBH RESERVES THE RIGHT TO MAKE CHANGES WITHOUT FURTHER
NOTICE TO THE PRODUCTS DESCRIBED HEREIN. ROBERT BOSCH GMBH DOES NOT
ASSUME ANY LIABILITY ARISING OUT OF THE APPLICATION OR USE OF ANY PRODUCT
OR CIRCUIT DESCRIBED HEREIN.
IssueDateByChange
Draft 0.030.06.00 F. HartwichFirst Draft
Revision 0.112.01.01 F. HartwichGap Control
Revision 0.221.10.00 F. HartwichTrigger Memory
Revision 1.029.11.00 F. HartwichCycle Count, Global Time Mark
Revision 1.111.12.00 F. HartwichTUR Configuration, Enable Local Time
Revision 1.213.12.00 F. HartwichTime Mark Register, TMC
Revision 1.317.01.01 F. HartwichTUR Configuration Registers
Revision 1.430.04.01 F. HartwichClock Synch., Stop_Watch, External Events
Revision 1.512.10.01 F. HartwichEditorial changes
Revision 1.611.11.02 F. HartwichWatchdog, Gap Control, Global Time Preset
1.2 Conventions
The following conventions are used within this User’s Manual.
Helvetica boldNames of bits and signals
Helvetica italic
States of bits and signals
1.3 Scope
This document describes the TTCAN IP module and its features from the application
programmer’s point of view.
All information necessary to integrate the TTCAN IP module into an user-defined ASIC is
located in the ‘Module Integration Guide’.
1.4 References
This document refers to the following documents.
manual_about.fm
RefAuthor(s)Title
1FV/SLN1CAN Specification Revision 2.0
2K8/EIS1Module Integration Guide
3K8/EIS1VHDL Reference CAN User’s Manual
4ISOISO 11898-1 “Controller Area Network (CAN) - Part 1:
Data link layer and physical signalling”
5ISOISO 11898-4 “Controller Area Network (CAN) - Part 4:
Time triggered communication”
BOSCH
-6/77-
11.11.02
User’s Manual
1.5 Terms and Abbreviations
This document uses the following terms and abbreviations.
TermMeaning
CANController Area Network
BSPBit Stream Processor
BTLBit Timing Logic
CRCCyclic Redundancy Check Register
DLCData Length Code
EMLError Management Logic
FSEFrame Synchronisation Entity
FSMFinite State Machine
NTUNetwork Time Unit
TTCANTime Triggered CAN
Revision 1.6TTCAN
manual_about.fm
BOSCH
-7/77-
11.11.02
User’s Manual
Revision 1.6TTCAN
2. Functional Description
2.1 Functional Overview
The TTCAN is a CAN IP module that can be integrated as stand-alone device or as part of an
ASIC. It is described in VHDL on RTL level, prepared for synthesis. It consists of the
components (see figure 1) CAN_Core, Message RAM, Message Handler, Control Registers,
Module Interface, and, for the time triggered function, Trigger Memory and Frame
Synchronisation Entity.
The TTCAN performs CAN protocol communication according to ISO 11898-1 (identical to
Bosch CAN protocol specification 2.0 A, B) and according to ISO 11898-4 : “Time triggered
communication on CAN”. The bit rate can be programmed to values up to 1MBit/s depending
on the used technology. Additional transceiver hardware is required for the connection to the
physical layer (the CAN bus line).
TTCAN provides all features of time triggered communication specified in ISO 11898-4,
including event synchronised time triggered communication, global system time, and clock
drift compensation. Optionally, it may be restricted to the functions of ISO 11898-1, with the
same features as the Bosch C_CAN IP module.
For communication on a CAN network, individual Message Objects are configured. The
Message Objects and Identifier Masks are stored in the Message RAM. The time triggers
defining the transmission schedule are stored in the Trigger RAM.
All functions concerning the handling of messages are implemented in the Message Handler.
Those functions are acceptance filtering, transfer of messages between the CAN_Core and
the Message RAM, and the handling of transmission requests as well as the generation of the
module interrupt.
All functions concerning the time schedule and the global system time are implemented in the
Frame Synchronisation Entity FSE.
The register set of the TTCAN can be accessed directly by an external CPU via the module
interface. These registers are used to control/configure the CAN_Core and the Message
Handler and to access the single-ported Message RAM.
The module interfaces delivered with the TTCAN IP module can easily be replaced by a
customized module interface adapted to the needs of the user.
The TTCAN implements the following features:
•Supports CAN protocol version 2.0 part A, B and TTCAN (ISO 11898-4)
•Bit rates up to 1 MBit/s
manual_about.fm
•32 Message Objects, each Message Object has its own Identifier Mask
•Programmable FIFO mode for Message Objects
•TTCAN protocol level 1 and level 2 completely in hardware
•Event synchronised time triggered communication implemented
•Programmable loop-back mode for self-test operation
•two 16-bit module interfaces to the AMBA APB bus from ARM
•16-bit non-multiplex TI TMS470 compatible module interface
CAN Protocol Controller and Rx/Tx Shift Register, handles all ISO 11898-1 protocol functions.
Message Handler
State Machine that controls the data transfer between the single ported Message RAM, the
CAN_Core’s Rx/Tx Shift Register, and the CPU IFC Registers. It also handles acceptance
filtering and the interrupt setting as programmed in the Control and Configuration Registers.
Message RAM / CPU IFC Registers
Single ported RAM, word-length = [CAN message & acceptance filter mask & control bits &
status bits]. To ensure data consistency, all CPU accesses to the Message RAM are relayed
through CPU IFC registers that have the same word-length as the Message RAM.
TTCAN
Frame Synchronisation Entity / Trigger Memory
manual_about.fm
State machine that controls the ISO 11898-4 time triggered communication. It synchronises
itself to the reference messages on the CAN bus, controls Cycle Time and Global Time, and
handles transmissions according to the predefined message schedule, the system matrix.
StopWatch Trigger, EVent Trigger, and Time Mark Interrupt are synchronisation interfaces.
The Trigger Memory stores the time marks of the system matrix that are linked to the
messages in the Message RAM.
Module Interface
Up to now the TTCAN module is provided with three different interfaces. An 8-bit interface for
the Motorola HC08 controller a 16-bit interface to the TI TMS470 controller, and two 16-bit
interfaces to the AMBA APB bus from ARM. They can easily be replaced by a user-defined
module interface.
BOSCH
-9/77-
11.11.02
User’s Manual
Revision 1.6TTCAN
2.3 Operating Modes
2.3.1 Software Initialisation
The software initialization is started by setting the bit Init in the CAN Control Register, either
by software or by a hardware reset, or by going
Bus_Off
.
While Init is set, all message transfer from and to the CAN bus is stopped, the status of the
CAN bus output CAN_TX is
recessive
(HIGH). The counters of the EML are unchanged.
Setting Init does not change any configuration register.
To initialize the CAN Controller, the CPU has to set up the Bit Timing Register and each
Message Object. If a Message Object is not needed, it is sufficient to set it’s MsgVal bit to not
valid. Otherwise, the whole Message Object has to be initialized.
Access to the Bit Timing Register and to the BRP Extension Register for the configuration of
the bit timing and to the TT Operation Mode Register for the configuration of the time triggered
communication is enabled when both bits Init and CCE in the CAN Control Register are set.
Resetting Init (by CPU only) finishes the software initialisation. Afterwards the Bit Stream
Processor BSP (see section 4.2.1 on page 45) synchronizes itself to the data transfer on the
CAN bus by waiting for the occurrence of a sequence of 11 consecutive
) before it can take part in bus activities and starts the message transfer.
Idle
recessive
bits (≡
Bus
The initialization of the Message Objects is independent of Init and can be done anytime, but
the Message Objects should all be configured to particular identifiers or set to not valid before
the BSP starts the message transfer.
To change the configuration of a Message Object during normal operation, the CPU has to
start by setting MsgVal to not valid. When the configuration is completed, MsgVal is set to
valid again.
To change the configuration of the time triggered communication, the TTMode in the
TT Operation Mode Register must be set to Configuration Mode. Entering and leaving this
Configuration Mode requires that both bits Init and CCE are set.
2.3.2 CAN Message Transfer
Once the TTCAN is initialized and Init is reset to zero, the TTCAN’s CAN_Core synchronizes
itself to the CAN bus and starts the message transfer in the configured TTMode.
Received messages are stored into their appropriate Message Objects if they pass the
Message Handler’s acceptance filtering. The whole message including all arbitration bits, DLC
and eight data bytes is stored into the Message Object. If the Identifier Mask is used, the
arbitration bits which are masked to “don’t care” may be overwritten in the Message Object
manual_about.fm
when a received message is stored.
The CPU may read or write each message any time via the Interface Registers, the Message
Handler guarantees data consistency in case of concurrent accesses.
Messages to be transmitted are updated by the CPU. If a permanent Message Object
(arbitration and control bits set up during configuration) exists for the message, only the data
bytes are updated. How the transmission is started depends on the configured TTMode.If
several transmit messages are assigned to the same Message Object (when the number of
Message Objects is not sufficient), the whole Message Object has to be configured before the
transmission of this message is requested.
The transmission of any number of Message Objects may be requested at the same time, they
are transmitted subsequently according to their internal priority. Messages may be updated or
BOSCH
-10/77-
11.11.02
User’s Manual
Revision 1.6TTCAN
set to not valid any time, even when their requested transmission is still pending. The old data
will be discarded when a message is updated before its pending transmission has started.
Depending on the configuration of the Message Object, the transmission of a message may
be requested autonomously by the reception of a remote frame with a matching identifier.
2.3.3 Disabled Automatic Retransmission
According to the CAN Specification (see ISO11898, 6.3.3 Recovery Management), the
TTCAN provides means for automatic retransmission of frames that have lost arbitration or
that have been disturbed by errors during transmission. The frame transmission service will
not be confirmed to the user before the transmission is successfully completed. By default,
this means for automatic retransmission is enabled. It can be disabled to enable the TTCAN to
work within a Time Triggered CAN (TTCAN, see ISO11898-1) environment.
The Disabled Automatic Retransmission mode is enabled by programming bit DAR in the CAN
one
Control Register to
. In this operation mode the programmer has to consider the different
behaviour of bits TxRqst and NewDat in the Control Registers of the Message Buffers:
•When a transmission starts bit TxRqst of the respective Message Buffer is reset, while bit
NewDat remains set.
•When the transmission completed successfully bit NewDat is reset.
When a transmission failed (lost arbitration or error) bit NewDat remains set. To restart the
transmission the CPU has to set TxRqst back to
Note :
It is not necessary to set DAR if the TTCAN is in time triggered operating mode.
2.3.4 Test Mode
The Test Mode is entered by setting bit Test in the CAN Control Register to
the bits Tx1, Tx0, LBack, Silent, NoRAM, and WdOff in the Test Register are writable. Bit Rx
monitors the state of pin CAN_RX and therefore is only readable. All Test Register functions
are disabled when bit Test is reset to zero.
Loop Back Mode, No Message RAM Mode, and CAN_TX Control Mode are hardware test
modes, not to be used by application programs.
Silent Mode and the Watchdog Disable Mode are software test modes.
2.3.4.1 Test Register (addresses 0x0B & 0x0A)
1514131211109876543210
StWEvTresresresresresresRxTx1Tx0 LBack Silent NoRAM res WdOff
rrrrrrrrrrwrwrwrwrwrrw
manual_about.fm
one
.
one
. In Test Mode
StWMonitors the actual value of the STOP_WATCH_TRIGGER pin
EvTMonitors the actual value of the EVENT_TRIGGER pin
RxMonitors the actual value of the CAN_RX pin
one
zero
The CAN bus is recessive (CAN_RX = ‘1’).
The CAN bus is dominant (CAN_RX = ‘0’).
Tx1-0Control of CAN_TX pin
00
01
10
11
BOSCH
Reset value, CAN_TX is controlled by the CAN_Core.
Sample Point can be monitored at CAN_TX pin.
CAN_TX pin drives a dominant (‘0’) value.
CAN_TX pin drives a recessive (‘1’) value.
-11/77-
11.11.02
User’s Manual
Revision 1.6TTCAN
LBackLoop Back Mode
one
zero
Loop Back Mode is enabled.
Loop Back Mode is disabled.
SilentSilent Mode
one
zero
The module is in Silent Mode
Normal operation.
NoRAMNo Message RAM Mode
one
zero
IF1 Registers used as Tx Buffer, IF2 Registers used as Rx Buffer.
No Message RAM Mode disabled, normal Message RAM usage.
WdOffDisable Watchdog
one
zero
The Watchdog disabled.
The Watchdog is enabled, after Initialization has finished (Init = 0).
Write access to the Test Register is enabled by setting bit Test in the CAN Control Register.
The different test functions may be combined, but Tx1-0 ≠ “00” disturbs message transfer.
2.3.4.2 Disable Watchdog Mode
The TT Application Watchdog (see chapter 3.5.6) can be disabled by programming the Test
Register bit WdOff to
one
and the Application_Watchdog_Limit AppWdL to 0x00. When bit
Test in the CAN Control Register is reset, WdOff is also reset if the TTCAN is in time triggered
operating mode; if the TTCAN is in event driven CAN mode, WdOff is remains set and the TT
Application Watchdog remains disabled (emulating the C_CAN function).
The TT Application Watchdog should not be disabled in a TTCAN application program.
2.3.4.3 Silent Mode
The CAN_Core can be set in Silent Mode by programming the Test Register bit Silent to
In Silent Mode, the TTCAN is able to receive valid data frames and valid remote frames, but it
sends only
is required to send a
internally so that the CAN_Core monitors this
recessive
in
affecting it by the transmission of
recessive
bits on the CAN bus and it cannot start a transmission. If the CAN_Core
dominant
bit (ACK bit, overload flag, active error flag), the bit is rerouted
dominant
bit, although the CAN bus may remain
state. The Silent Mode can be used to analyse the traffic on a CAN bus without
dominant
bits (Acknowledge Bits, Error Frames). Figure 2
shows the connection of signals CAN_TX and CAN_RX to the CAN_Core in Silent Mode.
CAN_TX CAN_RX
manual_about.fm
TTCAN
=1
•
•
TxRx
one
.
CAN_Core
Figure 2: CAN_Core in Silent Mode
In ISO 11898-1, the Silent Mode is called the Bus Monitoring Mode.
BOSCH
-12/77-
11.11.02
User’s Manual
Revision 1.6TTCAN
2.3.4.4 Loop Back Mode
The CAN_Core can be set in Loop Back Mode by programming the Test Register bit LBack to
one
. In Loop Back Mode, the CAN_Core treats its own transmitted messages as received
messages and stores them (if they pass acceptance filtering) into a Receive Buffer. Figure 3
shows the connection of signals CAN_TX and CAN_RX to the CAN_Core in Loop Back Mode.
CAN_TX CAN_RX
TTCAN
•
•
TxRx
CAN_Core
Figure 3: CAN_Core in Loop Back Mode
This mode is provided for hardware self-test functions. To be independent from external
stimulation, the CAN_Core ignores acknowledge errors (recessive bit sampled in the
acknowledge slot of a data/remote frame) in Loop Back Mode. In this mode the CAN_Core
performs an internal feedback from its Tx output to its Rx input. The actual value of the
CAN_RX input pin is disregarded by the CAN_Core. The transmitted messages can be
monitored at the CAN_TX pin.
2.3.4.5 Loop Back combined with Silent Mode
It is also possible to combine Loop Back Mode and Silent Mode by programming bits LBack
one
and Silent to
at the same time. This mode can be used for a “Hot Selftest”, meaning the
TTCAN hardware can be tested without affecting a running CAN system connected to the pins
CAN_TX and CAN_RX. In this mode the CAN_RX pin is disconnected from the CAN_Core
and the CAN_TX pin is held
recessive
. Figure 4 shows the connection of signals CAN_TX and
CAN_RX to the CAN_Core in case of the combination of Loop Back Mode with Silent Mode.
CAN_TX CAN_RX
manual_about.fm
TTCAN
=1
•
•
TxRx
CAN_Core
Figure 4: CAN_Core in Loop Back combined with Silent Mode
BOSCH
-13/77-
11.11.02
User’s Manual
Revision 1.6TTCAN
2.3.4.6 Software control of Pin CAN_TX
Four output functions are available for the CAN transmit pin CAN_TX. Additionally to its
default function – the serial data output – it can drive the CAN Sample Point signal to monitor
the CAN_Core’sbit timing and it can drive constant dominant or recessive values.The last two
functions, combined with the readable CAN receive pin CAN_RX, can be used to check the
CAN bus’ physical layer.
The output mode of pin CAN_TX is selected by programming the Test Register bits Tx1 and
Tx0 as described in section 2.3.4.1 on page 11.
The three test functions for pin CAN_TX interfere with all CAN protocol functions. CAN_TX
must be left in its default function when CAN message transfer or any of the test modes Loop
Back Mode, Silent Mode, or No Message RAM Mode are selected.
2.3.4.7 No Message RAM Mode
The CAN_Core can be set in No Message RAM Mode by programming the Test Register bit
one
NoRAM to
. In this mode the TTCAN module operates without the Message RAM.
The IF1 Registers are used as Transmit Buffer. The transmission of the contents of the IF1
Registers is requested by writing the Busy bit of the IF1 Command Request Register to ‘1’.
The IF1 Registers are locked while the Busy bit is set. The Busy bit indicates that the
transmission is pending. The CPU-IFC’s output signal CAN_WAIT_B is disabled (always ‘1’)
in this mode.
As soon the CAN bus is idle, the IF1 Registers are loaded into the CAN_Core’s shift register
and the transmission is started. When the transmission has completed, the Busy bit is reset
and the locked IF1 Registers are released.
A pending transmission can be aborted at any time by resetting the Busy bit in the IF1
Command Request Register while the IF1 Registers are locked. If the CPU has reset the Busy
bit, a possible retransmission in case of lost arbitration or in case of an error is disabled.
The IF2 Registers are used as Receive Buffer. After the reception of a message the contents
of the shift register is stored into the IF2 Registers, without any acceptance filtering.
Additionally, the actual contents of the shift register can be monitored during the message
transfer. Each time a read Message Object is initiated by writing the Busy bit of the IF2
Command Request Register to ‘1’, the contents of the shift register is stored into the IF2
Registers.
In No Message RAM Mode the evaluationof all Message Object related control and status bits
and of the control bits of the IFx Command Mask Registers is turned off. The message
number of the Command request registers is not evaluated. The NewDat and MsgLst bits of
the IF2 Message Control Register retain their function, DLC3-0 will show the received DLC,
manual_about.fm
the other control bits will be read as ‘0’.
The No Message RAM Mode is a hardware test mode that allows to evaluate the TTCAN IP
RTL code in FPGA types that do not support the TTCAN’s Message RAM structure.
BOSCH
-14/77-
11.11.02
User’s Manual
Revision 1.6TTCAN
3. Programmer’s Model
The TTCAN module allocates an address space of 256 bytes. The registers are organized as
16-bit registers, with the high byte at the odd address and the low byte at the even address.
The two sets of interface registers (IF1 and IF2) control the CPU access to the Message RAM.
They buffer the data to be transferred to and from the RAM, avoiding conflicts between CPU
accesses and message reception/transmission.
AddressNameReset ValueNote
CAN Base+0x00CAN Control Register0x0001CAN config register
CAN Base+0x02Status Register0x0000CAN status register
CAN Base+0x04Error Counter0x0000CAN status register
CAN Base+0x06Bit Timing Register0x2301CAN config reg., req. CCE
CAN Base+0x08Interrupt Register0x0000CAN status register
CAN Base+0x0ATest Register0x00& 0br0000000
CAN Base+0x0CBRP Extension Register0x0000CAN config reg., req. CCE
CAN Base+0x0ETrigger Memory Access0x0000TTCAN config register
CAN Base+0x10IF1 Command Request0x0001CAN appl. IF1 Register Set
CAN Base+0x12IF1 Command Mask0x0000
CAN Base+0x14IF1 Mask 10xFFFF
CAN Base+0x16IF1 Mask 20xFFFF
CAN Base+0x18IF1 Arbitration 10x0000
CAN Base+0x1AIF1 Arbitration20x0000
CAN Base+0x1CIF1 Message Control0x0000
CAN Base+0x1EIF1 Data A 10x0000
CAN Base+0x20IF1 Data A 20x0000
CAN Base+0x22IF1 Data B 10x0000
CAN Base+0x24IF1 Data B 20x0000
CAN Base+0x26— reserved—
CAN Base+0x28TT Operation Mode0x0000TTCAN config register
CAN Base+0x2ATT Matrix Limits10x0000TTCAN config register
CAN Base+0x2CTT Matrix Limits20x0000TTCAN config register
CAN Base+0x2ETT Application Watchdog0x0001TTCAN config register
CAN Base+0x30TT Interrupt Enable0x0000TTCAN appl. register
CAN Base+0x32TT Interrupt Vector0x0000TTCAN status register
CAN Base+0x34TT Global Time0x0000TTCAN status register
manual_about.fm
CAN Base+0x36TT Cycle Time0x0000TTCAN status register
CAN Base+0x38TT Local Time0x0000TTCAN status register
CAN Base+0x3ATT Master State0x0000TTCAN status register
CAN Base+0x3CTT Cycle Count0x003FTTCAN status register
CAN Base+0x3ETT Error Level0x0000TTCAN status register
CAN Base+0x40IF2 Command Request0x0001CAN appl. IF2 Register Set
CAN Base+0x42IF2 Command Mask0x0000
CAN Base+0x44IF2 Mask 10xFFFF
CAN Base+0x46IF2 Mask 20xFFFF
1)
r signifies the actual value of the CAN_RX pin.
2)
Reserved bits are read as ’0’ except for IFx Mask 2 Register where they are read as ’1’
2)
1)
CAN appl. reg., req. Test
BOSCH
-15/77-
11.11.02
User’s Manual
AddressNameReset ValueNote
CAN Base+0x48IF2 Arbitration 10x0000CAN appl. IF2 Register Set
CAN Base+0x4AIF2 Arbitration 20x0000
CAN Base+0x4CIF2 Message Control0x0000
CAN Base+0x4EIF2 Data A 10x0000
CAN Base+0x50IF2 Data A 20x0000
CAN Base+0x52IF2 Data B 10x0000
CAN Base+0x54IF2 Data B 20x0000
CAN Base+0x56TUR-NumeratorCfg0x0000TTCAN config register
CAN Base+0x58TUR-DenominatorCfg0x1000TTCAN config register
CAN Base+0x5ATUR-NumeratorActL0x0000TTCAN status register
CAN Base+0x5CTUR-NumeratorActH0x0001TTCAN status register
CAN Base+0x5E— reserved—
CAN Base+0x60Stop_Watch0x0000TTCAN status register
CAN Base+0x62— reserved—
CAN Base+0x64Global Time Preset0x0000TTCAN appl. register
CAN Base+0x66Clock Control0x1000TTCAN appl. register
CAN Base+0x68Sync_Mark0x0000TTCAN status register
CAN Base+0x6A— reserved—
CAN Base+0x6CTime Mark0x0000TTCAN appl. register
CAN Base+0x6EGap Control0x0000TTCAN appl. register
CAN Base+0x70-0x7E— reserved—
CAN Base+0x80Transmission Request 10x0000CAN status register
CAN Base+0x82Transmission Request 20x0000CAN status register
CAN Base+0x84-0x8E— reserved—
CAN Base+0x90New Data 10x0000CAN status register
CAN Base+0x92New Data 20x0000CAN status register
CAN Base+0x94-0x9E— reserved—
CAN Base+0xA0Interrupt Pending 10x0000CAN status register
CAN Base+0xA2Interrupt Pending 20x0000CAN status register
CAN Base+0xA4-0xAE— reserved—
CAN Base+0xB0Message Valid 10x0000CAN status register
CAN Base+0xB2Message Valid 20x0000CAN status register
CAN Base+0xB4-0xBE— reserved—
1)
r signifies the actual value of the CAN_RX pin.
2)
Reserved bits are read as ’0’ except for IFx Mask 2 Register where they are read as ’1’
manual_about.fm
2)
2)
2)
2)
2)
2)
2)
2)
Revision 1.6TTCAN
Figure 5: TTCAN Register Summary
3.1 Hardware Reset Description
After hardware reset, the registers of the TTCAN hold the values described in figure 5.
Additionally the
Bus_Off
state is reset and the output CAN_TX is set to
recessive
(HIGH). The
value 0x0001 (Init = ‘1’) in the CAN Control Register enables the software initialisation. The
TTCAN does not influence the CAN bus until the CPU resets Init to ‘0’.
The data in the Message RAM is (apart from the MsgVal, NewDat, TxRqst, and IntPnd bits)
These registers are related to the CAN protocol controller in the CAN Core. They control the
operating modes and the configuration of the CAN bit timing and provide status information.
3.2.1 CAN Control Register (addresses 0x01 & 0x00)
1514131211109876543210
resresresresresresresresTestCCEDARresEIESIEIEInit
rrrrrrrrrwrwrwrrwrwrwrw
TestTest Mode Enable
one
zero
Test Mode.
Normal Operation.
CCEConfiguration Change Enable
one
zero
The CPU has write access to the configuration registers (while Init =
The CPU has no write access to the configuration registers.
one
DARDisable Automatic Retransmission
one
zero
Automatic Retransmission disabled.
Automatic Retransmission of not successful messages enabled.
).
EIEError Interrupt Enable
one
Enabled - A change in the bits BOff or EWarn in the Status Register will
generate an interrupt.
zero
Disabled - No Error Status Interrupt will be generated.
SIEStatus Change Interrupt Enable
one
Enabled - An interrupt will be generated when a message transfer is successfully completed or a CAN bus error is detected.
zero
Disabled - No Status Change Interrupt will be generated.
IEModule Interrupt Enable
one
Enabled - Interrupts will set IRQ_B to LOW. IRQ_B remains LOW until all
pending interrupts are processed.
zero
Disabled - Module Interrupt IRQ_B is always HIGH.
InitInitialization
one
zero
Initialization is started.
Normal Operation.
The configuration registers controlled by CCE are the Bit Timing Register, the BRP Extension
manual_about.fm
Register, and the TT Operation Mode Register.
Note :
The
Bus_Off
ting or resetting Init. If the device goes
activities. Once Init has been cleared by the CPU, the device will then wait for 129 occurrences
of
Bus Idle
of the Bus_Off recovery sequence, the Error Management Counters will be reset.
recovery sequence (see CAN Specification Rev. 2.0) cannot be shortened by set-
(129 * 11 consecutive
Bus_Off
recessive
, it will set Init of its own accord, stopping all bus
bits) before resuming normal operations. At the end
During the waiting time after the resetting of Init, each time a sequence of 11
recessive
bits
has been monitored, a Bit0Error code is written to the Status Register, enabling the CPU to
readily check up whether the CAN bus is stuck at
dominant
or continuously disturbed and to
monitor the proceeding of the Bus_Off recovery sequence.
BOSCH
-17/77-
11.11.02
User’s Manual
Revision 1.6TTCAN
3.2.2 Status Register (addresses 0x03 & 0x02)
1514131211109876543210
resresresresresresresresBOff
rrrrrrrrrrrrwrwrw
EWarn
EPass RxOk TxOkLEC
BOffBus_Off Status
one
zero
The CAN module is in Bus_Off state.
The CAN module is not Bus_Off.
EWarn Warning Status
one
At least one of the error counters in the EML has reached the error warning
limit of 96.
zero
Both error counters are below the error warning limit of 96.
EPass Error Passive
one
zero
The CAN Core is in the
The CAN Core is
error active
error passive
.
state as defined in the CAN Specification.
RxOkReceived a Message Successfully
one
Since this bit was last reset (to zero) by the CPU, a message has been successfully received (independent of the result of acceptance filtering).
zero
Since this bit was last reset by the CPU, no message has been successfully
received. This bit is never reset by the CAN Core.
TxOkTransmitted a Message Successfully
one
Since this bit was last reset by the CPU, a message has been successfully
(error free and acknowledged by at least one other node) transmitted.
zero
Since this bit was reset by the CPU, no message has been successfully transmitted. This bit is never reset by the CAN Core.
LECLast Error Code (Type of the last error to occur on the CAN bus)
0No Error
1
Stuff Error : More than 5 equal bits in a sequence have occurred in a part of a
received message where this is not allowed.
2
3
Form Error : A fixed format part of a received frame has the wrong format.
AckError : The message this CAN Core transmitted was not acknowledged by
another node.
manual_about.fm
4
5
Bit1Error : During the transmission of a message (with the exception of the
arbitration field), the device wanted to send a
‘1’), but the monitored bus value was
dominant
recessive
.
Bit0Error : During the transmission of a message (or acknowledge bit, or
active error flag, or overload flag), the device wanted to send a
(data or identifier bit logical value ‘0’), but the monitored bus value was
. During
sive
recessive
Bus_Off
recovery this status is set each time a sequence of 11
bits has been monitored. This enables the CPU to monitor the pro-
ceeding of the Bus_Off recovery sequence (indicating the bus is not stuck at
dominant
6
CRCError : The CRC check sum was incorrect in the message received, the
or continuously disturbed).
CRC received for an incoming message does not match with the calculated
CRC for the received data.
7unused : When the LEC shows the value ‘7’, no CAN bus event was detected
since the CPU wrote this value to the LEC.
level(bit of logical value
dominant
level
reces-
BOSCH
-18/77-
11.11.02
User’s Manual
Revision 1.6TTCAN
The LEC field holds a code which indicates the type of the last error to occur on the CAN bus.
This field will be cleared to ‘0’ when a message has been transferred (reception or transmission) without error. The unused code ‘7’ may be written by the CPU to check for updates.
3.2.2.1 Status Interrupts
A Status Interrupt is generated by bits BOff and EWarn (Error Interrupt, EIE)orbyRxOk,
TxOk, and LEC (Status Change Interrupt, SIE) assumed that the corresponding enable bits inthe CAN Control Register are set. A change of bit EPass or a CPU write to RxOk, TxOk,or
LEC will never generate a Status Interrupt.
When SIE is set, a Status Interrupt will be generated at each CAN bus error and at each valid
CAN message, independent of the Message RAM configuration.
Reading the Status Register will clear the Status Interrupt value (8000h) in the Interrupt
Register, if it is pending.
3.2.3 Error Counter (addresses 0x05 & 0x04)
1514131211109876543210
RPREC6-0TEC7-0
rrr
RPReceive Error Passive
one
The Receive Error Counter has reached the
error passive
level as defined
in the CAN Specification.
zero
The Receive Error Counter is below the
error passive
level.
REC6-0Receive Error Counter
Actual state of the Receive Error Counter. Values between 0 and 127.
TEC7-0Transmit Error Counter
Actual state of the Transmit Error Counter. Values between 0 and 255.
3.2.4 Bit Timing Register (addresses 0x07 & 0x06)
1514131211109876543210
resTSeg2TSeg1SJWBRP
rrwrwrwrw
TSeg1The time segment before the sample point
0x01-0x0F
manual_about.fm
valid values for TSeg1 are [1 … 15]. The actual interpretation by
the hardware of this value is such that one more than the value
programmed here is used.
TSeg2The time segment after the sample point
0x0-0x7
valid values for TSeg2 are [0 … 7]. The actual interpretation by
the hardware of this value is such that one more than the value
programmed here is used.
SJW(Re)Synchronisation Jump Width
0x0-0x3
Valid programmed values are 0-3. The actual interpretation by
the hardware of this value is such that one more than the value
programmed here is used.
BOSCH
-19/77-
11.11.02
User’s Manual
Revision 1.6TTCAN
BRPBaud Rate Prescaler
0x00-0x3F
The value by which the oscillator frequency is divided for generating the bit time quanta. The bit time is built up from a multiple
of this quanta. Valid values for the Baud Rate Prescaler are
[0 … 63]. The actual interpretation by the hardware of this value
is such that one more than the value programmed here is used.
This register is only writable if bits CCE and Init in the CAN Control Register are set. The CAN
bit time may be programed in the range of [4 … 25] time quanta. The CAN time quantum may
be programmed in the range of [1 … 1024] CAN_CLK periods. For details see chapter 4.2.1.
Note :
With a module clock CAN_CLK of 8 MHz and BRPE = 0x00, the reset value of 0x2301 configures the TTCAN for a bit rate of 500 kBit/s.
0x00-0x0FBy programming BRPE the Baud Rate Prescaler can be
extended to values up to 1023. The actual interpretation by the
hardware is that one more than the value programmed by BRPE
(MSBs) and BRP (LSBs) is used.
This register is only writable if bits CCE and Init in the CAN Control Register are set.
Note :
The width of BRPE may be increased to more than its default width of 4 bits in particular implementations of the TTCAN IP module width a high module clock frequency.
3.3 Message Interface Register Sets
AddressIF1 Register SetAddressIF2 Register Set
CAN Base+0x10IF1 Command RequestCAN Base+0x40IF2 Command Request
CAN Base+0x12IF1 Command MaskCAN Base+0x42IF2 Command Mask
CAN Base+0x14IF1 Mask 1CAN Base+0x44IF2 Mask 1
CAN Base+0x16IF1 Mask 2CAN Base+0x46IF2 Mask 2
CAN Base+0x18IF1 Arbitration 1CAN Base+0x48IF2 Arbitration 1
CAN Base+0x1AIF1 Arbitration 2CAN Base+0x4AIF2 Arbitration 2
CAN Base+0x1CIF1 Message ControlCAN Base+0x4CIF2 Message Control
manual_about.fm
CAN Base+0x1EIF1 Data A 1CAN Base+0x4EIF2 Data A 1
CAN Base+0x20IF1 Data A 2CAN Base+0x50IF2 Data A 2
CAN Base+0x22IF1 Data B 1CAN Base+0x52IF2 Data B 1
CAN Base+0x24IF1 Data B 2CAN Base+0x54IF2 Data B 2
Figure 6: IF1 and IF2 Message Interface Register Sets
There are two sets of Interface Registers that control the CPU access to the Message RAM.
The Interface Registers avoid (by buffering the data to be transferred) conflicts between CPU
access to the Message RAM and CAN message reception and transmission. A complete
Message Object (see chapter 3.3.4) or parts of the Message Object may be transferred
between the Message RAM and the IFx Message Buffer registers (see chapter 3.3.3) in one
BOSCH
-20/77-
11.11.02
User’s Manual
Revision 1.6TTCAN
single transfer. This transfer,performed in parallel on all selected parts of the Message Object,
guarantees the data consistency of the CAN message. Figure 6 shows the structure of the two
Interface Register sets.
The function of the two Interface Register sets is identical (except for test mode NoRAM). The
second interface register set is provided to serve application programming. Two groups of
software drivers may defined, each group is restricted to the use of one of the Interface
Register sets. The software drivers of one group may interrupt software drivers of the other
group, but not of the same group.
In a simple example, there is one Read_Message task that uses IFC1 to get received
messages from the Message RAM and there is one Write_Message task that uses IFC2 to
write messages to be transmitted into the Message RAM. Both tasks may interrupt each other.
Each set of Interface Registers consists of Message Buffer Registers controlled by their own
Command Registers. The Command Mask Register specifies the direction of the data transfer
and which parts of a Message Object will be transferred. The Command Request Register is
used to select a Message Object in the Message RAM as target or source for the transfer and
to start the action specified in the Command Mask Register.
3.3.1 IFx Command Mask Registers
The control bits of the IFx Command Mask Register specify the transfer direction and select
which of the IFx Message Buffer Registers are source or target of the data transfer.
15 14 13 12 11 10 9 876543210
IF1 CommandMask Register
(addresses 0x13 & 0x12)
IF2 CommandMask Register
(addresses 0x43 & 0x42)
resWR/RD Mask Arb Control
resWR/RD Mask Arb Control
rrrrrr r rrwrwrwrwrwrwrwrw
ClrIntPnd
ClrIntPnd
TxRqst/
NewDat
TxRqst/
NewDat
Data A Data B
Data A Data B
WR/RDWrite / Read
one
Write: Transfer data from the selected Message Buffer Registers to the
Message Object addressed by the Command Request Register.
zero
Read: Transfer data from the Message Object addressed by the Command Request Register into the selected Message Buffer Registers.
The other bits of IFx Command Mask Register have different functions depending on the
transfer direction :
3.3.1.1 Direction = Write
MaskAccess Mask Bits
manual_about.fm
one
zero
transfer Identifier Mask + MDir + MXtd to Message Object.
Mask bits unchanged.
ArbAccess Arbitration Bits
one
zero
transfer Identifier + Dir + Xtd + MsgVal to Message Object.
Arbitration bits unchanged.
ControlAccess Control Bits
Note :
BOSCH
one
zero
MSC2-0 is read-only in time triggered operating mode.
transfer Control Bits to Message Object.
Control Bits unchanged.
-21/77-
11.11.02
User’s Manual
ClrIntPnd Clear Interrupt Pending Bit
Note :
When writing to a Message Object, this bit is ignored.
TxRqst/NewDatAccess Transmission Request Bit
Note :
one
zero
If a transmission is requested by setting TxRqst/NewDat in the IFx Command Mask Register,
bit TxRqst in the IFx Message Control Register will be ignored.
set TxRqst bit
TxRqst bit unchanged
Data AAccess Data Bytes 0-3
one
zero
transfer Data Bytes 0-3 to Message Object.
Data Bytes 0-3 unchanged.
Data BAccess Data Bytes 4-7
one
zero
transfer Data Bytes 4-7 to Message Object.
Data Bytes 4-7 unchanged.
3.3.1.2 Direction = Read
MaskAccess Mask Bits
one
zero
transfer Identifier Mask + MDir + MXtd to IFx Message Buffer Register.
Mask bits unchanged.
Revision 1.6TTCAN
ArbAccess Arbitration Bits
one
zero
transfer Identifier + Dir + Xtd + MsgVal to IFx Message Buffer Register.
Arbitration bits unchanged.
ControlAccess Control Bits
one
zero
transfer Control Bits to IFx Message Buffer Register.
Control Bits unchanged.
ClrIntPnd Clear Interrupt Pending Bit
one
zero
clear IntPnd bit in the Message Object.
IntPnd bit remains unchanged.
TxRqst/NewDatAccess New Data Bit
Note :
one
zero
A read access to a Message Object can be combined with the reset of the control bits IntPnd
and NewDat. The values of these bits transferred to the IFx Message Control Register always
reflect the status before resetting them.
clear NewDat bit in the Message Object.
NewDat bit remains unchanged.
Data AAccess Data Bytes 0-3
manual_about.fm
one
zero
transfer Data Bytes 0-3 to IFx Message Buffer Register.
Data Bytes 0-3 unchanged.
Data BAccess Data Bytes 4-7
Note :
one
zero
The speed of the message transfer does not depend on how many bytes are transferred.
transfer Data Bytes 4-7 to IFx Message Buffer Register.
Data Bytes 4-7 unchanged.
3.3.2 IFx Command Request Registers
A message transfer is started as soon as the CPU has written the message number to low
byte of the Command Request Register. With this write operation, the Busy bit is
automatically set to ‘1’ to notify the CPU that a transfer is in progress. After a wait time of 3 to
BOSCH
-22/77-
11.11.02
User’s Manual
Revision 1.6TTCAN
6 CAN_CLK periods, the transfer between the Interface Register and the Message RAM has
completed and the Busy bit is cleared to ‘0’. The upper limit of the wait time occurs when the
message transfer coincides with a CAN message transmission, acceptance filtering, or
message storage. If the CPU-IFC is implemented with the wait-function, the CPU is halted
while the Busy bit is set. If the CPU writes to both Command Request Registers consecutively
(requests a second transfer while another transfer is already in progress), the second transfer
starts when the first one is completed.
IF1 Command Request Register
(addresses 0x11 & 0x10)
IF2 Command Request Register
(addresses 0x41 & 0x40)
1514131211109876543210
BusyresresMessage Number
BusyresresMessage Number
rr rrw
BusyBusy Flag
one
zero
set to one when writing to the IFx Command Request Register
reset to zero when read/write action has finished.
Message Number
0x01-0x20
Valid Message Number, the Message Object in the Message
RAM is selected for data transfer.
Note :
0x00
0x21-0x3F
When an invalid Message Number is written to the Command Request Register, the MessageNumber will be transformed into a valid value and that Message Object will be transferred.
Not a valid Message Number, interpreted as
Not a valid Message Number, interpreted as
0x20
.
0x01-0x1F
.
3.3.3 IFx Message Buffer Registers
The bits of the Message Buffer registers mirror the Message Objects in the Message RAM.
The function of the Message Objects bits is described in chapter 3.3.4.
The data bytes of CAN messages are stored in the IFx registers in the following order:
15 14 13 12 11 109876543210
IF1 Message Data A1 (addresses 0x1F & 0x1E)Data(1)Data(0)
IF1 Message Data A2 (addresses 0x21 & 0x20)Data(3)Data(2)
IF1 Message Data B1 (addresses 0x23 & 0x22)Data(5)Data(4)
IF1 Message Data B2 (addresses 0x25 & 0x24)Data(7)Data(6)
IF2 Message Data A1 (addresses 0x4F & 0x4E)Data(1)Data(0)
IF2 Message Data A2 (addresses 0x51 & 0x50)Data(3)Data(2)
IF2 Message Data B1 (addresses 0x53 & 0x52)Data(5)Data(4)
IF2 Message Data B2 (addresses 0x55 & 0x54)Data(7)Data(6)
rwrw
In a CAN Data Frame, Data(0) is the first, Data(7) is the last byte to be transmitted or received.
In CAN’s serial bit stream, the MSB of each byte will be transmitted first.
3.3.4 Message Object in the Message Memory
There are 32 Message Objects in the Message RAM. To avoid conflicts between CPU access
to the Message RAM and CAN message reception and transmission, the CPU cannot directly
access the Message Objects, these accesses are handled via the IFx Interface Registers.
Figure 7 gives an overview of the two structure of a Message Object.
Message Object
UMaskMsk28-0 MXtdMDirEoBMSC2-0 NewDat MsgLst RxIETxIE IntPnd RmtEn TxRqst
MsgValID28-0XtdDirDLC3-0 Data 0Data 1 Data 2 Data 3 Data 4 Data 5 Data 6 Data 7
Figure 7: Structure of a Message Object in the Message Memory
MsgValMessage Valid
manual_about.fm
Note :
one
zero
The CPU must reset the MsgVal bit of all unused Messages Objects during the initialization
before it resets bit Init in the CAN Control Register. This bit must also be reset before the identifier Id28-0, the control bits Xtd, Dir, or the Data Length Code DLC3-0 are modified, or if the
Messages Object is no longer required.
The Message Object is configured and should be considered by the Message Handler.
The Message Object is ignored by the Message Handler.
UMaskUse Acceptance Mask
Note :
one
zero
If the UMask bit is set to
initialization of the Message Object before MsgVal is set to
Use Mask (Msk28-0, MXtd, and MDir) for acceptance filtering
Mask ignored.
one
, the Message Object’s mask bits have to be programmed during
one
.
BOSCH
-24/77-
11.11.02
Loading...
+ 53 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.