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 support@ccsinfo.com

Sort-of Off-Topic: CANBus with nodes of multiple speeds.

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
valemike
Guest







Sort-of Off-Topic: CANBus with nodes of multiple speeds.
PostPosted: Mon May 24, 2004 8:04 am     Reply with quote

I am posting this question here because 1. it is a PIC-based question and 2. I bought CCS's CAN development kit for reference purposes.

I am designing with a PIC that has a built-in CAN controller (PIC18F8680). Others in the company feel we need two CANbuses, and a few of us (me included) feel that I only need one.

CCS's demo kit has nodes clocked with 20MHz crystals, and can run at the CANbus's max speed of 1Mbps.

However, suppose I put a node on the CANbus that can only communicate at half the speed, say 400kbps. Can I mix nodes of lower speeds onto a CANbus with other nodes of very fast speeds without sacrificing the fast communication capabilities of the faster nodes?

Or is it good then to design an extra "slower" canbus?

Thanks,
Mike
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

PostPosted: Mon May 24, 2004 8:09 am     Reply with quote

I don't think it would be a problem for any of the slave nodes. What kind of master are you using?
valemike
Guest







PostPosted: Mon May 24, 2004 9:08 am     Reply with quote

Neutone wrote:
I don't think it would be a problem for any of the slave nodes. What kind of master are you using?


Using the PIC18F8680 as the master, as far as PIC to sensor communication goes.

Heck now that i think about it, i now have to figure out who is the master when it comes to similiar PIC-to-PIC embedded devices! Shocked

Neutone, so if the slave node is slow, it will just ignore all the fast communications going on between other faster nodes? I guess the first few bytes that specify the destination node must be slow enough for the slow node to deciper, right?
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

PostPosted: Mon May 24, 2004 9:38 am     Reply with quote

valemike wrote:
Neutone wrote:
I don't think it would be a problem for any of the slave nodes. What kind of master are you using?


Using the PIC18F8680 as the master, as far as PIC to sensor communication goes.

Heck now that i think about it, i now have to figure out who is the master when it comes to similiar PIC-to-PIC embedded devices! Shocked

Neutone, so if the slave node is slow, it will just ignore all the fast communications going on between other faster nodes? I guess the first few bytes that specify the destination node must be slow enough for the slow node to deciper, right?


I have never implimented CAN but I believe that the packets use a CRC. If a slave is listening at the wrong baud rate it will not get a valid packet. If it picks up some garbage it will timeout and clear the recieve buffer. The slave nodes are not a problem. The problem is dynamicly changing the master's baud rate. You don't want to do it too fast or you risk getting a reply at the wrong baud rate.
Hans Wedemeyer



Joined: 15 Sep 2003
Posts: 226

View user's profile Send private message

Re: Sort-of Off-Topic: CANBus with nodes of multiple speeds.
PostPosted: Mon May 24, 2004 10:13 am     Reply with quote

valemike wrote:
I am posting this question here because 1. it is a PIC-based question and 2. I bought CCS's CAN development kit for reference purposes.

I am designing with a PIC that has a built-in CAN controller (PIC18F8680). Others in the company feel we need two CANbuses, and a few of us (me included) feel that I only need one.

CCS's demo kit has nodes clocked with 20MHz crystals, and can run at the CANbus's max speed of 1Mbps.

However, suppose I put a node on the CANbus that can only communicate at half the speed, say 400kbps. Can I mix nodes of lower speeds onto a CANbus with other nodes of very fast speeds without sacrificing the fast communication capabilities of the faster nodes?

Or is it good then to design an extra "slower" canbus?

Thanks,
Mike

Mike,
I have implemmented CAN bus for upto 250 nodes ( using Linear drivers chips)
Your big problem is going to be keeping track of what node is running at what speed !
Remember the CAN is a safe protocol, message delivery is assured, and hardware will continue to attempt communication i.e. keep sending packets. until ack is received.

That is one of the issues with Wireless CAN how do you stop the hardware trying to communicate when a connection is lost.
Same thing applies to Wired CAN.
If the slave is at N baud rate and the master is at Nx2 Baud rate, Master will try to communicate with the salve, and of course the slave cannot receive, but the master will continue to send the packet unitl ack is received, there you have a problem.
I used the Microchip MCP2510 chips, I'm not sure if Microchip implemented an abort function in the PIC w/CAN.... If they did then you may be OK.

However I still is a can of worms.... What if the slave tried to communicate ! what speed should the master be set at ! I can see the BUS getting busy and things slowing down very fast...

Then you have the issue of slave to slave.... !

NO, don't do it. I recommend you select the fastest Baud rate your Wiring can handle and stick with it.

Just for referrence I ran 2000 feet (2K feet) at 20kbs cheap twisted pair wire and it worked just fine.


Last edited by Hans Wedemeyer on Thu May 27, 2004 10:17 pm; edited 1 time in total
Hans Wedemeyer



Joined: 15 Sep 2003
Posts: 226

View user's profile Send private message

Re: Sort-of Off-Topic: CANBus with nodes of multiple speeds.
PostPosted: Mon May 24, 2004 10:13 am     Reply with quote

I forgot.... I think this is very much ON topic....
Guest
Guest







Don't do it.
PostPosted: Thu May 27, 2004 1:52 pm     Reply with quote

Although it may be theoretically possible to program CAN nodes that are intelligent enough to pull this off, in reality it would be a nightmare. Infact, I am not even sure that it is theoretically possible. Don't waste your time. figure out what traffic will be on the bus, calculate the bus load for different bauds, and pick the slowest baud that keeps you around 60%. Good luck.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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