EEVblog Electronics Community Forum
Electronics => Projects, Designs, and Technical Stuff => Topic started by: banedon on August 26, 2013, 02:26:06 pm
-
Hi guys
I've been delving (probably off the deep end) into digital eletronics. After completing my previous design for a Full Adder circuit, I thought I'd try something a little more... adventurous: a manual EEPROM programmer!
Memory and (eventually) microcontroller is something I've always wanted to try, so thought this would be a good way to learn.
I'm posting this to gather your thoughts and comments on my design - and to see if I've completely stuffed anything up :palm: :D.
One thing to keep in mind is that I ahven't done the timing digram yet so this may still need additional (or different) components dependig on what that reveals (timing diagrams scare me - never done them before! :scared:).
Here's the projects premise with a link to the schematic beneath:
EEPROM Reader/Writer
Parts
Item Qty Part
C1-4 4 100nF ceramic
SW1-3 3 8 way dip/rocket switch
SW4 1 2 poll switch
SW5 1 push button switch
IC1 1 Atmel AT28C64B CMOS (64Kb / 8K x8) parallel EEPROM
IC2 1 Texas Instruments 74HCT245 CMOS Bus transceiver
IC3-8 6 NXP 74HCT4511 CMOS BCD to 7 segment driver/latch/decoder
IC9 1 Texas Instruments CD74HC4050 CMOS Inverter
R1-4,23,24 6 8 way 500R/250mW resistor chip/network
R15-18 4 8 way 4k7/250mW resistor chip/network
R5-14,19-22 14 10k 250mW resistors
D3(a-d) 1 KINGBRIGHT - CC56-11CGKWA 4x7 segment LED display
Intention
Enable the reading and writing of a parallel EEPROM using dip switches and outputting the results to displays
User interface & use
The user has 3 sets of 8 way dip switch banks (SW1-3), a toggle switch (SW4) and a push button (SW5).
Reading: The toggle switch (SW4) is set to read . The user sets the address being read on the address dip switch banks (SW 1 & 2) and then the push button switch (SW5) is pressed for a second to do the read operation. Data outputs appear on D4 and D5.
Writing: The toggle switch (SW4) is set to write. The user sets the address being written on the address dip switch banks (SW 1 & 2), sets the data to be written on the data dip switch bank (SW3). The push button switch (SW5) is then pressed for a second to do the write operation.
Schematic snapshot
(http://img571.imageshack.us/img571/9807/kgt2.jpg) (http://imageshack.us/photo/my-images/571/kgt2.jpg/)
>>> The note detailing how SW4 operates regarding read/write info is incorrect (my bad). :-/O It should say:
"Closed = Low / READ operation
Open = High / WRITE operation"
Sorry!
-
Some remarks. You need to debounce SW5 for writing. Also the Atmel datasheet specify the write pulse width from 100ns min. to 1us max. Maybe the EEPROM won't work or will be damaged when you use much, much longer manually generated pulses. Then DIP switches have a lifetime of a few 1000 cycles. But i'm guessing you will give up before. :)
-
I found some switch debouncing idea here so will have athink on that: http://www.labbookpages.co.uk/electronics/debounce.html (http://www.labbookpages.co.uk/electronics/debounce.html)
In the case of needing to limit the button press time, I obviously need to find something that'll take an input and then output only for a predetermined time. I.e. received the SW5 button press signal nd output for just of 100ns - even if SW5 is still being held...
Going to have to have a think on that. Cheers for taking the time to high-light these problems :).
-
Another thing you may not have considered is that the display decoder chips you're using are BCD, rather than hex - and not even one of the variants that produce various symbols for 0xA-0xF, but instead one that blanks the display for those undefined BCD values. You might find this somewhat restrictive - around 60% of all possible data values won't display usefully!
-
Hi baljemmett
Yeah, I thought of that earlier today :). Given that most LED 7-seg displays have the same inputs, I was going to look at changing them over for hex ones later. It's a pity as I rather liked the idea of having a joined 4-in-a-row set.
@Sync
I've found a guide on youtube which mentions using a resistor/capacitor/schmitt trigger combination to debounce the switches.
Digital Electronics: Debouncing a Push Button Switch (SPST) (https://www.youtube.com/watch?v=tmjuLtiAsc0#ws)
The only thing which might be a problem with the example in the video is that it inverts the input, so obviously I need to using a non-inverting one.
-
Thinking on the set time for accessing the EEPROM, what about using a J-K flip-flop / 555 Timer combination?
-
I've found a guide on youtube which mentions using a resistor/capacitor/schmitt trigger combination to debounce the switches.
Digital Electronics: Debouncing a Push Button Switch (SPST) (https://www.youtube.com/watch?v=tmjuLtiAsc0#ws)
The only thing which might be a problem with the example in the video is that it inverts the input, so obviously I need to using a non-inverting one.
That's a classic way to debounce a switch. For the non-inverting one just use an inverter after it. The 74HC14 schmitt trigger has 6 of them. You can use them as normal inverters. Also for your 74HC4050 which is non-inverting btw.
To generate the write pulse you can use a monostable multivibrator. Look at the 74HC221. It even has a schmitt trigger for the B trigger input build in. So you don't need an extra IC for debouncing.
But there will be new problem. You uses SW5 for reading the EEPROM too. Now it will only display the value for a very short time. You won't see it. I would change the circuit that it always display the values when in read mode.
Another thing. Setting the addresses with DIP switches will be very annoying. I would use a up/down counter. With up and down keys for each digit. But also with a carry from from one digit to the next, e.g. 1F -> 20. This alone is a nice beginners project into discrete digital logic.
Thinking on the set time for accessing the EEPROM, what about using a J-K flip-flop / 555 Timer combination?
I don't thing a 555 is suitable for sub micro second pulses.
-
Fantastic :). I'll look into your recommendations and see what's what. Ultimately, I'm not serious about using this circuit to write data to an EEPROM which is then used elsewhere; I'm more interested in seeing what this teaches me and just getting it to work at all :).I wouldn't worry too much about me knackering my fingers and raging at DIP switches :D. If I get it working at all I can remake the user interface if needed - like a carry over project.
BTW, you don't happen to know of a CMOS BCD Encoder/Decoder which supports characters A-F (as wll as 0-9) do you? I've had a look at Farnell's website and all the ones I look at there seem to be straight 0-9 with anything else blanked.
UPDATE: Looking at my schematic, do I need the resistor network R17 given that there are no switches on the data bus and only ICs load that bus now? I had it on there from before I added IC2 which is a 74HC245 bus transceiver (so that I can stop the data bus being loaded by SW3 during read operations). However, R15 and 16 stay as they are loaded directly by SW1 & 2...?
Also, to address what you were saying about the results not being displayed for long enough because of SW5. Perhaps I should employ a latch which holds /LE on ICs3-8 once they've gone low...
THis is getting complicated and I've not got to the hard part yet lol. But nothing ever comes if you don't have to work at it (or persue advice in this case!)
Further update - here's the new debounce circuitry:
(http://img844.imageshack.us/img844/5201/8eck.jpg) (http://imageshack.us/photo/my-images/844/8eck.jpg/)
-
BTW, you don't happen to know of a CMOS BCD Encoder/Decoder which supports characters A-F (as wll as 0-9) do you? I've had a look at Farnell's website and all the ones I look at there seem to be straight 0-9 with anything else blanked.
No. I only found a few obsolete parts.
UPDATE: Looking at my schematic, do I need the resistor network R17 given that there are no switches on the data bus and only ICs load that bus now?
No.
You also don't need the pull up resistors for /BI and /LI at the 74HCT4511. Just connect the inputs directly to +5V.
However, R15 and 16 stay as they are loaded directly by SW1 & 2...?
Yes.
Also, to address what you were saying about the results not being displayed for long enough because of SW5. Perhaps I should employ a latch which holds /LE on ICs3-8 once they've gone low...
Sorry, i didn't realized that 7 segment decoders are latched. When /LE goes high the value is stored and the display remains. It should work. But the values are only updated when SW5 is pressed. Not when you change the DIP switches. Do you what this?
Further update - here's the new debounce circuitry:
(http://img844.imageshack.us/img844/5201/8eck.jpg) (http://imageshack.us/photo/my-images/844/8eck.jpg/)
The signal from IC10B has the wrong polarity. When SW5 is pressed it goes high. You need to invert it. You can just use a remaining inverter from the 74HC14.
And replace the 74HC4050 with another inverter from the 74HC14. The 74HC4050 is non-inverting.
-
You can use schmidt-trigger gates for debounce but your circuit gives you an active high pulse to the *Write pin, but I think an active low pulse is needed. If you cascade two schmidt-trigger stages with a short R-C coupling for create the correct short pulse for write from the second schmidt-trigger stage.
-
Hi guys
I've put in an inverter on SW4 & 5 lines to deal with the debounce circuitry signal inversion effect. Also, changed the outputs to reflect the corrected outputs for IC1 /WE line (well spotted!).
The truth table for SW4 should now be:
(http://imageshack.us/a/img838/9307/3a21.jpg)
Updated circuitry schematic:
(http://img10.imageshack.us/img10/8776/upx0.jpg) (http://imageshack.us/photo/my-images/10/upx0.jpg/)
I'm still stuck for displays... does anyone have any suggestions? I wanted to use 7 segmented LED displays as they're very basic and easy to use :(.
-
Hi guys
I've put in an inverter on SW4 & 5 lines to deal with the debounce circuitry signal inversion effect.
Not really. Here is the truth table directly from the 74HC4050 datasheet. See, it doesn't invert your signal.
(https://www.eevblog.com/forum/projects/eeprom-programmer-design/?action=dlattach;attach=58960)
And here is a small drawing error. You are shorting both switches together.
(https://www.eevblog.com/forum/projects/eeprom-programmer-design/?action=dlattach;attach=58962)
I'm still stuck for displays... does anyone have any suggestions? I wanted to use 7 segmented LED displays as they're very basic and easy to use :(.
This is normally done in software on a microcontroller. It can be done with a programmable logic (PAL, GAL, CPLD, FPGA), discrete logic or a *ROM too. The dedicated hex to 7 segment decoders are obsolete, hard to get and very expensive (10$ each or more).
Or you can go the classic unix way and use octal numbers instead of hex.>:D Use only 3 bits per digit. Then the 74HC4511 will work perfectly.
-
Hi Syn
Thanks for the heads up regarding the drawing error (it was Eagle trying to be helpful after I moved the lines :)) and also inverters. I've replaced the 4050 with a 4049 (same family, just inverting version).
I don't really want to introduce a CPU at this stage (ironically, it's partly for a small 6502 microcomputer project that I'd doing this project - need to write the EEPROM). Can an LCD display accept hex numbers and display them?
-
Ok. I've "simplied" the display a little (;)) so that I can at least try and test the unit. I can decide later on a more suitable display method.
Here's the latest schematic:
(http://img547.imageshack.us/img547/7664/a2q6.jpg) (http://imageshack.us/photo/my-images/547/a2q6.jpg/)
-
You could just light up one digit at a time to save shift registers and resistors and lower the power consumption ... maybe use a ULN2003A or ULN2004A if you use the proper type of led digits.
-
Hi Syn
Thanks for the heads up regarding the drawing error (it was Eagle trying to be helpful after I moved the lines :)) and also inverters. I've replaced the 4050 with a 4049 (same family, just inverting version).
The 4049 will work.
I don't really want to introduce a CPU at this stage (ironically, it's partly for a small 6502 microcomputer project that I'd doing this project - need to write the EEPROM). Can an LCD display accept hex numbers and display them?
No.
Ok. I've "simplied" the display a little (;)) so that I can at least try and test the unit. I can decide later on a more suitable display method.
Here's the latest schematic:
You need base resistors for the LED driving transistors. 4.7k Ohm in series with the base is ok.
The circuit could work. The write pulse length problem is not fixed. But maybe it's not an problem. Prototype it and see what's happen.
-
I tried a test circuit with just the address bus & data bus switches (and pull down resistors) connects. /WE was tied low to GND and /OE tied to +5V. I put in SW5 and the debounce circuitry and linked that to the /CE pin (I tied the SW5 high when closed and the used a 4k7 drop down resistor to do away with the need for the inverter).
Unfortunately it didn't work :(. here's a picky. Took me ages to wire it up. I checked that the switches worked when closed, that the /CE pin went low when the SW5 was pressed. Also buzzed out the lines from +5V rail through the switches to the pins. Double checked correct lines went to the correct pins.
I used did use a 9V battery through an L7805 +V regulator (max 1.5 Amp). Both are new and seemed to be supplying the correct voltage.
Possibly a timing issue?
BTW the EEPROM itself is has been tested using a batronix BX32 programmer. I wrote a test file to it fine and am using it to check to see if I have written anything.
If anyone has any advice please let me know. In the meantime I'll try and figure it out myself |O (and possibly purchase a hammer... >:D).
(http://img542.imageshack.us/img542/8703/xfa4.jpg) (http://imageshack.us/photo/my-images/542/xfa4.jpg/)