8 can data buffer register (c0db) -34 – Maxim Integrated MAXQ7666 User Manual

Page 164

Advertising
background image

MAXQ7665/MAXQ7666 User’s Guide

4-34

4.2.4.8 CAN 0 Data Buffer Register (C0DB)

Register Description:

CAN 0 Data Buffer Register

Register Name:

C0DB

Register Address:

Module 04h, Index 07h

Bits 15 to 0: CAN 0 Data Buffer Register Bits 1 to 15 (C0DB.15 to C0DB.0). This register location refers to both the input and out-
put buffers of the dual port memory, depending on write or read operation. Writing to this register location triggers a write operation
that transfers the source data to the dual port memory as addressed by the C0DP register at the end of the cycle. Reading from this
register location transfers data from the dual port memory to the destination, as selected by the C0DP register at the end of the cycle.
Read/write access to this register location also triggers increment/decrement function to the C0DP if the AID bit is set to logic 1. The
auto-increment/decrement operation is initiated immediately after the completion of the memory access cycle.

Note that the dual port memory is synchronous memory and its read pointer must be activated before a memory read. A write to C0DP
or a read from C0DB automatically activate the C0DP as a read pointer and will remain in effect until the C0DP is used as a write point-
er. In this case, C0DP must be reactivated by a write of C0DP before reading data from C0DB, or be reactivated by a back-to-back
read from C0DB if the auto-increment/decrement function is disabled. Valid data is presented by the second read operation. If it is sus-
pected that the data at the memory location addressed by the C0DP has been changed, the C0DP must be reactivated to ensure the
new data has been pushed to the C0DB register.

Note that, while using the auto-increment/decrement feature for C0DB reads and writes, the RAM is preread in order to get the data
out to the transport network in one cycle. If it is suspected that the data at the memory location specified by C0DP has changed, then
C0DP must be rewritten (i.e., prime the pump). If C0DP is not rewritten, the data returned to C0DB can be incorrect. Sample pseudo
code follows:

Set COR peripheral register to value 0x60;

#enable auto increment

Set C0DP peripheral register to value 0x0B;

#pre-read dual port memory location 0x0B

Read C0DB peripheral register value;

#read from location 0x0B, pre-read 0x0C

Read C0DB peripheral register value;

#read from location 0x0C, pre-read 0x0D

##MESSAGE RECEIVED IN MC1, OVERWRITING

0x0D##

Read C0DB peripheral register value;

#read from location 0x0D, data is incorrect!!

Solution: Rewrite C0DP after MC1 is updated as shown below.

...

Read C0DB peripheral register value;

#read from location 0x0C, pre-read 0x0D

##MESSAGE RECEIVED IN MC1, OVERWRITING 0x0D##

Set C0DP peripheral register to value 0x0D;

#set C0DP, pre-read 0x0D (priming the pump)

Read C0DB register value;

#read from location 0x0D, data is correct!!

Bit #

15

14

13

12

11

10

9

8

Name

C0DB.15 C0DB.14 C0DB.35 C0DB.12 C0DB.11 C0DB.10 C0DB.9 C0DB.8

Reset

0 0 0 0 0 0 0 0

Access rw

rw

rw

rw

rw

rw

rw

rw

Bit #

7

6

5

4

3

2

1

0

Name C0DB.7

C0DB.6

C0DB.5

C0DB.4

C0DB.3

C0DB.2

C0DB.1

C0DB.0

Reset

0 0 0 0 0 0 0 0

Access rw

rw

rw

rw

rw

rw

rw

rw

r = read, w = write
Note: The contents of the buffer are 0000h on all forms of reset.

Maxim Integrated

Advertising
This manual is related to the following products: