Wednesday, July 10, 2019

Flipping the P170-DH board in KiCad

After flipping the power subsystems from the front of the board to the back and fixing up the layouts, the only parts remaining on the front of the board are the VFD, a filter capacitor, and the power fuse. Everything else is going to be mounted on the back. Thus it occurred to me that when I do most of my work with this board, I'm going to be looking at the back. That's where almost all of the components are. And once the board is mounted in the calculator's upper shell behind the keypad, the back is the only side I'll be able to see.

KiCad allows me to flip the display of the board in the pcbnew board editor. However, if I print an image of the board it's still the view from the front that gets printed. That means I'd either have to be looking at the board layout on a computer when placing parts and debugging, or mentally transpose component positions from a printed image. That didn't sound appealing.

I participate in the KiCad user forum, which is a wealth of information. Searching the forum I found that someone else had already asked the question of how to flip an entire board layout. The answer is remarkably simple:
  1. Turn on all "Items" in the "Layer Manager" panel.
  2. Use the mouse to select the entire board.
  3. Press the "F" hotkey.
  4. Fix the orientation of text as needed.
Anticipating the opportunity for serious trouble, I first saved my work and made a commit of its current state to my revision control system (git). Worst case I could revert to this state simply by checking out this revision from the repository. Then I held my breath and flipped the board.

Somehow I expected it to flip about a Y axis, swapping left for right, but instead it flips about an X-axis. Since I still had the entire board selected, I rotated the board twice with the "R" hotkey into my desired orientation. Then I used the mouse to drag the entire board until the lower left corner (my preferred measurement origin) was positioned over the Aux Origin.

I spent a few minutes trying to spot any problems and found only a couple of minor things. I'd renamed the second inner layer from "In2.Cu" to "In2.Cu‑GND" and marked that layer as a power plane, but now the ground plane was on the first inner layer so I renamed both layers and changed both plane types. I wanted the mounting holes to be un-flipped without moving them, so I re-flipped each hole individually. I also discovered that one of my through-hole testpoints had been left on what had been the top, and it had to be re-flipped as well. I had one bit of text on the silkscreen layer that was now upside-down and needed rotating to the proper orientation. Otherwise it was pretty much painless.

With all this fixed I saved the board and created a new git commit. Flipping the board is a major change, and git reported that 72% of the lines in the board file had been rewritten. This is why I did a commit immediately before and immediately after flipping the board, as there's really no way to look at the differences between the two revisions in any useful way.

Now my biggest problem is that I'm used to seeing the tracks on the component side in green and the keypad side in red, and now they're reversed. I could fiddle with the layer colors but I think I'll leave it this way for consistency with other board layouts..

No comments:

Post a Comment