Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Comments on CAN bus open circuit detection

Post

CAN bus open circuit detection

+2
−0

I have a PIC18 and I'm trying to detect whether it is connected on the CAN bus or not.

When the PIC is not connected on the bus, and I load the transmit buffers, after setting the TXREQ flag. The transmission does not start. This is also mentioned in the datasheet:

Setting the TXREQ bit does not initiate a message transmission.

However I cannot find a reliable way to detect that the PIC is not plugged into a healthy bus.

Also, no errors in the registers appear.

The only thing I can think of is polling the TXREQ flag for a few milliseconds to check if the peripheral initiated a transmission or not.

But I'm not sure if that is a reliable algorithm. If yes, how much should that timeout be? 1ms or 100ms?

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

1 comment thread

Heartbeat message on the CAN bus (2 comments)
Heartbeat message on the CAN bus
Nick Alexeev‭ wrote 4 months ago

Are you designing the entire system? Or are you plugging into an existing system? A lot of systems have a periodic "heartbeat" message on the CAN bus. When your PIC sees the message then it knows it's connected to CAN.

DeadMouse‭ wrote 4 months ago

I'm designing a system that will be plugged into a car's CAN bus.