Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of CANnucleo by
Diff: can_api.c
- Revision:
- 17:1fd35431ee8e
- Parent:
- 16:f4c8f45bded9
--- a/can_api.c Wed Dec 30 08:23:30 2015 +0000
+++ b/can_api.c Wed Dec 30 08:39:54 2015 +0000
@@ -155,9 +155,9 @@
printf("Unknown frequency specified!\r\n");
printf("Using default 125kbps\r\n");
#endif
- _canHandle.Init.Prescaler = 30; // number of time quanta = 45000000/30/125000 = 12
+ _canHandle.Init.Prescaler = 18; // number of time quanta = 36000000/18/125000 = 16
_canHandle.Init.SJW = CAN_SJW_1TQ;
- _canHandle.Init.BS1 = CAN_BS1_8TQ; // sample point at: (1 + 8) / 12 * 100 = 75%
+ _canHandle.Init.BS1 = CAN_BS1_11TQ; // sample point at: (1 + 11) / 16 * 100 = 75%
_canHandle.Init.BS2 = CAN_BS2_4TQ;
}
@@ -204,10 +204,10 @@
printf("Unknown frequency specified!\r\n");
printf("Using default 125kbps\r\n");
#endif
- _canHandle.Init.Prescaler = 18; // number of time quanta = 36000000/18/125000 = 16
+ _canHandle.Init.Prescaler = 30; // number of time quanta = 45000000/30/125000 = 12
_canHandle.Init.SJW = CAN_SJW_1TQ;
- _canHandle.Init.BS1 = CAN_BS1_11TQ; // sample point at: (1 + 11) / 16 * 100 = 75%
- _canHandle.Init.BS2 = CAN_BS2_4TQ;
+ _canHandle.Init.BS1 = CAN_BS1_8TQ; // sample point at: (1 + 8) / 12 * 100 = 75%
+ _canHandle.Init.BS2 = CAN_BS2_3TQ;
}
#endif
