Only Memoriesquot and ROM could refer to a chip that has some data in it that you can only read. There is no way to write it or change it, so that the chip is manufactured in a way that it has that data in it. But there are other types of ROMs that are programmable and those are called PROMs or quotProgrammable. Read Only Memory and those usually give you some way of programming it once so. You get the chip and it’s blank and you can program it once and once you’ve programmed it. Then you can’t change what’s programmed in it, but you can read it as much as you want and of course that can be inconvenient, so they also make any EPROMs which are erasable programmable, read only memories and usually can be erased by exposing them to ultraviolet light. So this here is an EPROM and you see there’s a little window on the top of the chip and you can see the the die and so what you can program this and then it’s a read, only memory at that point, but you can also erase it By exposing the the die here to ultraviolet light, so you need some kind of ultraviolet eraser thing to to erase these. Otherwise you know you can also you leave them out in the Sun for a few hours. Sometimes that works, which is, which is why they also have these little stickers that go over top, so they don’t accidentally erase themselves so that’s, a erasable programmable read only memory, but the most convenient kind of the electrically erasable programmable read only memory, which is what these Guys are which allows you to program them, and then, of course they acted normal read only memory at that point, but then you can also erase them and reprogram them electronically without needing to expose ultraviolet light or do anything special.
. So the 28C16 that’s. What I’ve got here I’ve got two different 28C16s.. This is made by Catalyst this one’s made by Exel.. I also have the data sheet over here for the Atmel AT28C16 they’re, all basically the same.. So this is sixteen thousand bits which is organized as two thousand 8 bit words or quotbytesquot. Essentially, two thousand bytes. Parallel EEPROMs. So if we take a look on the data sheet at the pin out here, this is our pin out comes in a couple different packages.. We have the plastic dual inline package: that’s this guy here. It’s, fairly, straightforward there’s; basically, eight IO, pins, so 0, 1, 2, 3, 4, 5, 6, 7, so eight IO, pins, that’s for our data. They’re input for programming and normally they’d be output for reading from it And then there are 11 address lines so zero through seven here and eight nine and ten over here and those address lines are used for telling it which byte we want to read or write if we’re writing to it for programming, it. And other than that. Pretty straightforward. There’s, ground and power for powering the thing and then there’s a quotWrite Enablequot, quotOutput, Enablequot and quotChip Enablequot, which we will take a look at in a moment. I’ll start by hooking up power and ground.. The next pin I’ll hook up is pin 18, which is the quotChip Enablequot and I’ll hook that to ground, and so chip enable is active low.
So when this is low, the chip is enabled, and we always want the chip to be enabled so we’ll just tie that directly to ground. Next to note is there’s are 8 IO lines so IO, 0, 1, 2, 3, 4, 5, 6 and 7 so I’m, going To hook those up to some LEDs, so we can see what’s in the chip. So when we we look at a particular address will be able to see what data is stored in the chip., So I’m gon na add some LEDs here that we’ll use for looking at what data is in here., Alright, so there’s 8 LEDs that we’ll use for Looking at the data. Now I’ll connect the data pins here so I0 0 pin 9. I’ll connect that. I’ll start connecting those to the LEDs., So that’s IO 0 pin 9 going to the first LED pin 10 to the next LED here and pin 11 and IO 3 I’ll connect over here to the other side of these LEDs. IO 4. So I’ve connected all these IO lines to the LEDs, so we’ll be able to see the output of the chip, but we need to connect the other side of the LEDs over to ground.. So I’m connecting these LEDs to ground through these 330 ohm, resistors and that’s important, because this chip doesn’t have any current limiting on its outputs. So if we don’t have these current limiting resistors here, then it’s going to drive as much current can through the chip through the LED potentially damaging both the chip and the LED in the process.
So we don’t want that. We need to do some kind of current limiting., So I’ve got these 330 ohm resistors that are that are going from ground through the LED and then into the chip into the output of the chip will who will go through the LED into ground, and these are A little bit asymmetrical because the the ones on this side are going to the LEDs this way into ground. The ones on the this side are going through the LEDs that way and then the ground, and so these first 5 LEDs are the other way around. So this should allow us to see what’s coming out of these IO lines, but in order to do that, we’ve got to first tell it. What address we want to look at.. So if we want to read from address 0, for example, have to set all these address lines to 0., We want to be able to select which address we’re reading from so what I want to do is hook these address lines up to some switches. So we can select – whichever address we want., So I’ll put some DIP switches here that we’ll use for setting the address and I’ll hook all the address lines up to the switches So that’s. The first eight address lines here and from zero through address. Seven are hooked up to these switches when the switches are off. We want the address lines to be low, so i’m gon na tie them low with a this is a 10k resistor.
I think brown black and I think that’s orange so it’s, a 10k resistor. So I’m going to tie these these all low with these 10k resistors.. So when the switches are off, these will all be tied low through these resistors. When we turn the switch on, then we want to connect these to five volts.. So if we hook the other side of the switch to five volts, then when the switch is on the pin will be high and when the switch is off, then it’s pulled up by that resistor or pulled down. I guess by that resistor to ground. So we want this side of the switches to all be tied to five volts, So that should take care of the first 8 address lines over here now, we’ve still got address 8, 9 and 10 over on this side, so i’m going to add another set of Switches here and we’re going to use the the i guess, the bottom three of these for address 8, 9 and 10 and I’m gon na hook them up pretty much the same way. and so that’s address 8, 9 and 10 here, 8, 9 and 10 hooked up To this side of the switch and so again when these switches are off, we want to pull them low, so I’ll do that with the 10k resistors and then, when the switches are on, we want to be pulled high. So now we can use these first. 11 switches, everything but the top one here to set our address and, of course, 11 bits of address gives us the 2048 two thousand fourty eight or approximately 2000 different memory locations.
So the only pins we haven’t hooked up yet are the right. Enable and output enable the output, enable is …, let’s, keep pin 20 and if we set that too low its active low. So if we set that to low by tying that to ground, then that will enable the output, which means that whatever address we set here, we’ll see the contents down here on the IO lines. So we try that we can hook this up to power now so I’m gon na hook this up to 5 volts and what we see is all ones and so that’s address location 0. And if we change this to address 1, we see all ones. If we go to address 2, we still see all ones address 3, all ones – and you might be noticing a pattern here: that’s, because when these chips are brand new or they’re erased, they are erased with one’s at every location. So all one’s named the chip is erased and there’s there’s nothing stored there, and that makes sense because we haven’t programmed anything here, yet. So to program, stuff that’s, where the right enable pin comes into play and understand how that works. We’Re gon na have to take a closer look at the data sheet. If we go to page three there’s the section about byte write and it says a few things., it says you can use a low pulse on the right, enable or chip enable input with the output enable high and either chip enable write, enable low respectively and that Initiates a byte write.
, So what does that mean? Well, you can read that a few times and there’s some more details in there. It also helps to look over on page six theres, some timing diagrams. Usually the best way to to understand these data sheets have to read them through. You know at least a couple times, and you know when you’re reading it through. It may not make sense entirely what’s going on, but, as you see other parts of the data sheet, you’ll start to kind of get a picture of what’s going on, and so here it is helpful to look at the timing diagram which tells you how to write And then it turns out there’s there’s two ways you can write: you can either write to the chip using the write, enable controlled option or the chip enable controlled option, we’re going to go with write, enable controlled and basically what that means is. That means that its the write, enable pin going low and then high that controls the write that the tell that went to write data and the way you read these timing diagrams. Is you imagine time going from left to right and there’s all these different transitions and things that are going on here and really what they’re trying to do is we’re trying to show you the the parameters for the timing and all of these parameters are given in The table above and so, for example, you know there’s this tWP, which is the time of the write pulse so that’s the time from here to here, which is the time that the write enable goes low and then comes back up.
How long is that pulse? Well time of write pulse the write, pulse width, it says the minimum is a hundred nanoseconds and the maximum is a thousand nanoseconds, so that’s good to know. We have to somehow make sure that we keep that within a hundred to a thousand nanoseconds. So that will be important to keep keep an eye on some of these other things are basically telling you when this write enable goes low, that’s. What it’s going to look at the address and when the writing enable goes high that’s. What it’s going to look at the data and that’s sort of corroborated over here in this description here so it says, quotthe address location, is latched on a falling edge of write, enable the new data is latched on the rising edgequot. So the address is latched on the falling edge and the data is latched on the rising edge, and so what this timing diagram is trying to tell us is its saying when this falling edge happens here, the address has to be set up prior to that happening, And then, after that happens, the address has to be held for some period of time. So there is a setup time and a hold time for the address same thing for the data when the write enable goes high again, the data has to be set up for some time prior to that and has to be held for some time after that. So these are all important numbers to be aware of, but you’ll notice that, like the address set up and address hold, the data set of data hold over here is the address set up, address, hold there’s a minimum 10 nanosecond 50 nanoseconds, but there is no maximum Which is great because we’re going to be going pretty slow with this, so as long as our address is, is toggled into our our dip switches.
Here, 10 nanoseconds, before we try to write what we’re gon na be fine and, of course, that won’t be a problem and as long as we hold it, you know we don’t change the DIP switches within 50 nanoseconds after trying to write, then we’ll be fine. So no worries there same thing with the data you know when we set the data that we want to write. We have to make sure that the data set up 50 nanoseconds before our write. Enable goes high, no worries that’s plenty of time. Ok, what will be much longer than 50 nanoseconds and we have to hold it for 10 nanoseconds after this goes high, so no worries there. These minimums not gon na, be a problem. The one thing that might be a little bit challenging is this write. Pulse have to this pulse has to be somewhere between a hundred nanoseconds and a thousand nanoseconds and that’s, not a huge window, especially for what we’re doing here, because you might imagine well this the write, enable pin, which i think is in here. You can just look that up to a push button. You want to write. You push the button.. The problem is when you push that button, you’re, probably going to be pushing it for more than a thousand nanoseconds that’s, not very …, 1 microsecond that’s, not very long, and the reality is probably ok. If it’s longer than this, you know, but one thing we can do just to just to try to to make it in this window is use a RC circuit, so a resistor and capacitor to to get this timing right.
So, for example, if we use a 1 nano farad capacitor – and I guess I’ve got a 680 ohm resistor 680 ohms x 1. Nano farad is 680 nanoseconds, which falls nicely between here. We’Ve got a 1 nanofarad capacitor and I’ve got a 680 ohm resistor. So how do we build an RC circuit that will generate this pulse? That is hopefully 680 nanoseconds. Well, let’s get a button here that gon na trigger our pulse and i’m, going to hook my resistor and capacitor here in series, with the switch and hook the other side of my switch to ground., And so like this over here right at this point here, i’m Going to have five volts because I’ve got a resistor connected across there and it’s not going to drop any current because there’s no current flowing, because the switch is closed. Nothing’S going on. If I close the switch, then current will flow, and now this side of the capacitor will be essentially connected to ground through the capacitor. If the capacitor is not charged yet – and this will go down to zero immediately but very quickly, the capacitor will charge up to 5 volts and the time that it takes to charge up is dependent on the RC constant here, which is, it was a 1 nanofarad. Capacitor, this is a 680 ohm resistor, so should be 680 nanoseconds, which works very nicely. When I let go of the switch, this will stay high and the capacitor will stay charged because it’s not connected to anything else, so I’m going to need another resistor here to discharge the capacitor.
When I let up the switch so I’m, just going to put in a this, is like a 10k resistor and that’ll that’ll just allow the capacitor discharge when I’m not pushing the switch so normally right now, the capacitor is connected. Both sides of the capacitor connected to these resistors to my plus five volts here so essentially my capacitor just has this series resistor across it, which is discharging., So the capacitor is going to be discharged. This side over here is going to be 5 volts because there’s no current flowing through this resistor, so its going to be 5 volts on either side. When I push this, then ground is going to be connected here. Current is going to flow through the resistor to charge the capacitor, so this side of the resistor will be 0 but then very quickly, rising as the capacitor charges. So this should give me a negative going spike when I push the switch and that negative going spike. Should be 680 nanoseconds, which is what we want, and so that will be my write, pulse that’s, going to write, enable and write enable is down here. I believe its that pin there so we’ll connect that over to write, enable and so now, when i push this button, it should give a negative going 680 nanosecond pulse into that write, enable pin. We can test that if i hook up power and hook up an oscilloscope probe here and we’ll. Look at you look at this point here which is going to write, enable when I push the button.
It goes low and recovers here as the capacitor charges, and each of these divisions is 500 nanoseconds. So you can see at this point here. This is 500 nanoseconds. This is a thousand nanoseconds here and so we’re already up, let’s see so 0 volts. 1. 2. 3. 4, so we’re up over 4 volts here by the time we get to that thousand nanoseconds. So the period of time that this is low is definitely between 100 nanoseconds, which would be right here and had a thousand nanoseconds which is over here. So this is perfect. Ok, so we have that write pulse there. So how do we actually program this thing? So the first thing we want to do is set our output enable to high, which means we’re, not enabling our output anymore, which means that are our outputs over here are now inputs, and so now we we can set these inputs to whatever value we want to Program so i’m going to use these little jumpers to set a value here that we want to program into a particular address, location, and so let’s say this is the pattern. I want a program and i want to put in address location 0. So i set my address to zero when I hit the button here, it should now have that programmed into address 0. If I want to program something different in to address one, I go to address one and i can change these around.
So I can change to program something different, so I just swapped all the bits and we’ll put that in address 1 by hitting our write, enable – and that gives us our nice 680 ish nanosecond pulse, to write that into address one, and we could go ahead and Program address two three four whatever, but for now we’ll just do those, and so now I want to go back to reading and disconnect all of these, because these are no longer going to be inputs. These are going to be outputs, so I make sure those are disconnected and then I go back and set my output enable from high back to active low, so we’re now output, enable., And so now you see in address one. We have this pattern and if i go to address 0, we have the other pattern that i programmed and if we go to address two or or three, we still see the all ones, because i haven’t programmed any of any of those locations. So maybe you’re thinking this is pretty cool, but how can we use it to do something? A little more practical? Well, you might recall this circuit that we put together in the previous video, which basically just takes four bits of input over here and lights, up the display to show us the number so it’s, two or three or four, or this is C, which is hexadecimal for 12, which is this is binary 12, so we have all this logic just to get this display to work well turns out.
You can replace any combinational logic circuit with a ROM, and so rather than having to design this complicated circuit with all of these gates and everything going on here, we could replace all of this with a ROM that’s, because remember where this came from. We started with this basic truth table which just describes how the data bits coming in relate to whether the segments are turned ON or OFF. Well, we can actually program this truth table into a ROM and the data bits become the address, and then the data output of the ROM becomes these these a outputs over here.. So at address 0 we could program in 000 0001 and address one in the ROM. We can program in 100, 1111, one and so forth, and then we could put the ROM in the circuit instead of this and instead of these switches feeding the input of this fairly complicated logic circuit. These switches could feed the address of our ROM and then the outputs, instead of coming out of the this collection of OR gates and so forth up here, those outputs would just come directly out of the realm let’s give it a try. Let’S set our output enable to high so it’s OFF and let’s, go to address 0 and just start programming. So first off we’re going to have all zeros, but with a one at the end. set that to one and then tie the rest of these to ground, and so there we go and I’ll program.
That. Now go to address one. So that’s address one program that and we’ll go to address two. Ok, so if I didn’t make any mistakes which I almost certainly did, that should be everything programed now I’ll disconnect all of my connections here, so we’re no longer programming and put it back into output. Enable mode – and we see three ones and three zeros, which is what we expect to see for 111 as our input, which it is so that’s a good verification, and if I switch to other things, I get other outputs. Now the real test will be let’s. Try hooking the output of this thing up to a 7 segment display., So we’ll hook the anode here through this a hundred ohm resistor to our positive supply over here, and then these bits should go over here and it doesn’t. Look like a zero let’s see what I do wrong. Oh, I got these hooked up backwards. The one on the right here is G and I hooked up to A so that makes sense. So these are all backwards. There we go so 0. We got zero and now let’s try, try it out so there’s one, no that’s, not two, but keep going: that’s. 3, 4, 5, 6, 7, 8, 9 A. There’s, B, C D E and F. So that looks like most. Everything is right, but it was two yeah. Two is wrong, so two let’s see what did i do so two should be 0010010 so 0010010.
So I got that bit off by one. Let me try to fix that. It looks like a two and real quick. We can just check all the other numbers to make sure they’re, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A B C D, E and F there. We go so not super fun to program it using a jumper wires like this, but certainly a lot more fun than designing this whole thing and trying to build this thing, and certainly a lot more flexible too. And you probably start to imagine how we could use a couple of these for each digit to do a you know, decimal display or or actually display something more than just a single hexadecimal digit for 4 bits, but we’ll get to that in future videos. The thing I want to cover the next video is actually a much faster way to program these without having to set all these jumpers, as you can imagine, it gets pretty tedious once you get is a 256 or more values into here.
arduino eeprom Video
arduino eeprom news
Posted on Saturday May 25, 2019Back To Basics With An Arduino And An EEPROM Hackaday … Continue Reading »
Posted on Thursday September 26, 2019UDOO X86 II SBC Combines Intel Braswell SoC with Microchip ATMega32U4 “Arduino” MCU CNX Software … Continue Reading »
Arduino reveals more powerful, low-cost Nano boards for building homemade hardware and gadgets – TechRepublic
Posted on Monday May 20, 2019Arduino reveals more powerful, low-cost Nano boards for building homemade hardware and gadgets TechRepublic … Continue Reading »
arduino eeprom Social
🔬 Now that you’ve gotten your feet wet, dive into the kit and enjoy all nine experiments. Order yours today: http://bit.ly/2MnQ7fr
Originally posted 2016-08-27 19:49:47.