Connecting the Switches

Connect the switches and switch resistors to the microcontroller in the same logical order that you had them connected on the prototype board. Start with switch one. The switches used in this example are normally open, momentary switches which means when left alone the circuit is open. When the button is pressed, the switch connects the pins from side A to side B. You cannot put two different circuits on one switch because both side A pins are a single circuit as is the same with side B.


Consulting the pin layout in the Atmega 16 data sheet, we see that PortB.2 through PortB.5 are pins 42, 43, 44, and pin 1 respectively. Draw a net from the Atmega pin 42 to the bottom pad of R3. Name that net portb2. Draw a separate net from the top pad of R3 to a B side pin on switch 1. Name that net switch1. Draw the final net for the switch 1 circuit from an A side pin to any ground. That net will already be named GND and will not ask you to rename it.


Figure 11.9

Now create your traces for the nets you dust drew.


Figure 11.10


Finish the switches, connecting switch 2 to pin 43, switch 3 to pin 44, and switch 4 to pin 1. Make sure you save your board often. If the software crashes, you will lose all of your work since your last save.


Figure 11.11