2024-04-29 07:35 AM
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?
Solved! Go to Solution.
2024-04-29 11:20 AM - edited 2024-04-29 11:23 AM
+ Have a look at the following threads:
https://community.st.com/t5/stm32-mcus-products/mcp2515-with-stm32f429/m-p/109379
https://community.st.com/t5/stm32-mcus-products/mcp2515-module-library/td-p/220994
2024-04-29 08:58 AM
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
2024-04-29 09:22 AM - edited 2024-04-29 09:43 AM
@Kenno wrote:I got an MCP2515 that wants an ISP (sic) type signal
So this:
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 !
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
2024-04-29 10:59 AM - edited 2024-04-29 11:04 AM
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)?
2024-04-29 11:20 AM - edited 2024-04-29 11:23 AM
+ Have a look at the following threads:
https://community.st.com/t5/stm32-mcus-products/mcp2515-with-stm32f429/m-p/109379
https://community.st.com/t5/stm32-mcus-products/mcp2515-module-library/td-p/220994