PCM18XK1 Microchip Technology, PCM18XK1 Datasheet - Page 298

MODULE PROC PIC18F8680,6680,8565

PCM18XK1

Manufacturer Part Number
PCM18XK1
Description
MODULE PROC PIC18F8680,6680,8565
Manufacturer
Microchip Technology
Datasheet

Specifications of PCM18XK1

Accessory Type
Processor Module
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
ICE2000
For Use With
ICE2000 - EMULATOR MPLAB-ICE 2000 POD
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
PIC18F6585/8585/6680/8680
REGISTER 23-20: RXBnDm: RECEIVE BUFFER n DATA FIELD BYTE m REGISTERS
REGISTER 23-21: RXERRCNT: RECEIVE ERROR COUNT REGISTER
EXAMPLE 23-5:
DS30491C-page 296
; Need to read a pending message from RXB0 buffer.
; To receive any message, filter, mask and RXM1:RXM0 bits in RXB0CON registers must be
; programmed correctly.
;
; Make sure that there is a message pending in RXB0.
BTFSS
BRA
; We have verified that a message is pending in RXB0 buffer.
; If this buffer can receive both Standard or Extended Identifier messages,
; identify type of message received.
BTFSS
BRA
; Read all 29-bits of Extended Identifier message.
...
; Now read all data bytes
MOVFF
...
; Once entire message is read, mark the RXB0 that it is read and no longer FULL.
BCF
...
bit 7-0
bit 7-0
RXB0CON, RXFUL
NoMessage
RXB0SIDL, EXID
StandardMessage
RXB0DO, MY_DATA_BYTE1
RXB0CON, RXFUL
[0
READING A CAN MESSAGE
bit 7
RXBnDm7 RXBnDm6 RXBnDm5 RXBnDm4 RXBnDm3 RXBnDm2 RXBnDm1 RXBnDm0
RXBnDm7:RXBnDm0: Receive Buffer n Data Field Byte m bits (where 0 n < 1 and 0 < m < 7)
Each receive buffer has an array of registers. For example, Receive Buffer 0 has 8 registers:
RXB0D0 to RXB0D7.
Legend:
R = Readable bit
- n = Value at POR
bit 7
REC7:REC0: Receive Error Counter bits
This register contains the receive error value as defined by the CAN specifications.
When RXERRCNT > 127, the module will go into an error-passive state. RXERRCNT does not
have the ability to put the module in “bus-off” state.
Legend:
R = Readable bit
- n = Value at POR
REC7
R-x
R-0
n
1, 0
REC6
R-x
R-0
m
7]
W = Writable bit
‘1’ = Bit is set
W = Writable bit
‘1’ = Bit is set
REC5
R-x
R-0
; Does RXB0 contain a message?
; No.
; Is this Extended Identifier?
; No.
; Yes.
; This will allow CAN Module to load new messages
; into this buffer.
Handle this situation...
This is Standard Identifier message.
This is Extended Identifier message.
REC4
R-x
R-0
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared
REC3
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared
R-x
R-0
REC2
R-x
R-0
 2004 Microchip Technology Inc.
x = Bit is unknown
x = Bit is unknown
REC1
R-x
R-0
REC0
R-x
R-0
bit 0
bit 0

Related parts for PCM18XK1