(this page being created 30 Jan 17)
The role of CvPcb
You need to have a beginner's understanding of schematic symbols and footprints before you tackle the following. If you haven't done the first exercises of the [se1main Simple Example of Using KiCad], I suggest you go there first. About half way though it, there's a whole page on HOW you use CvPcb to map schematic symbols to footprints. Along the way of doing it, your understanding may grow.
This "short" explaination is about the underlying concept… and it is a Very Big Deal. In some respects, it is what KiCad is all about!
Just before that, a quick word about the use of "mapping" I am using here.
If you "map" two sets if "things" "onto" each other, which is the sort of sentence you make. In this case, we are going to map the schematic symbols of the schematic to footprints on the PCB, you are making assignments.
Suppose you were teaching a class of 20 children. And your school was being visited by 10 children from another country for a week.
You might say "John and Sarah, look after Nadia", "Mary and Henry, look after Ali". That would be "mapping" your kids to the visitors.
Back to electronics and KiCad….
You always start PCB design in KiCad by drawing a schematic.
The following is an ALMOST POINTELSS CIRCUIT! Do not make yourself crazy trying to figure out WHY you would connect those things together thus. IT IS NOT "good for" ANYTHING.
But it is a circuit which will be useful for our discussion of what "mapping schematic symbols to footprints" is.
In it we have a bunch of resistors, LEDs, a capacitor and some switches. U1 (the yellow box) is a 555 timer chip. The two "D"s are NAND gates from a single 7400 logic chip. (There are another two NAND gates in the chip, which we aren't using… and we've left the inputs floating. (Bad idea if you wanted to USE this circuit. But we don't.))
Not counting the power ports, a topic for another time, there are about 14 devices in the circuit.
We're going to create a suitable PCB for that circuit.
Here's the clever bit. The "mapping schematic symbols to footprints" bit.
What something looks like on a circuit diagram, and what it looks like "in real life" are often quite different. Even in the case of a simple resistor, where the symbol and the device look quite like one another, for the PCB we need to know how far apart to make the two holes for the through board leads, and how big to make those holes.
Furthermore, although it would be very crude, and I wouldn't commend this, you COULD use the footprint of a resistor as the footprint for the capacitors (if they were about the same size and shape as your resistors). You could use the resistor footprint for CONN_02X01, the place (left side of schematic) where 5v and GND are connected to the PCB.
If I hadn't made a stupid mistake, you certainly COULD, and WOULD used the same footprint for the two ICs. My mistake was when I worked on the premise that physically, they are both 8pin DIL devices. The NAND is a 14 pin chip… but for now, until I can re-work this, pretend it only has 8, please? They have very different electronics inside them… but the PCB is just about physical things. The sockets for a 555 and for a 7400 are identical. (If you allow my alternate fact that 7400s come in 8 pin packages.) So: Two different things in the schematic (3, if you count 555 Timer + first NAND gate + second NAND gate)… but the footprint (PCB element) for each of them is the same!
Mapping is done with the CvPCB tool. The details of doing it are discussed in the simple KiCad Introductory Exercise… but here, we will dwell on what KiCad is doing internally, when we do the right things in using the software.
When you invoke CvPcb, you already have a list of the devices in the circuit. And each has a unique identifier after the "annotation" process.
During CvPcb, you will say "for device xxx, use footprint yyy".
And so, when you invoke PcbNew, the right footprints will be "dumped" onto the page, for you to move around, rotate, and generally get "just right". And then interconnect with tracks.
While you were choosing footprints, you consciously made choices even for something as simple as a resistor. How far apart do you want the holes? How big should the holes be? (The resistor footprint comes in various "sizes". That's the easy choosing. If you need a size that hasn't been provided in a "standard" footprints, you can, once you get past being a novice, change dimensions, or create a new footprint.)
But something even more clever than you may have noticed is going on. It becomes more obvious when you are dealing with something like the 555 timer chip of our example.
Not only has a schematic symbol with 8 pins been matched up with a footprint with 8 pins, but the system "knows" that, for instance, the "TR" signal in the schematic has to be "on" pin 2 of the 8 pin DIL.
I haven't explained this very well, I fear… but it really is very cool.
Even more cool is the fact that there are two invisible pins on the 555- the pins for power to the chip and the ground connection. Even though they aren't shown on the schematic (unless you've requested "show invisible pins"), they will be connected up, if you have done the right things with power ports…. which must, I fear, be a story for another time.
And then there's the multi-gate device. Now the schematic-connection to footprint-pin matching up is even more clever!
(Sorry… this is a first stab at this page, when several other things are also pressing for my attention. I hope it was of some help?)