CAN-Bus Wireless Bridge

Thread Starter

Spegs21

Joined Jun 22, 2015
4
I basically want to create a wireless bridge in place of a CAN cable. I plan on using an MCP2515 and an MCP2551 along with a RN131.

So far a have found this schematic for the CAN interface. I plan on using the SPI interface to communicate with the RN131.

My question is what would I do with the INT1 pin in the schematic? Is it important in this application? What about ADC0?

I guessing if I configure one of the RN131s to act as a soft access point and the other to connect to it they would pass the data, correct?
 

Papabravo

Joined Feb 24, 2006
21,094
The INT1 pin from the CAN controller to a microprocessor somewhere is used to tell that microcontroller that a CAN frame has arrived in the receiver FIFO, OR that the transmitter is finished and ready to send another frame, OR that the CAN node has gone BUSOFF. It is essential for the proper functioning of a CAN network.

Here is my problem. How are your going to connect two peripheral devices together and have them engage in any meaningful conversation? Answer is it ain't gonna happen.
You might be thinking of replacing the CAN controller with the RN131 in which case the schematic is irrelevant since SPI is SPI and you don't need interrupts for an SPI link to a peripheral device.

ADC0 just allows you to detect the presence of th +12V supply. You can keep it or lose it as the mood moves you.
 

Thread Starter

Spegs21

Joined Jun 22, 2015
4
The INT1 pin from the CAN controller to a microprocessor somewhere is used to tell that microcontroller that a CAN frame has arrived in the receiver FIFO, OR that the transmitter is finished and ready to send another frame, OR that the CAN node has gone BUSOFF. It is essential for the proper functioning of a CAN network.

Here is my problem. How are your going to connect two peripheral devices together and have them engage in any meaningful conversation? Answer is it ain't gonna happen.
You might be thinking of replacing the CAN controller with the RN131 in which case the schematic is irrelevant since SPI is SPI and you don't need interrupts for an SPI link to a peripheral device.

ADC0 just allows you to detect the presence of th +12V supply. You can keep it or lose it as the mood moves you.
All that I'm looking to do is replace the physical layer. Instead of using a cable I want to use wireless communication. So I guess maybe I don't need the MCP2515 and I just could connect the TXD and RXD from the MCP2551 to the RN131?
 

Papabravo

Joined Feb 24, 2006
21,094
The MCP2515 is the CAN Controller; and the MCP2551 is the CAN transceiver. I think you replace both of them with the RN131. The microprocessor that used the SPI interface to talk to the CAN Controller now talks to the RN131. At the other end of the wireless link is another RN131 that talks to its microprocessor via SPI. Do I have the setup of what you are trying to do. There should be no vestiges of CAN remaining in that system. AFAIK you can't take the output of the CAN controller and run it to the RN131. You need to express your intentions with a great deal more clarity than you have exhibited so far. I'm not a freakin' mind reader and what you alluded to so far makes absolutely no sense to me. Maybe if we had a schematic of what you are thinking about it would help, but maybe not.

Maybe you want a device with both an RN131 AND an MCP2515/MCP2551. That way messages on the CAN Bus can be passed to the RN131 and vice versa. Is that what you are talking about?
 

Thread Starter

Spegs21

Joined Jun 22, 2015
4
The MCP2515 is the CAN Controller; and the MCP2551 is the CAN transceiver. I think you replace both of them with the RN131. The microprocessor that used the SPI interface to talk to the CAN Controller now talks to the RN131. At the other end of the wireless link is another RN131 that talks to its microprocessor via SPI. Do I have the setup of what you are trying to do. There should be no vestiges of CAN remaining in that system. AFAIK you can't take the output of the CAN controller and run it to the RN131. You need to express your intentions with a great deal more clarity than you have exhibited so far. I'm not a freakin' mind reader and what you alluded to so far makes absolutely no sense to me. Maybe if we had a schematic of what you are thinking about it would help, but maybe not.

Maybe you want a device with both an RN131 AND an MCP2515/MCP2551. That way messages on the CAN Bus can be passed to the RN131 and vice versa. Is that what you are talking about?
I have a J1939 Deutsch connector on either side. I have no access to the microprocessor on either side of the connection. One side is the programmer, the other is the truck. All I want to do is have CAN-H and CAN-L connected wirelessly between the programmer and truck such that it communicates no differently than if it were connected with a cable. I don't know how I can explain this and make it any more simple and I don't think a schematic would net any benefit. There isn't much of anything to draw out.

This seemed like a nice community, I didn't expect to be berated for asking a simple question. Sorry if it didn't like up to your standard of detail. I figured the request was simple enough. I guess I had the wrong idea.
 

Papabravo

Joined Feb 24, 2006
21,094
Yes, you did have the wrong idea, and this is still a nice community. This is not second grade and we don't give out "good jobs" for every question. There is no viable way to do what you want to do without involving a microcontroller of your own to talk to the two peripherals. The wireless device knows nothing about CAN(J1939) bus, and the CAN(J1939) bus knows nothing about the wireless device. You need to think about:
  1. Making two identical devices that have a microcontroller, an RN131, and an MCP2515/MCP2551
  2. Developing a protocol that will exchange CAN frames in a seamless fashion over the wireless link.
  3. Dealing with the latency involved in a round trip transaction.
The original omission of the J1939 aspect of the CAN bus was kind of critical. I'm sorry you're not up to the ability to specify your requirements in a more helpful way. You also must understand this is not a simple "slap it together in a weekend of hacking" kind of project. If you had come up with a schematic for the device mentioned in part 1 above your requirements would have been a great deal clearer. Just because you think it is a simple question does not make it one.

One more thing: I have constructed an RS-232 to CAN bridge so I might know a thing or two about the requirements of the device you are looking for.
 

Thread Starter

Spegs21

Joined Jun 22, 2015
4
Ok, thanks for the explanation. I have researched some CAN to RS-232 solutions and RS-232 to wifi as well. I have no problem using prebuilt solutions if they exist. I have found this CAN adapter and this Wifi adapter. I have used a similar wireless bluetooth adapter for a more simple project so have some experience with them. Would using these together suffice or would there be issues with latency?
 

Papabravo

Joined Feb 24, 2006
21,094
I really can't tell you if adding a third ingredient, RS-232, to the mix will make things better or worse. I guess you could run the experiment.
 
Top