Live data from Hacker News

I designed my LED matrix PCB with code

docs.tscircuit.com

51–60 of 68 posts

Re: I designed my LED matrix PCB with code

#51
post #20

Wish I could comment on the routing like others but the render is stuck at 96.2% for me. Nothing else on the page shows it on my phone so I assume that's the problem. (And of course nothing in the log of error tabs). I think just looking at the first code example you can already see the problem. A lot of duplication and hand written or auto generated code. I thought the point was to define it in the code. Put an arra…

Looking back on this, lots of typos. I must've been really tired. I hope the point still came across.

Re: I designed my LED matrix PCB with code

#52
post #26

Interesting, reminds me of a project my colleague has just been working on: using KiCad + python to auto-place LEDs at specific coordinates on a PCB. Instead of positioning them as a regular matrix, the LED locations are derived from the shape of a racing circuit: https://ledsrace.at/zandvoort (routing and non-LED part of the layout was still done manually) I don't think 100% auto-placement/routing will be able to ta…

This is a really good use case, though I'd be surprised if there aren't macros to do simple grid layout already in Altium or KiCad. It's the sort of thing you'd find in a badly documented Eagle userscript. I recently made a smaller PCB with 30 LEDs in a specific colour arrangement and even that was a pain by hand.

Jlcpcb, the manufacturer mentioned in the article, has a graphical editor with grid functionality and they even have a JS API if you want to automate PCB changes like arranging LEDs or renaming components.

Re: I designed my LED matrix PCB with code

#53
post #33

Atopile is another thing in the circuits-as-code space: https://github.com/atopile/atopile As a half EE/half SWE I think there are significant benefits to circuits as code but I'm not impressed with this one. Atopile has a narrower focus (autorouters are really really hard) and doesn't use as many buzzwords. Like why on earth does a "web first approach" matter at all for hardware development? But also, GUI tools are…

It's probably a simple economics thing. You can hire out a contract PCB design for a reasonable cost and the long poll is getting back physical prototypes. Contrast to HDLs displacing schematic based designs for ASICs and programmable logic, where simulation allows for rapid development.

I'd say it's significantly different because you can get a physical PCB prototype in days for a few dollars while an ASIC prototype takes months and millions.

Re: I designed my LED matrix PCB with code

#54
post #47

Earlier quoted context omitted.

High speed PCBs are RF. At high enough frequencies, traces become waveguides, and the result cannot be predicted analytically. Simulation is your only light in this mess.

I have been lucky to not have to lay out anything that had frequencies of interest over 1Ghz or so. What's your experience been? E.g. types of signals, frequency range, issues you ran into?

Signals that arrive faster than what the speed of light should physically allow for that trace length because you made the corners too sharp and then instead of flowing along your path the electricity creates a magnetic field which then induces a current and that allows the signal to tunnel through non-conductive walls.

High speed boards cannot be simulated well. Because they are far from deterministic. That's what makes them so different from coding.

Re: I designed my LED matrix PCB with code

#55
I've been working on CircuitPainter, a Python-based system for generating PCBs. Some examples are here: https://circuitpainter.blinkinlabs.com/examples.html .

It uses KiCad as a backend, so you are able to take advantage of the design rule checker and other niceties that come from the traditional CAD world. We've been using it successfully to automate very repetitive design jobs at our studio.

Re: I designed my LED matrix PCB with code

#56
post #37

Earlier quoted context omitted.

PCB layout is as much art and black magic as it is science. I'm not sure why you dismiss the complexity so easily, this definitely is not just a matter of applying Maxwell's equations.

Layout is a puzzle, especially with particularly high density layouts, but some of this is ameliorated by high layer count and fine trace/space boards becoming cheaper. Definitely not black magic. RF layout is black magic, let's not steal their thunder here.

It's just across-modal. The list of components are linear list, connections between components are graphs, placements are geometrically constrained, and overall shape is both geometric and external to the board. So you can't just mechanically derive the board from mere linear textual descriptions of it.

A lot of automagic "AGI achieved" LLM projects has this same problem, that it is assumed that brief literal prompt shall fully constrain the end result so long it is well thought out. And it's just not how it - the reality, or animal brains - works.

Re: I designed my LED matrix PCB with code

#57
post #7

I took a stab at something like this. My intent was that you’d be sitting at a Common Lisp REPL, and start entering commands. As you did this, a graphical window would show your components and traces. I considered similar to a legacy AutoCAD, way back before pointing devices were commonplace. I had a whole simple dialect to easily identify traces, which you would continuously split with points, then nudge them around…

You could use AI to build this, I believe, in a few days. Especially having thought about it, oneself, for a few years ..

Re: I designed my LED matrix PCB with code

#58
post #47

Earlier quoted context omitted.

I have been lucky to not have to lay out anything that had frequencies of interest over 1Ghz or so. What's your experience been? E.g. types of signals, frequency range, issues you ran into?

Signals that arrive faster than what the speed of light should physically allow for that trace length because you made the corners too sharp and then instead of flowing along your path the electricity creates a magnetic field which then induces a current and that allows the signal to tunnel through non-conductive walls. High speed boards cannot be simulated well. Because they are far from deterministic. That's what m…

What was the context you had that issue in? RAM bus?

Re: I designed my LED matrix PCB with code

#59
post #56
post #37

Earlier quoted context omitted.

Layout is a puzzle, especially with particularly high density layouts, but some of this is ameliorated by high layer count and fine trace/space boards becoming cheaper. Definitely not black magic. RF layout is black magic, let's not steal their thunder here.

It's just across-modal. The list of components are linear list, connections between components are graphs, placements are geometrically constrained, and overall shape is both geometric and external to the board. So you can't just mechanically derive the board from mere linear textual descriptions of it. A lot of automagic "AGI achieved" LLM projects has this same problem, that it is assumed that brief literal prompt…

You need a LOT of context about what the components are and how they're being used in order to route them. Extreme case is an FPGA where a GPIO might be a DAC output or one half of a SERDES diff pair.

Re: I designed my LED matrix PCB with code

#60
post #59
post #56

Earlier quoted context omitted.

It's just across-modal. The list of components are linear list, connections between components are graphs, placements are geometrically constrained, and overall shape is both geometric and external to the board. So you can't just mechanically derive the board from mere linear textual descriptions of it. A lot of automagic "AGI achieved" LLM projects has this same problem, that it is assumed that brief literal prompt…

You need a LOT of context about what the components are and how they're being used in order to route them. Extreme case is an FPGA where a GPIO might be a DAC output or one half of a SERDES diff pair.

Doesn't even have to be that extreme: there is no way port placements of a Mac Mini can be mathematically derived from a plain English natural language prompt, and yet that's what they're trying to do. It's just the reality that not everything happen or could be done in literal languages. I guess it takes few more years before everyone accepts that.
Post reply on HN