Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify manufacture #6

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .gitignore

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Lao·Zhu
Copyright (c) 2023 Lao·Zhu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
34 changes: 15 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,45 @@
# rm_usb2can

![Version](https://img.shields.io/badge/Version-1.0.3-brightgreen.svg)  ![Build](https://img.shields.io/badge/Build-Passed-success.svg)  ![License](https://img.shields.io/badge/License-MIT-blue.svg)
![Version](https://img.shields.io/badge/Version-2.0.1-brightgreen.svg)  ![Build](https://img.shields.io/badge/Build-Passed-success.svg)  ![License](https://img.shields.io/badge/License-MIT-blue.svg)

English/[中文](https://github.com/rm-controls/rm_usb2can/blob/main/README_CN.md)

***

### Brief Introduction

    The purpose of this project is to provide [Intel® NUC](https://www.intel.com/content/www/us/en/products/details/nuc.html) and other x86 device with a CAN (Controller Area Network) peripheral interface. Since NUC and most x86 device does not have simple peripheral interfaces such as SPI (Serial Peripheral Interface), it is impossible to use SPI to can chips such as MCP2515. Therefore, the project is developed based on the open source solution [candleLight](https://github.com/candle-usb/candleLight_fw/tree/master) on GitHub, and STM32F072CBT6 is used as the main control chip to realize the function of USB (Universal Serial Bus) to can. STM32F072CBT6 has USB full speed peripherals and can peripherals that can work at the same time. It is packaged as QFP64 (Quad Flat Package) and is an excellent solution.The following figure shows the physical connection between Intel NUC and usb2can.
    The purpose of this project is to provide [Intel® NUC](https://www.intel.com/content/www/us/en/products/details/nuc.html) and other x86 device with a CAN (Controller Area Network) peripheral interface. Since NUC and most x86 device does not have simple peripheral interfaces such as SPI (Serial Peripheral Interface), it is impossible to use SPI to can chips such as MCP2515. Therefore, the project is developed based on the open source solution [candleLight](https://github.com/candle-usb/candleLight_fw/tree/master) on GitHub, and STM32F072CBT6 is used as the main control chip to realize the function of USB (Universal Serial Bus) to can. STM32F072CBT6 has USB full speed peripherals and can peripherals that can work at the same time. It is packaged as QFP48 (Quad Flat Package) and is an excellent solution.The following figure shows the physical connection between Intel NUC and usb2can.

![usb_hub](https://raw.githubusercontent.com/rm-controls/rm_usb2can/main/image/nuc_with_usb2can.jpg)

***

### Develop Tools

+ EDA Tool: Altium Designer 20.0.13
+ Compiler: gcc-arm-none-eabi 8-2019-q3-update
+ Programming Tool: STM32CubeProgrammer v2.6.0
+ EDA Tool: KiCAD 6.0.9
+ Compiler: gcc-arm-none-eabi 10.3.1 20210824 (release)
+ Programming Tool: STM32CubeProgrammer v2.13.0

***

### Directory Structure

+ bom: three different versions of usb2can material forms.
+ candlelight: the repository of GitHub's open source solution [candleLight](https://github.com/candle-usb/candleLight_fw/tree/master).
+ circuit: circuit schematic diagram and PCB source file designed with Altium designer.
+ gerber: three different versions of usb2can manufacturing documents.
+ image: picture in readme.
+ firmware.bin: Compiled program binaries.

**Note: the PCB and schematic diagram under the circuit folder are example circuits, which are directly used to manufacture products with production results other than those shown in the figure. If you want to directly reproduce the graphic version, please use the production file under the gerber folder.**
+ manufacture: USB2CAN production manufacturing file.
+ program: Github open source program [candleLight](https://github.com/candle-usb/candleLight_fw/tree/master) modified source code.
+ circuit: Circuit schematic and PCB source files designed with KiCAD.
+ image: Images of README.

***

### Circuit Design

#### Key Points Of Schematic Design

    USB HUB Circuit Design: since the whole vehicle needs at least two can buses to ensure the integrity of the data packet returned by the motor, we use GL850G as the USB HUB chip to realize the scheme of USB one driving four. In addition, we also use Schmidt trigger to realize the power on sequence to ensure that the enumeration sequence of USB devices is consistent after each power on.
    USB HUB Circuit Design: since the whole vehicle needs at least two can buses to ensure the integrity of the data packet returned by the motor, we use SL2.1s as the USB HUB chip to realize the scheme of USB one driving four. In addition, we also use Schmidt trigger to realize the power on sequence to ensure that the enumeration sequence of USB devices is consistent after each power on.

![usb_hub](https://raw.githubusercontent.com/rm-controls/rm_usb2can/main/image/usb_hub.png)

    USB To CAN Circuit Design: use STM32F072CBT6 to realize the function of USB to can. The can level conversion chip adopts MAX3051EKA chip, which uses 3.3V power supply and is packaged as SOT23-8 (Small Outline Transistor), which provides the basis for PCB miniaturization. The purpose of R6 and R7 resistors in the figure is to change the boot mode of STM32, so that STM32 can switch between DFU (Device Firmware Upgrade) burning mode and flash mode by changing the short circuit mode of R6 and R7, so as to facilitate firmware burning.
    USB To CAN Circuit Design: use STM32F072CBT6 to realize the function of USB to can. The CAN level conversion chip uses the TJA1050 chip, which uses a 5V power supply and greatly reduces the probability of CAN transceiver damage due to the chip's higher common mode withstand voltage. The purpose of R6 and R7 resistors in the figure is to change the boot mode of STM32, so that STM32 can switch between DFU (Device Firmware Upgrade) burning mode and flash mode by changing the short circuit mode of R6 and R7, so as to facilitate firmware burning.

![stm32_can](https://raw.githubusercontent.com/rm-controls/rm_usb2can/main/image/stm32_can.png)

Expand All @@ -58,9 +54,9 @@ English/[中文](https://github.com/rm-controls/rm_usb2can/blob/main/README_CN.m

### Circuit Making

    We provide three different versions of Gerber files for production: [two-way CAN + UART + DBUS](https://github.com/rm-controls/rm_usb2can/tree/main/gerber/2CAN%2BUART%2BDBUS), [four-way CAN](https://github.com/rm-controls/rm_usb2can/tree/main/gerber/4CAN), [UART + DBUS](https://github.com/rm-controls/rm_usb2can/tree/main/gerber/UART%2BDBUS).The circuits of these three versions are designed with two-layer PCB, with an area of about 20 * 30MM. You can directly submit the packaged Gerber file to a manufacturer (such as [jlc](https://www.jlc.com/#)) for production.
    We provide Gerber files that can be used directly for manufacturing in the [manufacturer folder](https://github.com/rm-controls/rm_usb2can/tree/main/manufacture). This version can realize one way USB to 2 way CAN + 2 way UART, and its circuit schematic is shown in the [circuit folder](https://github.com/rm-controls/rm_usb2can/tree/main/circuit). You can submit the packaged Gerber file directly to a manufacturer (e.g., [PCB Way](https://www.pcbway.com/)) for production.

    You can find the BOM (Bill Of Material) table corresponding to the board [here](https://github.com/rm-controls/rm_usb2can/tree/main/bom) and weld the components to the fabricated PCB according to this table. After welding, please carefully check whether there is residual solder between the pins, which will lead to short circuit of the circuit board. At the same time, you should also check whether there is false soldering of the pins.
    You can also find the corresponding BOM (Bill Of Material) table for the board in the [manufacturer folder](https://github.com/rm-controls/rm_usb2can/tree/main/manufacture) and solder the components to the already made PCB according to this table. After the soldering is complete, please carefully check whether there is residual solder between the pins, that will lead to a short circuit on the board, and you also have to check whether the pins have the phenomenon of false solder.

    After welding, use a multimeter to check whether there is a short circuit between 5V power interface and GND, and whether there is a short circuit between 3.3V power output and GND. When the above situation does not occur, connect the board to the USB port of the computer. At this time, you should see that the power indicator on the board is on, and the computer can recognize the USB HUB chip.

Expand All @@ -70,7 +66,7 @@ English/[中文](https://github.com/rm-controls/rm_usb2can/blob/main/README_CN.m

### Firmware Programming

    You can [click here](https://github.com/rm-controls/rm_usb2can/releases/download/firmware_v1_0/candleLight.bin) to download the compiled firmware, or follow the [candlelight documentation](https://github.com/candle-usb/candleLight_fw/tree/master#building) to compile firmware by yourself. Finally, you will get the .bin file. We use [STM32CubeProgrammer](https://www.st.com/en/development-tools/stm32cubeprog.html) to burn the firmware into STM32 through USB. The steps to download firmware are shown below:
    You can download the compiled firmware in [Release](https://github.com/rm-controls/rm_usb2can/releases) page, or follow the [candlelight documentation](https://github.com/candle-usb/candleLight_fw/tree/master#building) to compile firmware by yourself. Finally, you will get the .bin file. We use [STM32CubeProgrammer](https://www.st.com/en/development-tools/stm32cubeprog.html) to burn the firmware into STM32 through USB. The steps to download firmware are shown below:

1. Remove the pull-down resistance of BOOT0 pin of STM32 and weld the pull-up resistance.
2. Connect the board to the USB port of the computer and open STM32CubeProgrammer.
Expand Down Expand Up @@ -141,4 +137,4 @@ The source code is released under a [MIT License](https://github.com/rm-controls
**Affiliation:DynamicX<br>
Maintainer:YanzhenZhu, [email protected]**

The product has been tested under Ubuntu 18.04 and 20.04. This is research code, expect that it changes often and any fitness for a particular purpose is disclaimed.
The product has been tested under Ubuntu 18.04, 20.04 and 22.04. This is research code, expect that it changes often and any fitness for a particular purpose is disclaimed.
Loading