Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 24, 2024, 07:25:42 07:25


Login with username, password and session length


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

Posts: 14

Thank You
-Given: 27
-Receive: 1


« on: September 20, 2018, 04:45:22 16: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: 200

Thank You
-Given: 113
-Receive: 81



« Reply #1 on: September 20, 2018, 06:44:21 18: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
Active Member
*****
Offline Offline

Posts: 146

Thank You
-Given: 7
-Receive: 42


« Reply #2 on: September 20, 2018, 10:00:45 22: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: 200

Thank You
-Given: 113
-Receive: 81



« Reply #3 on: September 22, 2018, 03:53:40 15: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: 238

Thank You
-Given: 337
-Receive: 297


« Reply #4 on: September 26, 2018, 08:54:13 20: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: 1002

Thank You
-Given: 231
-Receive: 983



« Reply #5 on: September 27, 2018, 12:36:40 12: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, 12:51:35 12:51 by Sideshow Bob » Logged

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

Posts: 122

Thank You
-Given: 272
-Receive: 154


« Reply #6 on: September 28, 2018, 12:40:36 12: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, 01:07:17 13:07 by dennis78 » Logged
Signal
Active Member
***
Offline Offline

Posts: 200

Thank You
-Given: 113
-Receive: 81



« Reply #7 on: September 28, 2018, 04:02:41 16: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