Skip to content

This repository contains an example of mcp2515 or mcp25625 operation with the SPI interface to MCU dsPIC33CK256MP506. Partly of this code is from Microchip's example (using another mcu).

Notifications You must be signed in to change notification settings

ChaoA51933/mcp25625-or-mcp2515-operation-based-on-dsPIC33CK256MP506

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 

Repository files navigation

mcp25625-or-mcp2515-operation-based-on-dsPIC33CK256MP506

Objective:

This repository contains an example of mcp2515 or mcp25625 operation with the SPI interface to MCU dsPIC33CK256MP506. Partly of this code is from Microchip's example (using another mcu).

Related Documentation:

  1. dsPIC33CK256MP508-Family-Data-Sheet-DS70005349H
  2. MCP25625-CAN-Controller-Data-Sheet-20005282C

Software Used:

  1. MPLAB® X IDE 5.40
  2. MPLAB® XC16 1.50
  3. MPLAB® Code Configurator (MCC) 3.95.0
  4. MPLAB® Code Configurator (MCC) Device Libraries PIC24 / dsPIC33 / PIC32MM MCUs 1.167.0
  5. Microchip dsPIC33CK-MP Series Device Support 1.4.102

Hardware Used:

  1. MCP25625 PICTail Plus Daughter Board (Part Number: ADM00617)
  2. Digital Power Development Board (Part Number: DM330029)
  3. dsPIC33CK256MP506 Digital Power PIM (Part Number: MA330048)
  4. MPLAB ICD 4 In-Circuit Debugger (Part Number: DV164045)
  5. CAN BUS Analyzer Tool (Part Number: APGDT002)

Setup:

The test boards I do the test is as follow.

The following picture describe the connection between these boards.

The spi clk between dsPIC33CK256MP506 and mcp25625 is 5MHz, spi mode is 0. All codes except the driver of mcp25625 are generated by mcc.

The ossicilator for mcp25625 is 20M, and the bitrate of CAN is 500k. TQ configuration are as follow,

  1. SYNC: 1TQ
  2. PROP_SEG: 7TQ
  3. PHASE_SEG1: 8TQ
  4. PHASE_SEG2: 4TQ
  5. SJW: 4TQ

Operation:

When run this example, if MCU received message formate like ID is from 0x100 to 0x1FF, and DLC is 1 byte, then MCU will send the same CAN message received out.

Summary:

Actually, this is one driver example for mcp25625&mcp2515, you could use these code for other MCU's use.

About

This repository contains an example of mcp2515 or mcp25625 operation with the SPI interface to MCU dsPIC33CK256MP506. Partly of this code is from Microchip's example (using another mcu).

Resources

Stars

Watchers

Forks

Packages