1996 Jun 27 100
Philips Semiconductors Product specification
8-bit microcontroller with on-chip CAN P8xC592
00A0 72 CAN_INT_HANDLER:
00A1 73
74 ; first save used registers
C0D0 75 PUSH PSW
C0E0 76 PUSH ACC
77
78 ; store the CAN-controller's Interrupt Register contents
79 ; (here: at a bit-addressable location).
00A2 80 ; This is necessary because after reading the Interrupt Register
81 ; its contents is cleared, but on the other hand several flags
82 ; may be set in coincidence.
E5D9 83 MOV A, CANON
541F 84 ANL A, #INT_FLAG_MASK ; only interrupt-flags
00A5 F520 85 MOV CAN_INT_IMAGE, A
00A7 86
87
88 ;dispatcher-----------------------------------------------------------------------------------------------
89 INT_TEST0:
00A9 100000 90 JBC CAN_INT_RX,CAN_RX_SERV ;receive-interrupt?
00AB 91
00AD 92 INT_TEST1:
93 ; here the dispatcher has to be completed according
94 ; to the application-specific requirements
95 ; ...
96 ; ...
97 ; end of dispatcher------------------------------------------------------------------------------------
98
99 ;Rx-serve--------------------------------------------------------------------------------------------------
00AE 100 ; copy message (Data-Field only) from CAN- to CPU memory
00AF 101
102 CAN_RX_SERVE
00B0 103 ; read 2nd Descriptor-Byte from the Rx-Buffer (address 21)
75DB15 104 MOV CANADR, #CAN_REF + 1
E5DA 105 MOV A, CANDAT
106
LOC OBJ LINE SOURCE
1996 Jun 27 101
Philips Semiconductors Product specification
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-filter 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
1996 Jun 27 102
Philips Semiconductors Product specification
8-bit microcontroller with on-chip CAN P8xC592
00A1 143 ; after reading the Rx-Buffer it must be released back to
144 ; the CAN-controller. In coincidence, the Clear Overrun bit
145 ; (CANCON.3) may be set, regardless of an existing or
146 ; non-existing data overrun.
147 CAN_RX_READY:
75D904 148 MOV CANCON, #CAN_RBF_REL
149
00A2 150 ; if no other interrupt-flag is set, the interrupt-handler
151 ; for the CAN-controller can be left. Otherwise further
152 ; services are required.
E520 153 MOV A, CAN_INT_IMAGE
70E4 154 JNZ INT_TEST1
00A5 155
00A7 156 ; no other service is required, so the interrupt-handler
157 ; is left.
D0E0 158 POP ACC
D0D0 159 POP PSW
00A9 32 160 RETI
00AB 161 ; end of Rx-serve-------------------------------------------------------------------------------------
00AD 162
163 ; here the array follows containing 8 destination-addresses
164 ; for up to 8 different messages to be received. The values
165 ; are fully application-specific (the values below show an
166 ; example only).
167 RX_ARRAY_START:
E0 168 DB 0E0H ; Rx-message #0
00 169 DB 000H ; this message is not used
00AE 170 ; ...
00AF FA 171 DB 0FAH ; RX-message #7, containing 6 data bytes
172
00B0 173 END
REGISTER BANK(S) USED: 0
ASSEMBLY COMPLETE, NO ERRORS FOUND
LOC OBJ LINE SOURCE

P80C592FFA/00,512

Mfr. #:
Manufacturer:
NXP Semiconductors
Description:
IC MCU 8BIT ROMLESS 68PLCC
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet