4 ms·
Is there free software to create and simulate virtual populated PCBs? Fritzing allows creation, but it doesn't simulate the board. For simulation one needs the
by madez 9y ago
Is there free software to create and simulate virtual populated PCBs? Fritzing allows creation, but it doesn't simulate the board.
For simulation one needs the exact behaviour of all parts. That excludes board with parts that have a closed design, or insufficient documentation. But for many parts, and hopefully soon with CPU-ICs thanks to RISC-V, we can do simulation.
I don't expect real-time simulation, but at least a solution for letting the machine compute over night to see if the board successfully does X.
Any suggestions? Is this a problem waiting for a solution?
- monocasa 9y agoYou can do SPICE simulation with pretty much any CAD. I'm pretty sure that Eagle can do that. Edit: not sure why I got drive by downvotes. https://www.autodesk.com/products/eagle/blog/spice-simulation-part-1/ https://www.autodesk.com/products/eagle/blog/spice-simulatio... Edit2: for KiCAD http://mithatkonar.com/wiki/doku.php/kicad/kicad_spice_quick_guide http://mithatkonar.com/wiki/doku.php/kicad/kicad_spice_quick...
- madez 9y agoI'd like to for example create a PCB with some sensors, LEDs, and a microcontroller, specify the sensor input over time and the software on the microcontroller, and let the computer figure out the behaviour of that system, so it can tell me state of the system (i.e. what LEDs are on, or what values are in the registers of the microcontroller?) at a given time. For performance reasons, that would require both low-level simulation (electrics) and high-level simulation (software on the microcontroller) simultaneously in a compatible way. Can SPICE do that?
- jimmyswimmy 9y agoSPICE can do a lot, but you're asking a LOT. Modelling internal states of a micro is generally a different package than the mainly analog simulation that SPICE does. It is rare for them to be tied together. Practically speaking, your interface ought to be separate enough that you can define the range of states the micro's inputs should see, and the range of outputs it should drive, and separate the two. There are times when I've wished for a combined simulation but it wasn't worth the hassle to set it up. Honestly for the accuracy I expect I usually prefer to just build the thing rather than simulate it. LEDs are really boring to model anyway.
- madez 9y agoI also think that I ask for a lot. And I know that simulation is hard, error-prone, and often more expensive than just buillding the real system. However, building the system does not always give the insight that a simulation can give, and it's sometimes prohibitively expensive. More specifically, I already had built the system, but I couldn't get the information out of it without disturbing it too much. That's why I wanted to simulate it.
- stephen_g 9y agoA full logic simulation of a processor can be done from VHDL or Verilog code in software, but cycle accurate simulations are many, many orders of magnitude slower than a real IC. You can set up testbench code that feeds in data and stuff, and link different stuff together digitally. I don't know if there's much in the way of analogue simulators like SPICE hooked up to logic simulators though. The next level down is to run it up on an FPGA, which is only a few orders of magnitude slower than you can clock an IC.
- jononor 9y agoCombined software/MCU and circuit simulation is, as far as I know, not really existing in the FOSS world. I would loove to be proven wrong on this. Several times I've considered building my own...
- madez 9y agoI'm thinking about what would be necessary for it. It seems doable to me. First, one would need to separate the simulation into different domains, define interfaces between them, and then figure out appropiate time stepping for the simulation so the domains are properly coordinated. Depending on how low-level the simulation needs to be, getting the needed data for the parts might be problematic. However, when that data isn't available, then maybe the simulation can just randomly create plausible values, and do the simulation for these values. In reality, every part has slight variations so every board is unique too, when inspected closely enough. There is also a lot of merit in a simulation even if it can't go very deep, say, considering quantum mechanical effects inside the IC's. That may be practically impossible due to unknown data, or just give impractical performance. But there are a lot of use-cases that don't need that level of detail. What level of detail is realistically possible? If we know that a certain level of detail is too slow to simulate, then writing a simulator for a higher level is easier and we need less data for the models.
- jononor 9y agoI would be fine with even needing to modify the MCU code to use the simulator APIs in the Hardware Abstraction Layer - then no MCU emulation needed at all. So then essentially this needs to push/pull data in from the SPICE domain for the circuit simulation part. It should be possible to reuse an exiting simulator there, hopefully.
- aidenn0 9y agoIt seems I need pspice to use any of the vendor models though (or LTSpice if I stick to LT only parts).
- esmi 9y agoInstructions for adding a 3rd party model to LTSpice http://www.linear.com/solutions/4678 http://www.linear.com/solutions/4678
- rrmm 9y agoI don't know if it's generally that useful (in my experience). There are usually too many things one doesn't know: Many parts don't have models, or the right kind of models, and it can take more time and effort than it's worth to set up the simulation. Simulation is usually more useful when you have very specific questions about small parts of your circuit. Questions like will the oscillator start up under the full temperature range, or what's the phase margin of my analog front end. Big exception to this is FPGAs and other programmable logic where a major portion of one's time is spent specifying, simulating, and verifying a design in software. This can also include software/hardware co-simulation. But the toolchain for doing this is usually furnished by the silicon vendor. Another place simulation pops up more often is in power supply design and RF parts. TI, LT and other vendors have specialty software and wizards to simulate common designs. This is basically an extension of reference designs and demo boards.
- Aser 9y agoProteus (https://www.labcenter.com/simulation/ https://www.labcenter.com/simulation/) can do this, but it's not free. It's really great though, you just draw out your circuit, load in your compiled firmware and it will simulate it all.