Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 18, 2018, 05:20:07 05:20


Login with username, password and session length


Pages: [1]
Print
Author Topic: can bus - mcp2551 - defected signal  (Read 1968 times)
0 Members and 1 Guest are viewing this topic.
Elysion
Newbie
*
Offline Offline

Posts: 14

Thank You
-Given: 23
-Receive: 1


« on: September 20, 2018, 10:45:22 10:45 »

Hi all,

I'm trying to run canbus between a STM32f107 and a PIC18F4685. Sender is STM32F107.
If I don't use PIC TXD, it can receive data from STM32 (without an ack). If I use PIC TXD pin connected ACK/NACK portion signal gets disturbed.
Only the last portions are bad. The bad parts are at "CRC Del"-"ACK slot bit" and at "ACK Del".
I use termination resistors. Can bus resistance is 64ohms. What can cause to this? I'm exhausted on solutions.



thanks for your help,
Oguz
Logged
Signal
Active Member
***
Offline Offline

Posts: 167

Thank You
-Given: 89
-Receive: 71


« Reply #1 on: September 20, 2018, 12:44:21 12:44 »

I did not work with this particular PIC. But still have some thoughts.

At first try to say more what is on picture.

By what resistance value the MCP2551 is enabled? Try to connect it directly to GND.

And I'd check the opposite direction just to see how this node is able to transmit and what actual bitrate is set.

Check power line feeding transceiver. At dominant bit transmission a transceiver passes about 100mA. If power supply is weaker then dominant bit can look like on your picture I think.

Keep in mind that correctly configured ECAN module with this transceiver just works.
Logged

Give a right name to a right game and play it right
vern
V.I.P
Junior Member
*****
Offline Offline

Posts: 93

Thank You
-Given: 7
-Receive: 21


« Reply #2 on: September 20, 2018, 04:00:45 16:00 »

check if the PIC's power supply is well buffered with a ceramic capacitor, at least 100nF plus a large one with several uF.
Do you have termination resistors on both sides? What's your cable length?
Logged
Signal
Active Member
***
Offline Offline

Posts: 167

Thank You
-Given: 89
-Receive: 71


« Reply #3 on: September 22, 2018, 09:53:40 09:53 »

Another point. Both nodes have to share the same ground. Recessive state on picture behaves like grounds are not equal. It could work in some extends but ground connection is still needed.
Logged

Give a right name to a right game and play it right
bigtoy
Active Member
***
Offline Offline

Posts: 193

Thank You
-Given: 193
-Receive: 257


« Reply #4 on: September 26, 2018, 02:54:13 14:54 »

Any chance of posting schematics? Agree with Signal on the grounding question - are you running a ground line between the STM and the PIC? The MCP2551 is not an isolated transceiver so running a ground line in parallel with the CANH / CANL lines is critical - the MCP2551 will only tolerate a very amount of common-mode voltage (ground voltage mismatch) before it gets upset. The left side of the scope plot shows the recessive state is not in the center of the dominant state - this certainly indicates a grounding problem. If the STM32 and the PIC are on different boards and for some reason a ground cannot be shared, consider using an isolated CAN transceiver instead (eg the TI ISO1050).
Logged
Sideshow Bob
Cracking Team
Hero Member
****
Offline Offline

Posts: 597

Thank You
-Given: 196
-Receive: 624



« Reply #5 on: September 27, 2018, 06:36:40 06:36 »

Have you read and understood the datasheet for the PIC 100% correct. Setting up any function on a PIC most often requires a lot of bit twiddling. And it take a lot of datasheet reading to get it all correct. And often they differ somewhat from  series to series of PICs. So if you use some premade code for PIC in series A it might not work properly on PIC in series B. You can use the simulator in MPLAB to check the register settings
« Last Edit: September 27, 2018, 06:51:35 06:51 by Sideshow Bob » Logged

I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum
dennis78
Junior Member
**
Offline Offline

Posts: 91

Thank You
-Given: 197
-Receive: 133


« Reply #6 on: September 28, 2018, 06:40:36 06:40 »

Try this way to eliminate CAN driver dilemma. Use short wires. Of course, don't forget to connect grounds  Wink



« Last Edit: September 28, 2018, 07:07:17 07:07 by dennis78 » Logged
Signal
Active Member
***
Offline Offline

Posts: 167

Thank You
-Given: 89
-Receive: 71


« Reply #7 on: September 28, 2018, 10:02:41 10:02 »

Try this way to eliminate CAN driver dilemma. Use short wires. Of course, don't forget to connect grounds  Wink
While you suggest to exclude influence of transceivers for debug purpose I suggest a slightly different off-topic. But while the original question most likely is a fake activity, why not to discuss an off-topic? Wink

One choosing CAN physical interface for his project has not a dilemma but at least "trilemma". I know three standards de-facto: High Speed, Fault Tolerant and Single Wire with appropriate transceivers. Then speaking about transceiverless option it might be interesting for you that some microcontrollers have a feature to set CAN TX pin to open-drain mode instead of push-pull. So instead of dominant high level there will be high impedance state at transmitting ones. That feature can be considered as cool - you can eliminate diodes from picture above connecting all RX and TX pins of all nodes directly. It turns to more expensive but much more powerful alternative to I2C.
Logged

Give a right name to a right game and play it right
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC