I'm currently working on the RAM of my 16 bit computer which consists of two AS6C6264 SRAM chips. On each chip I have CE2 connected to 5V, CE# connected to ground, WE# connected to 5V through a pull-up resistor and a button that is connected to ground. To manually write to the RAM, I have two 8 pin dip switches that go through data selectors and into the inputs of the RAM. Whenever I push the button, WE# goes low and the data from the data selectors is written into the RAM.

For whatever reason, this works perfectly fine whenever there are 5 or less dip switches in the up position. Whenever there are more than 5 dip switches in the up position and I try writing to the RAM, it doesn't seem to write correctly to the RAM, and at a certain point, it just writes all 0's.

I have no idea what to even look for, I tried looking at some of the pins on an oscilloscope, but it hasn't really shown me much, other than that there is noise.

Thanks for any help or advice.

  • \$\begingroup\$ Do you have pullups/pulldowns on the DIP switches? \$\endgroup\$
    – user39382
    Jul 29 '18 at 19:40
  • \$\begingroup\$ I don't, when they are in the up position it is connected to ground, when it's in the down position, it is floating. I can see why this could cause some problems. What would you recommend? \$\endgroup\$ Jul 29 '18 at 19:56
  • 1
    \$\begingroup\$ Additionally: Do you have a decoupling capacitor on the RAM? A schematic and/or picture of your breadboard setup would help. \$\endgroup\$
    – user39382
    Jul 29 '18 at 21:23
  • \$\begingroup\$ i.imgur.com/SvwM7a2.jpg No decoupling capacitor across the RAM, but there are capacitors on the power rails. \$\endgroup\$ Jul 29 '18 at 21:28

In a comment, you explained that your DIP switches do not have pullups or pulldowns:

[…] when [the DIP switches] are in the up position it is connected to ground, when it's in the down position, it is floating. I can see why this could cause some problems.

Indeed, this will cause problems. Most SRAM chips will be CMOS-based, so the state of a floating input will be unpredictable.

The easiest fix will be to use resistor networks to add pullup/downs. Get a couple of SIP9 resistor packs. (Here's a listing on Mouser, but these parts are readily available from any major distributor.) These 9-pin packs consist of eight identical resistors wired like so:


simulate this circuit – Schematic created using CircuitLab

You can use these to pull all eight pins of your DIP switch up or down by attaching the common pin (on the left) to VCC or GND. Use any value in the 1kΩ to 20kΩ range. (Anything higher may not be sufficient to pull the pin reliably, and anything lower will draw too much power while pulling against a closed switch.)

  • \$\begingroup\$ Thanks for the help, but just out of curiosity, is there any difference between doing this and just using 8 resistors of the same value? And why is the floating pin bad for CMOS? \$\endgroup\$ Jul 29 '18 at 20:37
  • \$\begingroup\$ @ThomasGoleberski there's no functional difference between using a SIP pack of N resistors and using N separate resistors. The only difference there is the convenience factor. SIP-packaged pull-resistors are often way easier to route, even on breadboards - you need just one wire to connect the common node, rather than using a wire per resistor or something like that. \$\endgroup\$ Jul 29 '18 at 20:55
  • \$\begingroup\$ Yeah I figured that, although I put 8 pullup resistors on one of the 8 pin dip switches and the same problem persists, I think I might have misspoken when I said that I'm having troubles with writing to the RAM. I think it is being written correctly, it's just that there is a lot of noise coming from the output when a lot of outputs are 1's. Here is the oscilloscope output on a pin that was written as 1 when there was a total of 6 pins written as 1's. i.imgur.com/E6GDCBM.png \$\endgroup\$ Jul 29 '18 at 21:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.