A couple of students have experienced a few problems in getting their oscillators to work properly. Their hardware exhibits the following characteristics: When the processor is held in reset, the oscillator seems to work correctly; however, when the reset button is released, the oscillator and ALE signals quickly stop.

One cause for this problem is that the processor includes a power down mode which can be entered by mistake when Port 0 is not connected to any other hardware. Note that if the PDE bit of the PCON register is ever set, then the processor goes into power down mode and the oscillator is turned off. The only way out of power down mode is by doing a reset of the processor. One might ask how the processor gets into power down mode. The answer is that when EA* is tied low, then the processor expects to perform program fetches from external memory. Remember that the basic state machine of the processor directs it to repetitively fetch an opcode/operand from external memory and then increment the program counter. If Port 0 is not connected to any driven signal (i.e. it is left floating), then the processor reads noise when it does each opcode fetch. If the noise that it reads is interpreted as a valid opcode, then it performs that instruction. If any of the noise that it reads indicates that it should set the PDE bit in the PCON register (e.g. by performing a MOV or ORL instruction), then it will shut off the oscillator and go into power down mode, in which state the ALE pin is held low. Due to the fact that the processor actively drives Port 0 with an address for each program read (immediately before it samples its Port 0 inputs), then a variety of opcodes can be interpreted from its inputs as the PC is incremented. If the IDLE bit in PCON is set instead of PCON, then the processor will enter idle mode, in which the oscillator keeps running but ALE is stopped and held high.

A generic fix to this problem is to pull the Port 0 pins high using the SIP pull-up resistors included in your parts kit. This should prevent the processor from going into power down mode, thus keeping the oscillator running. You can leave these pull-up resistors in your circuit for the rest of the semester, as they do not negatively impact the operation of your hardware once memory has been added to your board.

Note that some of the oscilloscope leads that you will use in the lab are not the highest quality, and that the signals you examine may appear noisier than they actually are.



Some students have problems getting ALE to oscillate at the right frequency after power on. They see ALE at 11.0592 MHz instead of the correct frequency/duty cycle. Once they probe the XTAL2 pin with the oscope probe, ALE starts working correctly. This has to do with the oscillator circuitry. In order for the oscillator to start up correctly, the feedback circuitry needs to be correct. This is a matter of using the correct capacitor values (and perhaps a resistor), and is a function of the exact crystal used, the exact C501 used, and placement of components; therefore, it can differ between different student's boards (27pF does not work in every case). One possible solution is to modify the capacitance on XTAL1 or XTAL2. In many cases, the problem was fixed by adding another 27pF cap in parallel with the existing 27pF cap on the XTAL2 pin for a total of 54pF on that pin. After this was done, the oscillator would start correctly at power on.



On a few student boards, the problem with oscillator startup or frequency was identified to be a faulty power on reset signal. In those cases, modifying the circuit to ensure an appropriate RC delay at the C501 reset pin gave the processor oscillator enough time to stabilize before the processor was let out of reset. The RC time delay can be viewed by using the Normal trigger mode on the oscilloscope, setting the trigger level to be about 4.5V, setting the scope to trigger on the falling edge, and setting the time scale to about 20ms/div.