11c24 CAN speed

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

11c24 CAN speed

595 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by felorek on Wed Jan 15 10:54:38 MST 2014
Hi,
I'm running an example called "canopen on chip" and its bus baudrate is set to 125kbps, how can I change it to 1Mbits? I'm new to programming microntrolers so if u can explain it in easy way I would be very thankful. My microcontroler: LPCXpresso LPC 11C24 REV B (Designed by Embedded Artists NXP/Code red). I attached a code in case u wouldn't know about what example I'm talking about.

Original Attachment has been moved to: canopen_onchip.zip

Labels (1)
0 Kudos
Reply
3 Replies

478 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Thu Jan 16 15:00:58 MST 2014

Quote: felorek
SJW is 4 actually, right?


This value is SJW value of CANBT register, which is of course interpreted as SJW+1.

UM:

Quote:
Hardware interprets the value programmed into these bits as the bit value + 1.





Quote: felorek
And what for is it used?


SJW = '(Re)synchronization jump width' should be explained in every CAN description.

Like  The Configuration of the CAN Bit Timing

Quote:

The (Re-)Synchronization Jump Width (SJW) defines how far a resynchronization may move the Sample Point inside the
limits defined by the Phase Buffer Segments to compensate for edge phase errors.

0 Kudos
Reply

478 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by felorek on Wed Jan 15 16:00:50 MST 2014
SJW is 4 actually, right? And what for is it used?
0 Kudos
Reply

478 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Wed Jan 15 11:33:23 MST 2014
Your CAN baudrate setup is done here:
/* Initialize CAN Controller */
uint32_t ClkInitTable[2] = {
  0x00000000UL, // CANCLKDIV
  0x00001C57UL  // CAN_BTR
};



Sample 1MHz @ 48MHz main clock setup with late sample point:
//Initialize CAN Controller 48MHz-1000kbps
uint32_t ClkInitTable[2] = {
 0x00000000UL, //CANCLCLKDIV -> div: 0
 0x00002BC2UL, //CAN_BTR     -> BRP: 3, Quanta: 16, Seg1: 12, Seg2: 3, SJW: 3, Sample 81%
};


Explanation:

ZERO is explaining how to setup CAN baudrate...
0 Kudos
Reply