Skip to content

Commit 08a5117

Browse files
committed
add timing for 47kbps
1 parent ee50312 commit 08a5117

File tree

8 files changed

+17
-4
lines changed

8 files changed

+17
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ here are many examples implemented in this library. One of the examples is below
5656
#define CAN_31K25BPS 5
5757
#define CAN_33KBPS 6
5858
#define CAN_40KBPS 7
59+
#define CAN_47KBPS 19
5960
#define CAN_50KBPS 8
6061
#define CAN_80KBPS 9
6162
#define CAN_83K3BPS 10

examples/recv/recv.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define CAN_31K25BPS 5
1111
#define CAN_33KBPS 6
1212
#define CAN_40KBPS 7
13+
#define CAN_47KBPS 19
1314
#define CAN_50KBPS 8
1415
#define CAN_80KBPS 9
1516
#define CAN_83K3BPS 10

examples/send/send.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define CAN_31K25BPS 5
1111
#define CAN_33KBPS 6
1212
#define CAN_40KBPS 7
13+
#define CAN_47KBPS 19
1314
#define CAN_50KBPS 8
1415
#define CAN_80KBPS 9
1516
#define CAN_83K3BPS 10

examples/set_mask_filter_recv/set_mask_filter_recv.ino

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define CAN_31K25BPS 5
1111
#define CAN_33KBPS 6
1212
#define CAN_40KBPS 7
13+
#define CAN_47KBPS 19
1314
#define CAN_50KBPS 8
1415
#define CAN_80KBPS 9
1516
#define CAN_83K3BPS 10
@@ -26,10 +27,7 @@
2627
CANBed M0: https://www.longan-labs.cc/1030014.html
2728
CAN Bus Shield: https://www.longan-labs.cc/1030016.html
2829
OBD-II CAN Bus GPS Dev Kit: https://www.longan-labs.cc/1030003.html
29-
3030
*/
31-
#include <SPI.h>
32-
#include "mcp_can.h"
3331

3432
#include <SPI.h>
3533
#include "mcp_can.h"

examples/set_mask_filter_send/set_mask_filter_send.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#define CAN_31K25BPS 5
1212
#define CAN_33KBPS 6
1313
#define CAN_40KBPS 7
14+
#define CAN_47KBPS 19
1415
#define CAN_50KBPS 8
1516
#define CAN_80KBPS 9
1617
#define CAN_83K3BPS 10
@@ -27,7 +28,6 @@
2728
CANBed M0: https://www.longan-labs.cc/1030014.html
2829
CAN Bus Shield: https://www.longan-labs.cc/1030016.html
2930
OBD-II CAN Bus GPS Dev Kit: https://www.longan-labs.cc/1030003.html
30-
3131
*/
3232

3333
#include <mcp_can.h>

keywords.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ CAN_25KBPS LITERAL1
3232
CAN_31KBPS LITERAL1
3333
CAN_33KBPS LITERAL1
3434
CAN_40KBPS LITERAL1
35+
CAN_47KBPS LITERAL1
3536
CAN_50KBPS LITERAL1
3637
CAN_80KBPS LITERAL1
3738
CAN_83KBPS LITERAL1

mcp_can.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,12 @@ byte MCP_CAN::mcp2515_configRate(const byte canSpeed)
273273
cfg3 = MCP_16MHz_40kBPS_CFG3;
274274
break;
275275

276+
case (CAN_47KBPS):
277+
cfg1 = MCP_16MHz_47kBPS_CFG1;
278+
cfg2 = MCP_16MHz_47kBPS_CFG2;
279+
cfg3 = MCP_16MHz_47kBPS_CFG3;
280+
break;
281+
276282
case (CAN_50KBPS):
277283
cfg1 = MCP_16MHz_50kBPS_CFG1;
278284
cfg2 = MCP_16MHz_50kBPS_CFG2;

mcp_can_dfs.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,10 @@
255255
#define MCP_16MHz_50kBPS_CFG2 (0xFA)
256256
#define MCP_16MHz_50kBPS_CFG3 (0x87)
257257

258+
#define MCP_16MHz_47kBPS_CFG1 (0x06)
259+
#define MCP_16MHz_47kBPS_CFG2 (0xBE)
260+
#define MCP_16MHz_47kBPS_CFG3 (0x07)
261+
258262
#define MCP_16MHz_40kBPS_CFG1 (0x07)
259263
#define MCP_16MHz_40kBPS_CFG2 (0xFF)
260264
#define MCP_16MHz_40kBPS_CFG3 (0x87)
@@ -326,6 +330,7 @@
326330
#define CAN_31K25BPS 5
327331
#define CAN_33KBPS 6
328332
#define CAN_40KBPS 7
333+
#define CAN_47KBPS 19
329334
#define CAN_50KBPS 8
330335
#define CAN_80KBPS 9
331336
#define CAN_83K3BPS 10

0 commit comments

Comments
 (0)