Page 1 of 1

Internal CAN baud

Posted: Tue Oct 15, 2013 12:39 pm
by gritt
In the code for the macro CAN init it states that when using internal CAN, to achieve the correct baud a 20MHz crystal must be used.
I need to achieve a baud of 1Mbps and am using a 32MHz crystal. I was planning on using BRGCON1 = 0x00, BRGCON2 = 0xAD and BRGCON3 = 0x02 (based on the bit timing calculator here http://www.kvaser.com/en/support/bit-ti ... lator.html. Does this mean my baud will be incorrect? Is there a workaround to achieve the correct baud when not using a 20MHz crystal?

Thanks

James

Re: Internal CAN baud

Posted: Tue Oct 15, 2013 3:40 pm
by LeighM
Hi James,

The comment about 20MHz crystal applies to CNF1/2/3 values calculated by Flowcode from the selected Bus Rate for the external CAN.
If you use internal CAN and set BRGCON values to those you have calculated for the 32MHz crystal then you should be OK.

Leigh

Re: Internal CAN baud

Posted: Tue Oct 15, 2013 3:44 pm
by gritt
Thanks, Leigh. I'll give it a go.

James

Re: Internal CAN baud

Posted: Tue Oct 15, 2013 6:08 pm
by gritt
This may be a silly question, but what difference does HS or HS-PLL make to the CAN baud? I am using HS-PLL with a 32MHz crystal and can't get any messages through above a baud of 250kbps. Because I am using HS-PLL is this calculated 250kbps actually 1Mbps?

Thanks

James

Re: Internal CAN baud

Posted: Wed Oct 16, 2013 9:21 am
by LeighM
Yes, if you are using the PLL then you will have to take this into account when calculating the BRGCON values. You will need to check the datasheet for the processor to determine the PLL frequency and any postscaler divider from which the CAN clock is derived.