Friday, February 11, 2005

a painful day ends in revelation. a prelab, due this evening, called for a printed circuit board (PCB) schematic and wiring diagram. rectangular blocks, each having between 16 and 56 pins on them, needed to be wired together such that synchronized memory reads could occur. my lab partner alex and i sat in the freezing computer lab at around 1 PM wracked with confusion. his first question to me was why components could not be loaded from the schematic to the layout diagram. We wasted an hour trying to debug netlist errors in a vain effort ("to load the schematics"). alex seized the day and walked down three flights of stairs to the embedded lab. there he saw that people were not designing with specific serial numbered components but with generic dual inline package (DIP) footprints which matched the dimensions of the components. it was only then i realized that there was no need to load schematics to the layout tool. it doesn't care what the serial number is on a component. nonetheless, the assignment called for both schematic AND layout. i discovered that schematic tool was hinky. parts could be cut and pasted between schematics only by copying to the clipboard, closing the file, opening the file you want to paste to, and then pasting. the schematic software couldn't hold two documents open at the same time and let you cut and paste between them. two problems solved. 4 pm. we then proceeded to draw hundreds of wires, connecting write enable pins, wiring logic into nand gates, forking datapaths around latches (multiplexing), etc. alex muttered that what we were creating was fucked up. into lab. it is there that we bask in the warm glow of information. after some more nervous "what do we do now" kind of moments we are paired up with two chinese students for the actual PCB hardware segment of the project. (custom PCB boards are relatively cheap, but at $51 a pop you still don't want a bunch of people running willy nilly with their own designs. better to create large groups.) one of the fellows had a beautiful layout on his monitor with all 45 degree wire turns. meanwhile our layout was a 90 degree maze. we'll get to why this is bad in a minute.

it was getting late and we had a crankyness settling in, but alex had a few questions. why did the TA tell somebody that they could wire their external memory pins anyway they wanted, why could the write enable pin be set to ground rather than carefully wired. robin came over and showed us that an external memory has practically no preferences as to how you hook up its address and data pins. since the program always reads data from where it stores it, the actual hardware location of data is irrelevant. coming and going. it stunned me and then filled me with a sense of zen enlightenment. after the long day, you come to the realization that is you, not the computer, behaving rigidly. "did i give you a hard day? i think not, i could give a fuck where you wire my pins, i'll put your data wherever you tell me and give it back regardless of how i am asked. regarding the write enable pin, it is there for larger PCB schemes containing a bus, wires that are shared between multiple IO components. when one component is no longer using the bus, it sets its outputs to "undefined," effectively greasing the rails of the bus for other users. however, since we were only interfacing one memory, there was no need for a bus, no need to worry about setting the write enable bit correctly. more slack from the computer. it cares less than you do.

finally, i asked why it is so important not to draw PCB wires at 90 degree angles. robin drew a square outward spiral, asking, "what am i drawing" "an inductor" i say. he says right. "what does an inductor do" "disrupts adjacent wires, traps energy." right, "how many turns is this?" i count four square turns; a powerful inductor. he draws two sides of a square, a corner. "how many turns is this?" "1/2 turn" i say, "wrong, one quarter turn." obviously, the corner of a square is a one quarter turn, you need four of them the get back to the beginning. ultimately, the circuit is better if all connections are smoothly sloping, aerodynamic almost.