Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
162
Добавлен:
01.03.2016
Размер:
3.56 Mб
Скачать

RM0016

Controller area network (beCAN)

 

 

23.11.5CAN receive FIFO register (CAN_RFR)

Address offset: 0x04

Reset value: 0x00

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

RFOM

FOVR

FULL

 

 

FMP[1:0]

 

Reserved

 

 

 

Reserved

 

 

 

 

 

rs

rc_w1

rc_w1

 

r

 

r

 

 

 

 

 

 

 

 

 

Bit 7:6 Reserved.

Bit 5 RFOM Release FIFO Output Mailbox

Set by software to release the output mailbox of the FIFO. The output mailbox can only be released when at least one message is pending in the FIFO. Setting this bit when the FIFO is empty has no effect. If more than one message is pending in the FIFO, the software has to release the output mailbox to access the next message.

Cleared by hardware when the output mailbox has been released.

Bit 4 FOVR FIFO Overrun

This bit is set by hardware when a new message has been received and passed the filter while the FIFO was full.

This bit is cleared by software writing ‘1’.

Bit 3 FULL FIFO Full

Set by hardware when three messages are stored in the FIFO.

This bit can be cleared by software writing ‘1’ or by releasing the FIFO by means of RFOM. Bit 2 Reserved.

Bits 1:0 FMP[1:0] FIFO Message Pending

These bits indicate how many messages are pending in the receive FIFO.

FMP is increased each time the hardware stores a new message in to the FIFO. FMP is decreased each time the FIFO output mailbox has been released by hardware (RFOM bit has been cleared after prior setting by software).

Doc ID 14587 Rev 9

391/454

Controller area network (beCAN)

RM0016

 

 

23.11.6CAN interrupt enable register (CAN_IER)

Address offset: 0x05

Reset value: 0x00

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

WKUIE

 

 

 

FOVIE

FFIE

FMPIE

TMEIE

 

 

Reserved

 

 

 

 

 

rw

 

 

rw

rw

rw

rw

 

 

 

 

 

 

 

 

 

 

 

Bit 7 WKUIE Wakeup Interrupt Enable

0:No interrupt when WKUI is set.

1:Interrupt generated when WKUI bit is set.

Bit 6:4 Reserved.

Bit 3 FOVIE FIFO Overrun Interrupt Enable

0:No interrupt when FOVR bit is set.

1:Interrupt generated when FOVR bit is set.

Bit 2 FFIE FIFO Full Interrupt Enable

0:No interrupt when FULL bit is set.

1:Interrupt generated when FULL bit is set.

Bit 1 FMPIE FIFO Message Pending Interrupt Enable

0:No interrupt on FMP[1:0] bits transition from 0b00 to 0b01.

1:Interrupt generated on FMP[1:0] bits transition from 0b00 to 0b01.

Bit 0 TMEIE Transmit Mailbox Empty Interrupt Enable

0:No interrupt when RQCPx bit is set.

1:Interrupt generated when RQCPx bit is set.

392/454

Doc ID 14587 Rev 9

RM0016

Controller area network (beCAN)

 

 

23.11.7CAN diagnostic register (CAN_DGR)

Address offset: 0x06

Reset value: 0x0C

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

TXM2E

RX

SAMP

SILM

LBKM

 

Reserved

 

 

 

 

 

 

 

 

rw

r

r

rw

rw

 

 

 

 

 

 

 

 

 

 

 

Bit 7:5 Reserved.

Bit 4 TXM2E TX Mailbox 2 enable

0:Force compatibility with ST7 beCAN (2 TX Mailboxes) - reset value

1:Enables the third TX Mailbox (Mailbox number 2)

Bit 3 RX CAN Rx Signal

Monitors the actual value of the CAN_RX Pin.

Bit 2 SAMP Last sample point

The value of the last sample point.

Bit 1 SILM Silent mode

0:Normal operation

1:Silent mode

Bit 0 LBKM Loop back mode

0:Loop back mode disabled

1:Loop back mode enabled

23.11.8CAN page select register (CAN_PSR)

Address offset: 0x07

Reset value: 0x00

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PS[2:0]

 

 

 

Reserved

 

 

 

 

 

 

 

 

 

 

rw

rw

rw

 

 

 

 

 

 

 

 

Bits 7:3

Reserved.

Bits 2:0

PS[2:0] Page select

 

This register is used to select the register page.

 

000: Tx Mailbox 0

 

001: Tx Mailbox 1

 

010: Acceptance Filter 0:1

 

011: Acceptance Filter 2:3

100:Acceptance Filter 4:5

101:Tx Mailbox 2

110:Configuration/Diagnostic

111:Receive FIFO

Refer to Figure 158 for more details.

Doc ID 14587 Rev 9

393/454

Controller area network (beCAN)

RM0016

 

 

23.11.9CAN error status register (CAN_ESR)

Address offset: See Table 71.

Reset value: 0000 0000 (00h)

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

LEC[2:0]

 

 

BOFF

EPVF

EWGF

Reserved

 

 

 

Reserved

 

 

 

 

rw

rw

rw

 

r

r

r

 

 

 

 

 

 

 

 

Bit 7 Reserved.

Bit 6:4 LEC[2:0] Last error code

This field holds a code which indicates the type of the last error detected on the CAN bus. If a message has been transferred (reception or transmission) without error, this field will be cleared to ‘0’. The code 7 is unused and may be written by the CPU to check for update.

000: No Error

001: Stuff Error

010: Form Error

011: Acknowledgment Error

100:Bit recessive Error

101:Bit dominant Error

110:CRC Error

111:Set by software

Bit 3 Reserved.

Bit 2 BOFF Bus-off flag

This bit is set by hardware when it enters the bus-off state. The bus-off state is entered on CAN_TECR overrun, TEC greater than 255, refer to Section 23.6.5 on page 382.

Bit 1 EPVF Error passive flag

This bit is set by hardware when the Error Passive limit has been reached (Receive Error Counter or Transmit Error Counter greater than 127).

Bit 0 EWGF Error warning flag

This bit is set by hardware when the warning limit has been reached. Receive Error Counter or Transmit Error Counter greater than 96.

394/454

Doc ID 14587 Rev 9

Соседние файлы в папке Минимум документации STM8_1