Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: CAN baudrate setting

2005-02-22 by peterburdine

I've tried making a spreadsheet for this, but I haven't had a chance
to actually test the timings.  But here are the answers I come up
with.  These calculations are for SAM = 1 only.

Solution Set #1:
BRP = 15
SJW = 4
TSeg2 = 4-6
TSeg1 = 10-8
TSeg1 + Tseg2 should be 14

So the values for this set should be 
0x0057C00F (Tseg1 = 8)
0x0048C00F (Tseg1 = 9)
0x0039C00F (Tseg1 = 10)

Solution Set #2:
BRP = 10
SJW = 3-4
Tseg2 = 3-4
Tseg1 = 6-5
Tseg1 + Tseg2 = 9
0x0025800A (SJW = 3, Tseg2=3, Tseg1 = 6)
You can probably figure the rest of them out.

Solution Set #3
BRP = 6
SJW = 2-4
Tseg2 = 2
Tseg1 = 3

Please let me know if any of these work.  If my spreadsheet works,
then I might post it, but I won't get a chance to test any of this
works for a couple of weeks.

Assumptions made, deltaF = 1%, bus length = 10 meters max, propagation
time = 6.5m/ns, logic delay and loop delay = 200ns

--Peter




--- In lpc2000@yahoogroups.com, "mouaaz" <mouaaz@y...> wrote:
> 
> Dear all,
> 
> I am using two LPC2129 boards having 12 MHz clock, with CCLK and PCLK 
> set to 60 MHz. They are connected via a CAN link. I am trying to set 
> the bus timing register C1BTR to run the CAN at the baudrate of 1 
> Mbit/s. The value I tried is :
> 
>    C1BTR = 0x34C005;
> 
> But it did not work. 
> 
> Anybody can help me to work out the correct setting of this register 
> to let the CAN go for 1 Mbaud.
> 
> Thanks very much.
> 
> Mouaaz
> 
> PS. the correct setting for 125 kbaud was: C1BTR = 0x001C001D;

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.