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

Post History

66%
+2 −0
Q&A CAN bus open circuit detection

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 ...

1 answer  ·  posted 5mo ago by DeadMouse‭  ·  last activity 5mo ago by Olin Lathrop‭

Question CAN-bus pic18
#2: Post edited by user avatar DeadMouse‭ · 2024-07-18T17:51:01Z (5 months ago)
  • 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?
  • 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?
#1: Initial revision by user avatar DeadMouse‭ · 2024-07-18T17:50:09Z (5 months ago)
CAN bus open circuit detection
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?