Help with BS2 and 74HCxx logic!

I have decided to write up a PBASIC 2.5 program to identify different logic gates. IT DOESNT WORK!! I think I am having issues reading the input. I have tested with a 74hc02 NOR chip, got a test failure in debug three times. the fourth time, it identified the chip as a NAND gate. I ahve tested the gate by hand, so I know that it is indeed a functioning NOR gate. Here is the code and the output from debug when it thought it had a NAND gate.

I'm assuming you are referring to all the quad 2 input gates (01, 02, 03, etc) with 14 pins. In that case I would suggest two output bits, each connected in parallel to the 4 inputs of the gate (I/O 0 to pins 2, 5, 8, 11, I/O 1 to 3, 6, 9, 12) and inputting the 4 outputs of the gates as a nibble. That way you can test all the gates at once, see which if any may be defective, and determine the type of gate based on the majority results.

Okay, I'm assuming pin 1 is at the bottom right; the notch is at the bottom.

Power to the gate pack is correct. You say it is an x02 so the output is pin 13 (light blue wire), connected to BS2 pin 2.

You are applying inputs on 11 and 12; good so far.

I would connect pin 13 to a LED (through a, say 1K, resistor) (disconnect BS2 pin 2). Now exercise the gates inputs and see that the gate works correctly (either high makes a low). If not, you have killed the gate. If so, you got a bug in your program.

So, I will measure the voltage between the gate and BS2. I think the gates may not be sinking their output properly.

Awesome, are you able to scope IN2 to see if it is actually being driven correctly by the device under test?

Most logic devices can sink current up to a couple tens of mA, and that's noted as Iol on the respective datasheet. However, the drive high current (Ioh) is typically a few hundred uA. I wonder if IN2 is in a state that is sinking all that current and not allowing the device under test output to rise to its Voh.

Well, the device is actually working, that was confirmed by LEDs. But when the test code was run the last time, it showed that each time the stamp read IN2 it was indeed stuck HIGH. Testing the gate driven by stamp pins, reading with a multimeter, I found that high was about 4.9-5.1 volts(I don’t remember), and that low was about 2.1 millivolts. I think IN2 may have been damaged, so next time I’m on the laptop I’ll switch over to another pin and add a 220ohm in series or as pull down. Wiring experts have any idea which?

If the BS2 is not driving a pin, the input impedance is effectively infinite. Any gate package totem-pole output known to man can drive it.

If the BS2 is driving a pin HIGH (or LOW) it is either because the BS2 is broken or it is being programmed to drive that pin. My money would always be on the programmed case. Oftentimes programs left over in the PROM from earlier projects have unexpected consequences. Write and download a little program so that you know what the BS2 is supposed to do. For example

Unused pins on the 74hcxx chips are left to float, as they are not related. The BS2 is not driving the pin, but it only reads high. I am not on the laptop, which has the code and editor, so I cannot experiment right now.

You could do what I suggested in an earlier post and connect the two outputs that go to the 74xx inputs to all 4 gates in parallel. That way no input is floating and you can use 4 input pins to read all 4 gate outputs, or a single input to test 1 gate. If you are short of I/O pins you could always put leds on the outputs to visually determine if each gate is working since all 4 leds should be on or off at the same time.

Cluso is correct in that good engineering practice dictates that the inputs of unused gates be controlled. A single pull-whichever 1K resistor would be fine in this case. We always used separate resistors because it made it possible easier to use the previously unused gate(s) if it proved needful. That said, I don't think it will make any difference in this case. The gates really are pretty much separate.