View previous topic :: View next topic |
Author |
Message |
ePowered RACING
Joined: 29 Dec 2020 Posts: 4
|
CAN communication between SN65HVD234 and MCP2551 |
Posted: Tue Dec 29, 2020 11:13 am |
|
|
Hello,
I am really new in CCS and I have some problems with CAN communication.
I have some PCBs with the MCP2551 transceiver and I could communicate them. Now, I want to add another PCB to the CAN bus, this one has the SN65HVD234 transceiver, since all the PCB is 3.3V supplied, but I could not communicate with it.
I think that the problem is that I need a different library than the one I use with the MCP2551 boards, but I do not find anything on internet. What do you think about the problem, it could be the library? Please, could anyone help me?
Thank you! |
|
|
gaugeguy
Joined: 05 Apr 2011 Posts: 303
|
|
Posted: Tue Dec 29, 2020 2:19 pm |
|
|
You don't mention the processor you are using on each end, which is critical. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9226 Location: Greensville,Ontario
|
|
Posted: Tue Dec 29, 2020 6:04 pm |
|
|
The devices essentially do the same function translate ones and zeros from a logice level to a CANbus level and viceversa, so the same 'driver' should work though I didn't look at say 'enable' pins, if they have them. I don't use CAN bus, so you'll have to check the datasheets.
However the big problem will be VDD and logic levels.
The mcp2551 is a 5 volt devcie, the Sn65 is a 3 volt device, so you can't just
swap them. The PIC and other devices will have to designed to run on 3 volts.
Also there may be differences in required pullups or bias resistors ? |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1907
|
|
Posted: Tue Dec 29, 2020 7:43 pm |
|
|
Actually you can mix 5V CAN drivers and 3.3V CAN drivers on the same bus interchangeably. No issues at all. CAN is CAN.
- For troubleshooting ensure that you have only 2 nodes on the bus.
- Ensure both ends of the bus have proper terminations (120 ohm).
- Ensure that CANH, CANL and GND are connected from one PCB to the other. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9226 Location: Greensville,Ontario
|
|
Posted: Tue Dec 29, 2020 9:26 pm |
|
|
I was thinking he has or wants ...5 volt PIC and 3V CAN xcvr....... |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1907
|
|
Posted: Tue Dec 29, 2020 11:28 pm |
|
|
From his description he's mixing a 5V node and a 3.3V node without any luck. I've done the same many, many times without issues.
...The first time I agonized over, researched, worried. And it just worked. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19513
|
|
Posted: Wed Dec 30, 2020 1:03 am |
|
|
The classic problem. Much too little information.
Can bus itself, is happy to mix 5v and 3.3 v devices. The bus uses it's own
specified voltages, and these are the same from the different devices.
However his 3.3v node, implies having to use a PIC specified for 3.3v.
He has not told us what PIC he is using?.
The setup for the software will depend on the PIC he is using.
As Jay says, if he is using a 5v PIC, with a 3.3v CAN transceiver, then
'problems will result'.
To build a 3.3v PIC node, implies having a board powered from 3.3v, and
having a 3.3v PIC, with all the other devices on this node also being
3.3v powered. Every bit of this board needs to support 3.3v operation,
or level translation will be needed. |
|
|
ePowered RACING
Joined: 29 Dec 2020 Posts: 4
|
|
Posted: Wed Dec 30, 2020 6:23 am |
|
|
The PIC I am using is 18LF4585, which works with 3.3V. Also, all the components I have on the board work with 3.3V. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19513
|
|
Posted: Wed Dec 30, 2020 7:43 am |
|
|
OK.
You are sure your PIC is running at the speed it is being told it is in the
clock statement?. CAN is timing dependant.
Also, the SN65HVD234 needs pin 5 pulled to 0v. The MCP2551 needs this
either used for an external location to get access to the Vref, or left disconnected. A small difference, but important.... |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9226 Location: Greensville,Ontario
|
|
Posted: Wed Dec 30, 2020 8:07 am |
|
|
Good news is 3 volt PIC, 3 volt peripheral !!
I was curious, so I downloaded the device datasheets.
It turns out they are 'mostly' pin compatible BUT as Mr. T points out there are differences ! So you'll have to configure the new device to 'look' like the old one. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19513
|
|
Posted: Wed Dec 30, 2020 8:17 am |
|
|
Also another comment. If you are running at 3.3v, the 18LF4585 is rated for
operation at 25.268MHz maximum. What clock rate are you using?. |
|
|
ePowered RACING
Joined: 29 Dec 2020 Posts: 4
|
|
Posted: Wed Dec 30, 2020 10:17 am |
|
|
I programmed my PIC to work with 20 MHz, since it is the crystal oscillator I use on my board. I don’t know exactly if you refer to this.
About the pin 5 pulled to 0v, do you mean I need to connect ES to GND?
I have connected ES to 3.3v, because reading the datasheet I understand that is what I need to do to get the high speed mode. Acordingly, I connected RS to GND. |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Wed Dec 30, 2020 1:53 pm |
|
|
If you have the VD234 variant then the datasheet says pin 5 is EN (Enable)
and needs to be tied to 3.3V.
On the VD233 it is LBK (loopback) and needs
to be tied to ground (0V) _________________ Google and Forum Search are some of your best tools!!!! |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19513
|
|
Posted: Fri Jan 01, 2021 2:47 am |
|
|
It needs to be low on the 235 as well.
233 low
234 high
235 low |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9226 Location: Greensville,Ontario
|
|
Posted: Fri Jan 01, 2021 6:14 am |
|
|
yeesh...serial communications was a lot simpler in the dinosaur days of current loops and Teletypes!
Must be 'fun' trying to read WHICH part you've got,233,235,234...all look the same unless you have a 100x mag to SEE them... DIPs are bad enough for me these days ,but SMT ? sigh...... |
|
|
|