pub
Fork of CANnucleo by
Diff: can_api.c
- Revision:
- 17:1fd35431ee8e
- Parent:
- 16:f4c8f45bded9
- Child:
- 20:bcd8161f8f6c
diff -r f4c8f45bded9 -r 1fd35431ee8e can_api.c --- 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