View previous topic :: View next topic |
Author |
Message |
ralpok
Joined: 21 Dec 2005 Posts: 25
|
CAN Bus Frequency Problem |
Posted: Wed Dec 28, 2005 12:41 pm |
|
|
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: 1908
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Dec 28, 2005 12:48 pm |
|
|
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
|
|
Posted: Wed Dec 28, 2005 1:15 pm |
|
|
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
|
|
Posted: Wed Dec 28, 2005 1:50 pm |
|
|
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
|
|
Posted: Thu Dec 29, 2005 4:43 pm |
|
|
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
|
|
|
|