Skip to main content
Visitor II
April 29, 2024
Solved

How to Convert From ISP to CAN

  • April 29, 2024
  • 4 replies
  • 2974 views

Hi

I got this problem where I got an MCP2515 that wants an ISP type signal, and then converts it to CAN. I am only familier with the CAN protocol and the HAL library, so is there an easy way to make the STM32 convert the code from CAN to ISP?

    This topic has been closed for replies.

    4 replies

    Graduate II
    April 29, 2024

    ISP ? You mean SPI

    You'll have to read the MCP2515 manual and write a driver that dispatches data you want sent via CAN, over the SPI bus in whatever Command/Data formatting the MCP2515 uses.

    Perhaps there are other examples of using MCP2515 on an MCU you can use as a starting point?

    Define Easy.. The HAL SPI implementation has several general examples of that symmetrical bus. Is there a cut-n-paste example you can simple copy? Hard to say, would suggest looking via Google and GitHub

    Super User
    April 29, 2024

    @Kenno wrote:

    I got an MCP2515 that wants an ISP (sic) type signal


    So this:

    AndrewNeil_0-1714407291935.png

    As it says on the tin, it's a "Stand-Alone CAN Controller with SPI Interface" - not "ISP".

    SPI is a very long-established and widely-used bused - you can find plenty of resources describing it; eg,

    https://en.wikipedia.org/wiki/Serial_Peripheral_Interface

    https://learn.sparkfun.com/tutorials/serial-peripheral-interface-spi/all

    Yes, STM32s - including the HAL - support SPI

     


    @Kenno wrote:

    is there an easy way to make the STM32 convert the code from CAN to ISP?


    I think you've missed the point of the MCP2515 !

    AndrewNeil_1-1714407751913.png

     

    It's the MCP2515 which does the "conversion" between CAN and SPI !

    You'll need to start by studying the MCP2515 documentation:

    https://www.microchip.com/en-us/product/mcp2515 

     

    Technical Moderator
    April 29, 2024

    Hello,

    STM32F3 has CAN instance. So all you need is an external CAN transceiver like MCP2551 not a CAN controller. So could you please explain why you would plan to use MCP2515 chip (CAN/SPI controller)? 

     

    mƎALLEmAnswer
    Technical Moderator
    April 29, 2024