DatasheetQ Logo
Electronic component search and free download site. Transistors,MosFET ,Diode,Integrated circuits

PIC18F4580ISOSQTP 查看數據表(PDF) - Microchip Technology

零件编号
产品描述 (功能)
生产厂家
PIC18F4580ISOSQTP Datasheet PDF : 490 Pages
First Prev 291 292 293 294 295 296 297 298 299 300 Next Last
PIC18F2480/2580/4480/4580
REGISTER 24-21: RXERRCNT: RECEIVE ERROR COUNT REGISTER
R-0
REC7
bit 7
R-0
REC6
R-0
REC5
R-0
REC4
R-0
REC3
R-0
REC2
R-0
REC1
R-0
REC0
bit 0
Legend:
R = Readable bit
-n = Value at POR
W = Writable bit
‘1’ = Bit is set
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared
x = Bit is unknown
bit 7-0
REC<7:0>: 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.
EXAMPLE 24-5: READING A CAN MESSAGE
; 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 RXB0CON, RXFUL
; Does RXB0 contain a message?
BRA
NoMessage
; No. Handle this situation...
; 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 RXB0SIDL, EXID
; Is this Extended Identifier?
BRA
StandardMessage
; No. This is Standard Identifier message.
; Yes. This is Extended Identifier message.
; Read all 29-bits of Extended Identifier message.
...
; Now read all data bytes
MOVFF RXB0DO, MY_DATA_BYTE1
...
; Once entire message is read, mark the RXB0 that it is read and no longer FULL.
BCF
RXB0CON, RXFUL
; This will allow CAN Module to load new messages
; into this buffer.
...
© 2009 Microchip Technology Inc.
DS39637D-page 299

Share Link: 

datasheetq.com  [ Privacy Policy ]Request Datasheet ] [ Contact Us ]