Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
8XC196Kx,8XC196Jx,87C196CA microcontroller family user's manual.1995.pdf
Скачиваний:
65
Добавлен:
23.08.2013
Размер:
3.97 Mб
Скачать

CAN SERIAL COMMUNICATIONS CONTROLLER

12.9 DESIGN CONSIDERATIONS

This section outlines design considerations for the CAN controller.

12.9.1 Hardware Reset

A hardware reset clears the error management counters and the bus-off state and leaves the registers with the values listed in Table 12-14.

Table 12-14. Register Values Following Reset

Register

Hex Address

Reset Value

 

 

 

Control

1E00

01H

 

 

 

Status

1E01

undefined

 

 

 

Standard Global Mask

1E06–1E07

unchanged (undefined at power-up)

 

 

 

Extended Global Mask

1E08–1E0B

unchanged (undefined at power-up)

 

 

 

Message 15 Mask

1E0C–1E0F

unchanged (undefined at power-up)

 

 

 

Bit Timing 0

1E3F

unchanged (undefined at power-up)

 

 

 

Bit Timing 1

1E4F

unchanged (undefined at power-up)

 

 

 

Interrupt

1E5F

00H

 

 

 

Message Object x

1Ex0–1ExE

unchanged (undefined at power-up)

 

 

 

12.9.2 Software Initialization

The software initialization state allows software to configure the CAN controller’s RAM without risk of messages being received or transmitted during this time. Setting the INIT bit in the control register causes the CAN controller to enter the software initialization state. Either a hardware reset or a software write can set the INIT bit. While INIT is set, all message transfers to and from the CAN controller are stopped and the error counters and bit timing registers are unchanged. Your software should clear the INIT bit to cause the CAN controller to exit the software initialization state. At this time, the CAN controller synchronizes itself to the CAN bus by waiting for a bus idle state (11 consecutive recessive bits) before participating in bus activities.

12.9.3 Bus-off State

If an error counter reaches 256, the CAN controller isolates itself from the CAN bus, sets the BUSOFF bit in the status register, and sets the INIT bit in the control register. While INIT is set, all message transfers to and from the CAN controller are stopped; the error counters and bit timing registers are unchanged. Software must clear the INIT bit to initiate the bus-off recovery sequence.

12-41

8XC196Kx, Jx, CA USER’S MANUAL

The CAN controller synchronizes itself to the CAN bus by waiting for 128 bus idle states (128 occurrences of 11 consecutive recessive bits) before participating in bus activities. During this sequence, the CAN controller writes a bit 0 error code to the LEC2:0 bits of the status register each time it receives a recessive bit. Software can check the status register to determine whether the CAN bus is stuck in a dominant state. Once the CAN controller is resynchronized with the CAN bus, it clears the BUSOFF bit and starts transferring messages again.

12-42

13

Minimum Hardware

Considerations

Соседние файлы в предмете Электротехника