Copying a Reference Circuit
Copy reference circuits to learn tscircuit or develop modified designs
Overview
This tutorial will guide you through copying a reference circuit into tscircuit.
There are many great reasons to copy a reference circuit:
- You are learning tscircuit and want to focus on learning the tscircuit tools rather than designing a circuit
- You are migrating a project from another EDA tool
- You are planning on making a modified version of an existing circuit
In this guide we’ll walk through the four major steps of copying a reference circuit:
- Understanding your reference circuit
- Importing or creating each subcomponent
- Connecting your subcomponents together
If you’re feeling confused or overwhelmed, take a look at the Motor Controller reference circuit, most of the files are generated or use reference circuits as a starting point!
0. Prerequisites
- You’ve initialized a directory with
tsci init
- You can successfully see the default circuit using
tsci dev
- You have a typescript IDE like VS Code installed
1. Understanding your reference circuit
Most reference circuits are composed of one or more of the following elements:
- Pictures of the manufactured board
- A PDF of the schematic
- A Bill of Materials or description containing the major parts
Use these resources to find part numbers for each component in your schematic. You’ll need this because you’ll need to create a typescript component for each part you’re using (except for passives like resistors and capacitors)
Most components have a little bit of white text on the top of them that you can google to find the part, but it’s usually easiest to find the part number on the schematic itself.
2. Importing or creating each subcomponent
You should create a file in the lib
directory for each subcomponent in your
design. There are generally 3 ways you can create components.
2.1 Super Easy Mode: Find it on JLCPCB
The easiest way to create a component is to google “jlcpcb <part name>” and find the part on JLCPCB. You then can copy the JLCPCB Part Number and generate a component using easyeda-converter.
2.2 Create from Scratch with Standard Footprint
If you can’t find the part on JLCPCB, you can create a component from scratch.
There are two parts to creating a component:
- Find all the pin labels
- Find out what the footprint looks like
- Fill in the template
This is what the template for a component looks like:
2.2.1 Finding the correct footprint
A datasheet will normally include in it’s description somewhere details about
the footprint or “landing pattern”. You can paste any package details into
text-to-footprint to figure out
exactly what footprint
string you should use.
3. Connect your components
Now that you have all the subcomponents, you can connect them together. By
importing them into the main MyCircuit.tsx
file.
Start by just importing a single component like this:
Now start to connect components together…
Finally when you’re ready, put it all together by adding every component: