Ecovery and, Rror, Ounter – Maxim Integrated High-Speed Microcontroller Users Guide: DS80C390 Supplement User Manual
Page 150: Peration

High-Speed Microcontroller User’s Guide: DS80C390 Supplement
150 of 158
If, after a period of time, only a small number of errors have accumulated (most likely due to normal
transmission noise), then the DS80C390 is operating at the correct baud rate. The autobaud process is
further simplified by the fact that most networks only operate at a small number of values. For example,
DeviceNet operates at 125kbps, 250kbps, and 500kbps, so a device attempting to autobaud to a
DeviceNet network would only have to test three baud rates.
The autobaud feature for a CAN module is enabled by setting the appropriate Autobaud bit (C0C.2 or
C1C.2). Setting this bit activates a special loopback circuit within the CAN module that logically ANDs
incoming network data received on the Rx pin with the Tx pin of the CAN module. While the autobaud
bit is set, the CAN module will disable its transmit output and place it in the recessive (high) state, so that
error frames generated by the autobauding CAN module do not disturb other devices on the network
during the procedure.
The following user-defined software procedure can be used in conjunction with the autobaud feature to
determine the baud rate of the network.
1) Set CRST=1 to disable bus activity. Setting this bit also sets the SWINT bit, enabling access to
Control/Status registers, and also clears the CxRE and CxTE registers,
2) Configure bus timing registers to set desired baud rate,
3) Set autobaud bit =1,
4) Set SWINT=0 to enable CAN module and begin listening for errors,
5) Delay approximately 500 ms (allow enough time for >128 errors to occur),
6) If CAN Error Count Exceeded (CECE) bit is set, baud rate is incorrect. Select a new baud rate and
repeat procedure. If CECE bit is not set, the DS80C390 CAN module is set to the correct baud rate.
BUS OFF/BUS OFF RECOVERY AND ERROR COUNTER OPERATION
Each CAN module contains two SFRs that allow software to monitor and modify (under controlled
conditions) the error counts associated with the transmit and receive error counters in each CAN module.
These registers can be read at any time. Writing the CAN Transmit Error Counter registers updates both
the Transmit Error Counter registers and the Receive Error Counter registers with the same value. Details
are given in the SFR description of these registers. These counters are incremented or decremented
according to CAN specification version 2.0B, summarized in the rules below. The error counters are
initialized by a CRST = 1 or a system reset to 00h. The error counters remain unchanged when the CAN
module enters and exits from a low power mode by the PDE bit.
Changes to the error counters are performed according to the following rules. This level of detail is not
necessary for the average CAN user, and full information is provided in the CAN 2.0B specification.
More than one rule may apply to a given message.