-
Notifications
You must be signed in to change notification settings - Fork 0
/
1030013.md.bak
303 lines (207 loc) · 11.5 KB
/
1030013.md.bak
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
---
sku: 1030013
name: CANBed - M4
---
## ***Introduction***
--------------------------
[![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1030013/main.png)](https://www.longan-labs.cc/1030013.html)
CAN Bus is a common industrial bus because of its long travel distance, medium communication speed and high reliability.
It is commonly found on modern machine tools, such as an automotive diagnostic bus.
This CANBed M4 is the latest board of the CANBed family, with the ATSAME51G19A mcu and MCP2542FD CAN transceiver to achieve the CAN-FD capability.
Click to get a [DB9 to OBD-II cable](https://www.longan-labs.cc/2020011.html).
### CANBed Family
Currently we have 6 CANBeds, you can choose the right one according to your needs.
|**VRESION**|CANBed V1|CANBed FD|CANBed M0|CANBed M4|CANBed RP2040|CANBed Dual|
|--|---------|---------|---------|---------|----|-----|
|**MCU**|Atmega32U4|Atmega32U4|ATSAMD21G18|ATSAME51G19A|RP2040|RP2040|
|**CORE**|AVR 8 bit|AVR 8 bit|ARM Cortex M0+ 32bit|ARM Cortex M4 32bit|Dual ARM Cortex-M0+|Dual ARM Cortex-M0+|
|**PROTOCOL**|CAN2.0|CANFD & CAN2.0|CAN2.0|CANFD & CAN2.0|CAN2.0|CANFD & CAN2.0|
|**CLOCK**|16MHz|16MHz|48MHz|133MHz|133MHz|133MHz|
|**FLASH**|32KB|32KB|256KB|2MKB|2MKB|2MKB|
|**RAM**|2.5KB|2.5KB|32KB|192KB|264KB|264KB|
|**PRICE**|$24.9|$24.9|$24.9|$24.9|$15.9|$24.9|
|**LINK**|[GET ONE](https://www.longan-labs.cc/1030008.html)|[GET ONE](https://www.longan-labs.cc/1030009.html)|[GET ONE](https://www.longan-labs.cc/1030014.html)|[GET ONE](https://www.longan-labs.cc/1030013.html)|[GET ONE](https://www.longan-labs.cc/1030018.html)|[GET ONE](https://www.longan-labs.cc/1030019.html)|
## ***CAN BUS PRODUCTS LIST OF LONGAN LABS***
--------------------------
[![](https://www.longan-labs.cc/media/wysiwyg/CAN_BUS_PRODUCT.png)](https://www.longan-labs.cc/blog/post/can-bus-product-summary/)
We have made a lot of can bus products, you can get more information through the following list, so as to choose a product suitable for you.
|PRODUCT NAME|LINK|PRICE|MCU|CHIP|PROTOCOL|
|------------|----|-----|---|----|--------|
|Serial CAN Bus Module|[LINK](https://www.longan-labs.cc/1030001.html)|$19.9|ATMEGA168PA|MCP2515|CAN2.0|
|I2C CAN Bus Module|[LINK](https://www.longan-labs.cc/1030017.html)|$19.9|ATMEGA168PA|MCP2515|CAN2.0|
|OBD-II Serial CAN Bus Dev Kit|[LINK](https://www.longan-labs.cc/1030002.html)|$20.9|ATMEGA168PA|MCP2515|CAN2.0|
|OBD-II CAN Bus GPS Dev Kit|[LINK](https://www.longan-labs.cc/1030003.html)|$29.9|ATMEGA32U4|MCP2515|CAN2.0|
|OBD-II CAN Bus Basic Dev Kit|[LINK](https://www.longan-labs.cc/1030007.html)|$24.9|ATMEGA32U4|MCP2515|CAN2.0|
|CAN-FD Shield|[LINK](https://www.longan-labs.cc/1030012.html)|$12.9|NO MCU|MCP2517FD|CAN-FD|
|CAN Bus Shield|[LINK](https://www.longan-labs.cc/1030016.html)|$5.9|NO MCU|MCP2515|CAN2.0|
|CANBed|[LINK](https://www.longan-labs.cc/1030008.html)|$24.9|ATMEGA32U4|MCP2515|CAN2.0|
|CANBed-FD|[LINK](https://www.longan-labs.cc/1030009.html)|$19.9|ATMEGA32U4|MCP2517FD|CAN-FD|
|CANBed M0|[LINK](https://www.longan-labs.cc/1030014.html)|$24.9|ATSAMD21|MCP2515|CAN2.0|
|CANBed M4|[LINK](https://www.longan-labs.cc/1030013.html)|$19.9|ATSAME51|-|CAN-FD|
|OBD-II RF Dev Kit|[LINK](https://www.longan-labs.cc/1030015.html)|$19.9|ATmega168PA|MCP2515|CAN2.0|
## ***Features***
--------------------------
![](https://www.longan-labs.cc/media/wysiwyg/CAN-Bus/CANBed/Details_of_CANBed-13.jpg)
* CAN-FD and CAN2.0
* ATSAME51G19A 32bit Cortex M4 core
* 512 KB flash, 192KB RAM
* Industrial standard 9 pin sub-D connector or 4PIN Terminal Connector
* OBD-II and CAN standard pinout selectable at sub-D connector
* 2x4Pin Connector compatable with Grove system
* Size: 56x41mm
## ***Specifications***
--------------------------
* MCU: ATSAME51 32bit Cortex M4 core
* Clock speed: 120MHz
* Flash memory: 512KB
* RAM: 192KB
* EEPROM: No EEPROM
* Input voltage: 7~28V
* Output Current @ 5V: 1A
* Input interface: Sub-D as well as Terminal
## ***CAN Baudrate Support***
--------------------------
For CAN-FD frame, below baudrate are supported,
* CAN_250K_500K
* CAN_250K_1M
* CAN_250K_1M5
* CAN_250K_2M
* CAN_500K_1M
* CAN_500K_2M
* CAN_500K_4M
* CAN_1000K_4M
For CAN standard frame, below baudrates are supported.
* CAN_4K096BPS 4096
* CAN_5KBPS 5000
* CAN_10KBPS 10000
* CAN_20KBPS 20000
* CAN_31K25BPS 31250
* CAN_33K3BPS 33300
* CAN_40KBPS 40000
* CAN_50KBPS 50000
* CAN_80KBPS 80000
* CAN_100KBPS 100000
* CAN_125KBPS 125000
* CAN_200KBPS 200000
* CAN_250KBPS 250000
* CAN_500KBPS 500000
* CAN_1000KBPS 1000000
## ***Hardware Overview***
--------------------------
### Part List
!!!Note
In consideration of convenient transportation and cost reduction, there are some materials that you need to solder by hand. If you don't have soldering iron tools, you can also ask our engineers to do it for you. After you place an order, email info@longan-labs.
![](https://www.longan-labs.cc/media/wysiwyg/CAN-Bus/CANBed/Details_of_CANBed-08.jpg)
1. CANBed M4 PCBA
2. sub-D connector
3. 4PIN Terminal
4. 4PIN 2.0 Connector x 2
5. 9x2 2.54 Header x 1
6. 3x3 2.54 Header x 1
### Pin out
[![](https://www.longan-labs.cc/media/wysiwyg/CAN-Bus/CANBed/Details_of_CANBed-03.png)](https://www.longan-labs.cc/media/wysiwyg/CAN-Bus/CANBed/Details_of_CANBed-03.png)
**1.9x2 IO Pin OUT:**
The IO of Atsame51 is list out here.
**2.ATSAME51G19A:**
Cortex M4 core controller
**2.Reset Button:**
Reset the on-board Atmega chip.
**3.Micro USB connector for programming**
**4. SPI Interface**
**5.CAN RX/TX Indicator**
**6.sub-D connector or Terminal for CAN Bus**
*D-Sub CANbus PinOut*
|pin#|Signal names|Signal Description|
|----|----|-----------|
|1|Reserved|Upgrade Path|
|2|CAN_L|Dominant Low|
|3|CAN_GND|Ground|
|4|Reserved|Upgrade Path|
|5|CAN_SHLD|Shiled, Optional|
|6|GND|Ground,Optional|
|7|CAN_H|Dominant High|
|8|Reserved|Upgrade Path|
|9|CAN_V+|Power, Optional|
**7.Switch for the 120Ω terminal resistor for CAN Bus**
<p style="text-align:center"><img src="https://github.com/Longan-Labs/OBD-II_Slaver_GPS_kit/raw/master/HS_CAN_Termination.gif" /></p>
If you use this board on the end of the CAN bus, please put this switch to 120Ω. For more detail about the CAN bus protocol, please refer to the
[NI CAN Physical Layer and Termination Guide](http://www.ni.com/white-paper/9759/en/)
**8.Grove connector for UART**
**9.Grove connector for I2C**
### ***DB9 connector***
The DB9 interface of CAN Bus has two different protocols, OBD and CAN Open. Their definition is as follows,
|pin#|OBD(default)|CAN OPEN|
|----|----|-----------|
|1|GND|N.C|
|2|GND|CAN_L|
|3|CANH|GND|
|4|N.C|N.C|
|5|CANL|GND|
|6|N.C|N.C|
|7|N.C|CAN_H|
|8|N.C|N.C|
|9|CAN_V+|CAN_V+|
If you want to use the OBD protocol, you don't need to make any changes to the hardware.
If you need to use the CAN Open protocol, first we look at the back side of the PCB board, you can see the Pads below,
![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1030009/CANBED_FD_DB9_SETTING.jpg)
These pads are connected to the OBD side by default. We have to prepare a knife to disconnect the OBD side, and then use an electric soldering iron to solder the CAN Open side of the pads.
![](https://raw.githubusercontent.com/Longan-Labs/docs_mkdocs/master/docs/images/1030018/db9_setup.png)
## ***Getting Started with Arduino IDE***
--------------------------
### ***Arduino IDE Setup***
--------------------------
First download the Arduino IDE from https://www.arduino.cc/en/Main/Software. Arduino IDE can be installed and run on Windows, Linux, and Mac OS X operating systems. Download the installer or zip file (Windows only) and install (if you have the zip file, extract it to your Windows computer’s hard drive) it on your operating system.
Once finished, start the Arduino IDE.
Copy and paste the link below into the Additional Boards Manager URLs option in the Arduino IDE preferences (**File > Preferences**).
https://raw.githubusercontent.com/Longan-Labs/LONGAN-SAME-TOOLS/master/package_longan_samd_index.json
Enter longan to install the latest Longan SAME board
### ***Example code***
---------------------
Open Arduino IDE, Click File > Examples > SAME51 CAN Library, you will get many examples for CANBed M4.
There're many examples for the library, which is consist of,
* ***CAN_20_Send*** - How to send a frame to CAN Bus 2.0
* ***CAN_20_Recv*** - How to recv a frame from CAN Bus 2.0
* ***CAN_FD_Send*** - How to send a frame to CAN FD
* ***CAN_FD_Recv*** - How to recv a frame from CAN FD
## **Rescue the bricked board**
--------------------------
Sometimes due to some strange reasons, your board can no longer burn any program, and the USB cannot be recognized. At this time, you can save your board by the following methods
First of all you need a J-Link tool, if you don't have it, you can get one from Longan Labs.
Please folow below steps.
1. Get a [J-Link tool](https://www.longan-labs.cc/2090016.html)
2. Download the [J-Flash software](https://www.segger.com/downloads/jlink/)
3. Install the J-Link Software, then you will get a J-Flash tool.
4. Download the [bootloader file](https://github.com/Longan-Labs/LONGAN-SAME-TOOLS/raw/master/Longan-same-1.0.5/bootloaders/canbed_m4/bootloader_canbed_atsame51g19a.bin).
5. Open J-Flash software, Click to select the MCU.
![](https://raw.githubusercontent.com/Longan-Labs/productFiles/master/1030013/1.png)
6.Find SAME51G19A
![](https://raw.githubusercontent.com/Longan-Labs/productFiles/master/1030013/2.png)
7.Point to the bootloader file
![](https://raw.githubusercontent.com/Longan-Labs/productFiles/master/1030013/3.png)
8.Connect SWD interface to the board.
![](https://raw.githubusercontent.com/Longan-Labs/productFiles/master/1030013/4.jpg)
9.Click on Program Device, if everything is ok, you saved the board now.
![](https://raw.githubusercontent.com/Longan-Labs/productFiles/master/1030013/5.png)
## ***FAQ***
--------------------------
!!!tip "The RX/TX led light up and never turn off"
* Check if the baudrate of CAN Bus is setting correct
* Try turning on/off the switch for the terminal resistor
* Cehck if CANH and CANL is connected correct
!!!tip "How to find the tech support"
Please contact [email protected] for technical support. Our technical support engineer will usually reply you within 24 hours on working days. In order to get faster support, we hope that when you send us an email, you need to include at least the following content,
* When and how to buy the product
* Product version information
* Take a high-definition picture of the product you use, including the connection
* Describe in detail the problem you encountered and what kind of help you would like to get
## ***Schematic Online Viewer***
--------------------------
<div class="altium-ecad-viewer" data-project-src="https://github.com/Longan-Labs/Hardware_CANBed_Series/raw/master/CANBed%20M4.zip" style="border-radius: 0px 0px 4px 4px; height: 500px; border-style: solid; border-width: 1px; border-color: rgb(241, 241, 241); overflow: hidden; max-width: 1280px; max-height: 700px; box-sizing: border-box;" />
</div>
## ***Reference***
------------
* [Schematics in Eagle](https://github.com/Longan-Labs/Hardware_CANBed_Series/raw/master/CANBed%20M4.zip)
* [3D Model](https://github.com/Longan-Labs/CANBed_3D_Model/archive/refs/heads/main.zip)
* [Schematics in PDF](https://github.com/Longan-Labs/Hardware_CANBed_Series/raw/master/CANBed%20M4/CANBed%20M4.pdf)
* [ATSAME51 Datasheet](https://www.mouser.cn/datasheet/2/268/60001507E-1660031.pdf)
* [MCP2542 Datasheet](https://www.mouser.com/datasheet/2/268/20001667G-1115479.pdf)