CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

CAN communication between SN65HVD234 and MCP2551
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ePowered RACING



Joined: 29 Dec 2020
Posts: 4

View user's profile Send private message

CAN communication between SN65HVD234 and MCP2551
PostPosted: Tue Dec 29, 2020 11:13 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Dec 29, 2020 2:19 pm     Reply with quote

You don't mention the processor you are using on each end, which is critical.
temtronic



Joined: 01 Jul 2010
Posts: 9229
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Dec 29, 2020 6:04 pm     Reply with quote

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: 1908

View user's profile Send private message

PostPosted: Tue Dec 29, 2020 7:43 pm     Reply with quote

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: 9229
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Dec 29, 2020 9:26 pm     Reply with quote

I was thinking he has or wants ...5 volt PIC and 3V CAN xcvr.......
newguy



Joined: 24 Jun 2004
Posts: 1908

View user's profile Send private message

PostPosted: Tue Dec 29, 2020 11:28 pm     Reply with quote

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: 19520

View user's profile Send private message

PostPosted: Wed Dec 30, 2020 1:03 am     Reply with quote

The classic problem. Much too little information. Sad

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

View user's profile Send private message

PostPosted: Wed Dec 30, 2020 6:23 am     Reply with quote

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: 19520

View user's profile Send private message

PostPosted: Wed Dec 30, 2020 7:43 am     Reply with quote

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: 9229
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Dec 30, 2020 8:07 am     Reply with quote

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: 19520

View user's profile Send private message

PostPosted: Wed Dec 30, 2020 8:17 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Dec 30, 2020 10:17 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Dec 30, 2020 1:53 pm     Reply with quote

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: 19520

View user's profile Send private message

PostPosted: Fri Jan 01, 2021 2:47 am     Reply with quote

It needs to be low on the 235 as well.

233 low
234 high
235 low
temtronic



Joined: 01 Jul 2010
Posts: 9229
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Jan 01, 2021 6:14 am     Reply with quote

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......
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group