beautypg.com

COMMELL MPX-2515 User Manual

Page 26

background image

Commell MPX-2515 User’s Guide Rev 0100

Taiwan Commate Computer Inc.

26

#define CCP_CAN_RX_MASKS_FILTERS 0X22
#define MCP_RX_FILTER_5 0X18
#define EP2 2 /* Endpoint 2 */
#define EP3 3 /* Endpoint 3 */

OFFSET

BULK OUT (EP2)

BULK IN (EP1)

SIZEOF_DATA

0X06

0X01

COMMAND

0X22

0X22

ERROR

0X00

Error code

DATA_0

0X18

Number of bytes written

DATA_1

0X04: Number of bytes
to write.

checksum

DATA_2

RXF5SIDH

DATA_3

RXF5SIDL

DATA_4

RXF5EID8

DATA_5

RXF5EID0

DATA_6

checksum

DATA_7

1.8 CCP_CAN_TX Service

1.8.1 Introduction to Message Transmission

TRANSMIT BUFFERS

The MCP2515 implements three transmit buffers. Each of these buffers occupies 14
bytes of SRAM and are mapped into the device memory map.

The first byte, TXBnCTRL, is a control register associated with the message buffer.
The information is this register determines the conditions under which the message
will be transmitted and indicates the status of the message transmission.

Five bytes are used to hold the standard and extended identifiers, as well as other
message arbitration information.

The last eight bytes are for the eight possible data bytes of the message to be
transmitted.

At a minimum, the TXBnSIDH, TXBnSIDL and TXBnDLC registers must be
loaded. If data bytes are present in the message, the TXBnDm registers must also be
loaded. If the message is to use extended identifiers, the TXBnEIDm registers must
aso be loaded and the TXBnSIDL.EXIDE bit set.

TRANSMIT PRIORITY