1996 Jun 27
101
Philips Semiconductors
Product specication
8-bit microcontroller with on-chip CAN
P8xC592
00A0
107
; determine the destination address in data-memory for the
00A1
108
; message's Data-Field
54E0
109
ANL
A, #ID2_0_MASK
; use ID.2 ... ID.0 only
C4
110
SWAP
A
03
111
RR
A
; A = 4*ID.2 + 2*ID.1 + ID.0
112
; this value is used as an index for an array of 8 bytes
113
; containing the destination-addresses for the 8 different
114
; messages. Note, that the #RX_ARRAY_OFFSET is due to the
00A2
115
; program counter-relative access to the array.
2415
116
ADD
A, #RX_ARRAY_START
RX_ARRAY_OFFSET
83
117
MOVC
A, @A + PC
118
RX_ARRAY_OFFSET:
119
00A5
120
; if a message passes the acceptance-lter of the CAN
00A7
121
; Controller, but the CPU doesn't need it, the array
122
; entry's value may be set to zero indicating this.
123
; The following
<jz> instruction cares for this.
6007
124
JZ
CAN_RX_READY
00A9
125
00AB
126
; now copy the Data-Field (only) from CAN- to CPU memory
00AD
127
; with the aid of the DMA-logic. Note, that a TX-DMA is
128
; performed when writing 8AH (DMA + address 10) into CANADR
129
; and a RX-DMA is performed when writing 94H (DMA + address 20)
130
; ... 9DH (DMA + address 29) into CANADR. Here address 22 is
131
; used to copy just the Data-Field.
F5D8
132
MOV
CANSTA, A
; data-memory address
75DB96 133
MOV
CANADR, #CAN_RX_DMA ; starts RX-DMA at address 22
134
00AE
135
; the DMA-transfer is done in at maximum 2 instruction cycles.
00AF
136
; During the transfer, neither the data-memory (RAM) nor one
137
; of the SFRs CANADR, CANDAT, CANCON and
00B0
138
; CANSTA may be accessed by the CPU.
139
; For simplicity, two NOPs are used here.
00
140
NOP
00
141
NOP
00A0
142
LOC
OBJ
LINE SOURCE