Skip to content
This repository was archived by the owner on Apr 13, 2024. It is now read-only.

Commit 603c4d9

Browse files
Update CAN baud rate to 1Mbps
1 parent 593a68d commit 603c4d9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/can.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ static CAN_HandleTypeDef hcan;
4545
void can_init(void)
4646
{
4747
/*
48-
CAN baud rate configured to 100kbps
48+
Input clock is 36MHz
49+
CAN baud rate configured to 1Mbps
4950
Determine bit timings with a calculator such as http://www.bittiming.can-wiki.info/
5051
*/
5152

@@ -60,7 +61,7 @@ void can_init(void)
6061

6162
// configure peripheral
6263
hcan.Instance = CAN;
63-
hcan.Init.Prescaler = 20;
64+
hcan.Init.Prescaler = 2;
6465
hcan.Init.Mode = CAN_MODE_NORMAL;
6566
hcan.Init.SyncJumpWidth = CAN_SJW_1TQ;
6667
hcan.Init.TimeSeg1 = CAN_BS1_15TQ;

0 commit comments

Comments
 (0)