

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
In this document, students are provided with instructions for adding battery backup and an i/o decoder to a microprocessor lab circuit. The lab manual explains the purpose of each modification, the components required, and the steps to implement them. The document also includes important notes on resetting the cpu, checking unused inputs, and preventing glitches when writing to memory.
Typology: Lab Reports
1 / 3
This page cannot be seen from the preview
Don't miss anything!


In this lab, you will add circuitry to allow the CPU to read the keypad directly and to allow the CPU to write to the data display chips ONLY when it has something useful to say. Up until now, the display chips showed whatever was on the data lines, and the keypad only wrote to the memory. This leads, of course, to lots of information being displayed that’s of no use to a user of such a circuit, such as opcodes as the machine executes it’s program. To understand what’s happening, it is useful to read p. 459 - 462 of the lab manual before beginning. There is not as much wiring this week as last week, but there is more programming. If you were behind a little last week, you may again catch up a bit this one. As always, wire neatly or pay later. Some boards look pretty manageable to troubleshoot... some are probably a nightmare.
PUTS OF THE ’HC CHIPS YOU INSTALLED IN THE LAST 3 WEEKS ARE TIED TO +5v. I’ve noted that many inputs, especially on the HC74’s have been left floating. You may get by with this for awhile, but this can also destroy the chip and/or cause bezarre circuit behavior. I have intentionally left a few floating on the demo board (in spite of the fact that this is a bad idea overall) so that it’s not quite as confusing to trace wires if you go up to look at it. I’ll be tidying up, however, as well. Leaving HC inputs floating is bad form, even if your circuit works. Also note that it is a good idea to RESET the CPU (via the keypad RESET) EACH TIME you turn on power. Failure to do this can sometimes leave the CPU in an unresponsive state and bizarre behavior sometimes ensues. RESETTING the CPU makes sure that all registers are set to a known startup state and don’t lead to any oddities.
19.1 (p. 472) Do this section following the lab maual instructions. The 3 Volt supply is located on the underside of the breadboard and is brought out to the binding post marked as such. Replace the 6263 diodes in the circuit diagram with 1N5817 diodes from your parts cabinets or on the front table in the lab. This battery backup will save any programs you meticulously type in by hand from being lost when power is turned off. DISCONNECT the direct power connection from +5 Volts that you had previously for the RAM. If you put in miswire on this, it’s possible to short out a batter occasionally leading to a spectacular failure Be careful with all your diodes and transistor that you connect them correctly. Remember that the band on the diode, when conducting, is toward the negative side. In our case, the band should be “toward” the memory and “away from” the power sources. Notice also, the zener’s direction... In the case of the zener diode, the band is toward the positive side. Look on the laminated datasheets or in the back of your lab manual for the pinout for the 2N3906 transistor. The “arrow” of the transistor in Figure L19.3 points from the Emitter (E) to the Base (B) and the 10K resistor and CS2 connect to the memory.
19.2 Do as instructed. Replace the 1N748 Zener diode in the circuit diagram with a 1N Zener (also 3.9V) from your cabinet or the front table in the lab. Be sure to run a +5 volt line directly from close to the 5V binding post to close to the transistor. This circuitry prevents glitches from writing to memroy when you turn power on and off.
19-3 Do as instructed in the manual. Look at the assmbled breadboard for hints. Before testing the I/O decoder, take a minute to figure out what it is supposed to do: Output n goes LO (true) only when ALL THREE enable conditions are true AND when binary n appears on S2 S1 S0. The enables are true when A15 is high (address 8000H - 8FFFH), when FC1 and FC of the CPU are not both high (when they are, this means the CPU needs to service an interupt), and when DS* is LO (the CPU is sending or receiving data). For example, when the CPU wants to write data to memory location 8000H, OUTPUT0* goes LO (R/W=0, A1=0, A0=0), while when it wants to read data from 8000H, INPORT0 goes LO. Because we are not decoding A2 and up, reading and writing to 8004H, 8008H, etc will be the same as reading or writing to 8000H. This is becuase only the values of A1 and A0 are being looked at.Test the decoder as instructed. Be sure to load the first eight memory locations with 00 00 20 00 00 00 01 10. (Do you see why?) You needn’t do the full speed optional test. On this same note, read the note on word sized pointer definitions. Note that on line 110 we move a word sized chunk of information (16 bits) into a LONG WORD address (32 bits). What to do, what to do... we have to many bits... The processor deals with this little dellema by “Sign Extending” the upper word of the address from the MSB of the lower word. Since the MSB of our lower byte is 1, this sign extends to FFFF8000, which is just ducky for the processor. It writes this value into the address register perfectly happily. But alas, our compiler only allows for 16MBytes of memory, so anything above 00FFFFFF is strickly verboten as far as it is concerned. Besides, we’re only looking at the Address lines up to A15... We DON’T CARE what the others are. So again, hardware is king. The kicker here for you may be if you try to simulate it. It will compile the code just fine, but as the address listed is out of memory range, will give you an error. The compiled code will work just fine (compare with what’s in the book if you like), but if this error bothers you, your free to use a long word instead for your movea command (movea.l)... You’ll just be typing a little more.
19.4 Do as instructed in the manual. Again, refer to the assembled breadboard to place your chips and wires. Here, you will be replacing the ENABLE pins on all four data display chips and the BLANKING pins on the rightmost two data display chips, so BE SURE TO REMOVE THE PREVIOUS CONNECTIONS TO THESE PINS. This circuitry allows the leftmost data display digits to show what is on the data lines when you “single step”, have control of the bus (busgive* is true), or when the CPU does a word (16 bit) write to 8000H.
19.5 Do as instructed. You should read throught the entire exercise before beginning. Put your boards back to the side of the room when you’re done. I recomment putting the keypad on top of your board or to the side (even better), rather than underneath, least your keypad accidentally short out your batteries. Also, do NOT bother unplugging your keypad from the breadboard. It will cause you more harm than good. I think sometimes people unplug worried that they will accidentally bump a key and overwrite part of their program, but remember – You added back circuitry that keep the info in the memory but disabled the memory via the chipselect lines, so you won’t overwrite it if you’ve wired carefully.