beautypg.com

COMMELL MPX-2515 User Manual

Page 11

background image

Commell MPX-2515 User’s Guide Rev 0100

Taiwan Commate Computer Inc.

11

ERROR

0X00

Error code

DATA_0

0X04

Number of byte written (0X01)

DATA_1

Desired rate.

Checksum

DATA_2

Checksum

DATA_3

DATA_4

DATA_5

1.5.5 CAN_RESET_INSTRUCT

The CAN_RESET_INSTRUCT implements MCP2515 Reset Instruction. The Reset
instruction can be used to re-initialize the internal registers of the MCP2515 and set
Configuration mode. This command provides the same functionality, via the SPI
interface, as the RESET# pin.

#define CCP_CAN_SYSTEM_SERVICE 0X20 /* COMMAND: command code */
#define MCP2515_RESET_INSTRUCT 0X85 /* DATA_0: sub-command code
*/
#define EP2 2 /* Endpoint 2 */
#define EP3 3 /* Endpoint 3 */

OFFSET

BULK OUT (EP2)

BULK IN (EP1)

SIZEOF_DATA

0X01

0X00

COMMAND

0X20

0X20

ERROR

0X00

Error code

DATA_0

0X85

CHECKSUM

DATA_1

CHECKSUM

DATA_2

DATA_3

DATA_4

DATA_5

Table 6 CAN_RESET_INSTRUCT Format

1.5.6 CAN_READ_INSTRUCT

The CAN_READ_INSTRUCT implements MCP2515 Read Instruction. The Read
instruction is started by lowering the CS# pin. The Read instruction is then sent to
the MCP2515 followed by the 8-bit address (A7 through A0). Next, the data stored
in the register at the selected address will be shifted out on the SO pin.

The internal address pointer is automatically incremented to the next address once
each byte of data is shifted out. Therefore, it is possible to read the next consecutive
register address by continuing to provide clock pulses. Any number of consecutive