I am a newbie in electronics and PCB design. Please forgive me for my silly sounded questions.
I would like to connect the CAN bus, which has an MCP2515 chip, to the Heltec LoRa v2 module. However, as SPI pins are used by the LoRa inside the module, I can’t seem to find the solution for CAN bus comms.
After a bit of research online, I’ve come across a library called “SoftSPI.h”. In the library, there is no mention of the “CS” or “SS”.
Could any of you please enlighten me more about the issue? The above information may not be relevant to what I want to achieve at all as I’m a beginner.
SPI is a bus so you can connect more than one device to it, you just have to ensure you have a separate CS signal for each of them. So connect the MCP2515 to MISO, MOSI and SCKL as the LoRa is and use one of the free pins for CS.
Ensure you set that CS pin HIGH early in your code (start of setup()).
I've hooked up my wires for CAN as follows:
CS - IO pin 22
MOSI - 23
MISO - 13
SCK - 17
I am planning on defining those numbers in the software serial in the code. Do you think that they are wired correctly?
Or
if I choose your way, will it do anything harmful to the LoRa signal?