(no title)
liu3hao | 21 days ago
I have created a usb-uart converter board with the CH340 chip. The complete schematic was coded with Circuitscript and then imported as a netlist into kicad pcbnew to do the pcb layout. The design was produced with JLCPCB and after receiving the boards I tested them and they do work! The design files are here https://github.com/liu3hao/usb-uart-bridge. The circuitscript code file is here https://raw.githubusercontent.com/liu3hao/usb-uart-bridge/re... and the generated pdf from the circuitscript code is here: https://github.com/liu3hao/usb-uart-bridge/blob/main/usb_uar...
The motivation for creating Circuitscript is to describe schematics in terms of code rather than graphical UIs after using different CAD packages extensively (Allegro, Altium, KiCAD) for work in the past. I wanted to spend more time thinking about the schematic design itself rather than fiddling around with GUIs.
Please check it out and I look forward to your feedback, especially from electronics designers/hobbyists. Thanks!
mikeayles|21 days ago
How effective at circuit generation are LLM's with the language? I tried similar, and could get syntactically correct files, but the content always had errors: https://www.mikeayles.com/#tokn
What are your thoughts on atopile and tscircuit?
liu3hao|20 days ago
I have seen both atopile and tscircuit too and they are really complete it terms of the entire PCB design flow compared to circuitscript, which is just focused on the schematic part.
The ato language works well for specifying parts and parameters, but is very basic for defining connectivity. This means that the designer will have minimal control of how the final schematics will turn out. Of course, atopile focuses on the complete design flow, so having nice schematics could be a want rather than a need. For myself, especially in my professional job, clear and well-organized schematics are important not just for understanding and creation, but also troubleshooting the design and eventually improving the design.
I did try some automatic layout features for the schematic that balances giving the user some control over the overall schematic, but this was really hard to get right. In the end, I went with the logo/turtle approach and give full layout control to the user.
For tscircuit, I like typescript as a programming language and circuitscript itself is created in typescript. But typescript is really clunky to use for schematic design. Coupled with react, there is a lot of extra noise/symbols when looking at the code and for complex designs, it will be challenging to understand and troubleshoot. Moreover, I believe that typescript/javascript is less common among electronics engineers compared to python (which circuitscript is based on). The simplicity of python is one of the reasons it is popular and that is what I believe might help to lower the learning curve for circuitscript.
bityard|21 days ago
I don't do a lot of circuit design, but I'm more of a visual person so I feel like I would be more likely to draw this in something like KiCad and then want to export it to this format to make diffs simpler.
liu3hao|20 days ago
I do like the ease of visually drawing schematics, however for some parts of circuit design, it gets repetitive and the GUI (used Altium, Allegro and Kicad professionally) gets in the way. For more complex circuit changes, it can be much easier to diff text rather than graphics, since text can capture intent better.
indra_varta|21 days ago
liu3hao|21 days ago