USBSerial: Difference between revisions
Line 32: | Line 32: | ||
The CH340 12 MHz crystal output was measured, which shows a relatively clean sine wave with little visible distortion. | The CH340 12 MHz crystal output was measured, which shows a relatively clean sine wave with little visible distortion. | ||
[[File:Ch340-Xtal.png|thumb| | [[File:Ch340-Xtal.png|thumb|center|400px|12 MHz oscillator output measured at XO test pad next to crystal.]] | ||
===Hardware Revisions=== | ===Hardware Revisions=== |
Revision as of 20:12, 20 March 2019
This is a project to create a low cost and versatile USB to serial adapter board based on the CH340G, with selectable (via slide switch) power and IO voltages (1.8, 2.5, 3.3, and 5V for both). Input and output protection is also provided via PTC fuses and series resistors + IO buffers.
List of Features
- Supported Baud Rates: 50, 75, 100, 110, 134.5, 150, 300, 600, 900, 1200, 1800, 2400, 3600, 4800, 9600, 14400, 19200, 28800, 33600, 38400, 56000, 57600, 76800, 115200, 128000, 153600, 230400, 460800, 921600, 1500000, 2000000, 3000000 (not officially listed in datasheet, but tested functional)
- Output Voltage (PWR pin): 5V, 3.3V, 2.5V, 1.8V
- Output Current (PWR pin): 500mA
- I/O Voltage (Tx pin): 5V, 3.3V, 2.5V, 1.8V
- Input Voltage (Rx pin): 1.65 to 5.5V
Electronics
The full board schematic is shown in the image below. The circuitry contains basic rBOM for the CH340G chip, 2 adjustable LDOs with slide switches for voltage selection (feedback ground side resistor selection), and buffers/level translators.
The PCB is laid out with 2 headers, one for the main Tx/Rx/GND/Pwr outputs, and another for the less commonly used CTS/DSR/RI/DCD//DTR/RTS/R232 signals and GND. 4 M3 mounting holes are available in the corners of the board, with separation of 0.85" on the short side, and 1.6" on the long side.
The board was then manually panelized into a 6-up board to fit within the 100x100mm "$2" PCB size for fab by JLCPCB.
PCB testing/evaluation
UART SI was measured using a 100MHz oscilloscope (Rigol DS1102E) at a 0.1" header. Signal shows sharp edges and correct IO voltage levels. No measurable crosstalk (down to 10mV) was detected on the adjacent Rx line during Tx.
The CH340 12 MHz crystal output was measured, which shows a relatively clean sine wave with little visible distortion.
Hardware Revisions
Revision 1.0
This is the first revision of the USB to serial adapter board.
Errata:
- None known
Revision 2.0
N/A
Change List:
- Add ESD diodes to inputs/outputs and USB lines (todo)
Errata:
- None known
PCB Files
Here is the Eagle schematic file for the USB to serial adapter board v1.0: http://rev0proto.com/files/tbd.sch Here is the Eagle board file (1-up) for the USB to serial adapter board v1.0: http://rev0proto.com/files/tbd.brd Here is the Eagle board file (6-up) for the USB to serial adapter board v1.0: http://rev0proto.com/files/tbd.brd Here are the gerber files (6-up panel) for the USB to serial adapter board v1.0: http://rev0proto.com/files/tbd.zip
Enclosure
The enclosure for the CCR v2.0 was created in Fusion 360 and is made up of x pieces which can be 3D printed and assembled with M3 screws.
Here are the Fusion 360 files for the CCR v2.0 enclosure: http://rev0proto.com/files/tbd.zip
Code
Full source code for the project can be found here: http://rev0proto.com/files/x.zip
Videos
<HTML5video type="youtube" width="400" height="300" autoplay="false">1SHY4jAfTcM</HTML5video>
Photos
Total Project Cost
EE Component | Cost | Source |
OPA335 Zero-Drift Amplifier (qty 2) | $2.42 | LCSC |
MCP1402 MOSFET Driver (qty 4) | $1.83 | LCSC |
STM32F103 "Blue Pill" | $1.82 | Aliexpress |
NCS199A1 Current Sense Amplifier (qty 2) | $1.45 | LCSC |
18650 SMT Holder (qty 2) | $1.23 | Aliexpress |
N-channel MOSFET 13A 11.5mOhm SOIC-8 (qty 4) | $0.52 | LCSC |
rBOM (under $0.41) | $4.76 | LCSC |
PCB | $2.00 | JLCPCB |
Assembly | $7.10 - $31.70 | PCBgogo |
HW Component | Cost | Source |
100x40x20 Aluminum Heatsink | $3.02 | eBay |
40x40x20 5V Fan | $1.60 | eBay |
Misc HW (Under $0.22) | $0.42 | Aliexpress/eBay |
Total Price | $52.41 (Assembly cost $317, batch qty 10) |