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 CCS Technical Support

CAN Bus Frequency Problem

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



Joined: 21 Dec 2005
Posts: 25

View user's profile Send private message

CAN Bus Frequency Problem
PostPosted: Wed Dec 28, 2005 12:41 pm     Reply with quote

I have been trying to get my CAN bus system to run at 1Mbaud. I have been trying to accomplish this using a 20mhz clock in my PICs. I have been able to use the baud rate calculator from Microchip that was mentioned in a couple of the other threads to up my baud rate to 500Kbaud but when I plug in 1Mbaud the calculator gives me the following warning:

According to MCP2510 Silicon Revision A Errata Sheet, the seetings you selected expose you to a "Minimum Bus Idle Time" problem. You currently have 20 OSCI clocks and the minumum is 26. From what I could find about the error it doesn't seem like it would effect my test bench setup. (For now I am only sending a can message once a second)

None the less the program continues and gives me values for the BRBCON1,BRGCON2,BRGCON3 registers. The values it gives me are 0x00,0xA0, 0x02. When I plug these in the same way as I did with the 500kBaud program the can bus no longer communicates.

Anybody have values for a 20mhz clock that work for a 1Mbaud CAN bus? Is it even possible to try and run a 1Mbaud CAN bus with a 20mhz oscillator?

Thanks in advance for the help!
newguy



Joined: 24 Jun 2004
Posts: 1907

View user's profile Send private message

PostPosted: Wed Dec 28, 2005 12:47 pm     Reply with quote

http://www.ccsinfo.com/forum/viewtopic.php?t=22138&highlight=timing
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Dec 28, 2005 12:48 pm     Reply with quote

Post the PIC or CAN chip you're using. The bit time calculator
gives a message for MCP2510, but you didn't state that you're
using that chip.
ralpok



Joined: 21 Dec 2005
Posts: 25

View user's profile Send private message

PostPosted: Wed Dec 28, 2005 1:15 pm     Reply with quote

I am using 2 different PICS, one is the PIC18F4580 and the other is the PIC18F6680. I am using the PCA82c251 CAN chip on both of them. Thanks for the help.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Dec 28, 2005 1:50 pm     Reply with quote

My first thought is that your Prop time might be a little low.
I would try increasing it to 2 quanta, and also try setting the
sampling point at 80%. If that doesn't work then try 3 quanta
for the Prop time. Make sure the bit timing calculator says
it's all OK.

Also make sure your drivers are setup for high speed mode.
This means the Rs pin should be connected to ground.
ralpok



Joined: 21 Dec 2005
Posts: 25

View user's profile Send private message

PostPosted: Thu Dec 29, 2005 4:43 pm     Reply with quote

Thanks for all your help. The problem ended up being that I needed a small load resistor across the CAN hi and CAN Lo. When I placed a 100 ohm resistor across these lines the CAN bus ran at 1Mhz just fine!. Thanks a lot for your help and input

Thanks,
Ralpok
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Dec 29, 2005 5:04 pm     Reply with quote

CAN bus always requires the termination resistors (at any bus speed).
The spec is 120 ohms. See the diagram on this page:
http://www.interfacebus.com/Design_Connector_CAN.html
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