English
Language : 

DS80C390_00 Datasheet, PDF (81/155 Pages) Dallas Semiconductor – High-Speed Microcontroller User’s Guide Supplement
SWINT
Bit 0
DS80C390 High-Speed Microcontroller User’s Guide Supplement
CAN 1 Software Initialization Enable. This bit enables (SWINT=1) and
disables (SWINT=0) software write access to the first 16 bytes of the CAN 1
MOVX SRAM. These bytes contain the CAN 1 Control/Status/Mask Registers.
Read access to all bytes in the CAN 1 MOVX SRAM is permitted at all times,
regardless of the state of the SWINT bit.
Setting SWINT=1 disables CAN 1 Bus activity, allowing software access to the
CAN 1 Control/Status/Mask Registers without corrupting CAN Bus transmission
or reception. A special lockout procedure delays the internal assertion of the
SWINT bit until all CAN 1 activity has ceased. The following procedure must be
followed when setting the SWINT bit to prevent the accidental corruption of CAN
Bus activity:
3. Write a 1 to the SWINT bit, starting the internal process to enter the software
initialization process.
4. Poll the SWINT bit until it is set. The lockout circuit will hold SWINT=0 if it
detects a reception, transmission, or arbitration in progress. When one of these
conditions ceases, or if an error occurs, the CAN module will set SWINT=1,
indicating that the CAN module is disabled and software can now write to the
first 16 bytes of the CAN 1 MOVX SRAM. Attempts to modify the first 16
bytes of the CAN 1 MOVX SRAM while SWINT=0 will fail, leaving the
bytes unchanged.
The SWINT bit controls access to several other bits and registers. The CAN 1
Transmit Error Register (C1TE;A6h) and CAN 1 Receive Error Register
(C1RE;A7h) are only modifiable while SWINT=1. Setting SWINT=1
automatically clears the SIESTA bit, and attempts to set SWINT=1 and
SIESTA=1 in the same write to the C1C register will result in SWINT=1 and
SIESTA=0.
The BUSOFF bit has a direct interaction with the SWINT bit. When a Bus Off
condition is detected (BUSOFF=1), the CAN module will automatically clear
SWINT=0 and initiate a bus recovery and power-up sequence. Write access to the
SWINT bit is prohibited until the Bus Off condition has been cleared and
BUSOFF has been reset to 0.
The SWINT bit is also set automatically following a system reset, the setting of
the CRST bit in the CAN 1 Control Register, or programming the CAN Bus
Timing Registers (C1BT0, C1BT1 in the MOVX SRAM) to 00h (an invalid
state). As a precaution against utilizing the CAN with invalid bus timing, the
SWINT bit cannot be cleared while C1BT0=C1BT1=00h. When this bit is
cleared, the CAN 1 module will initiate a CAN Bus synchronization after the
CAN module executes a power-up sequence (reception of 11 consecutive
recessive bits.)
81 of 155