ROM concept for embedded aspirantsChethan Reddy YelmaBlockedUnblockFollowFollowingMar 6We program and store some data into ROM and extract the data but we still feel it as a magic because we do not know the basic bit or byte level operations in ROM.
In this blog I will explain how to store data in ROM and print it out without using any code.
Come on do along with me and let me see a smile on your face.
Download two software's from the below links and install them.
We will discuss about them further.
net/en/Before directly jumping into out practical little theory approach is needed.
Lets give five minutes to understand what exactly ROM is:Consider it as a storage device in which we can write and read data.
PROM:Programmable read only memory can be programmed only once and a separate programmer is required to program it.
EPROM (Erasable programmable read only memory):Once EPROM is programmed then the data can be erased using UV light source and can be reuse.
EEPROM (Electronically erasable programmable read only memory):Instead of UV light we use electric field to erase the data.
Flash EEPROM:Regular EEPROM erase the data bit by bit where as in flash EEPROM data can be erased all at once.
Let us consider EEPROM as an approach to practical knowledge:Lets take a very basic example of m&m gems packet.
M&M gems packet represent the EPROM memory cell.
The gems represent the charge associated with the memory cell.
Outlet for gems is very small that they have try very hard to come out or go into the packet i.
e its very narrow.
The gems push themselves to go in or come out of packet this is called tunneling effect.
Assume that packet has narrow openingNow consider that gems represent electron charge.
A full packet represents ‘1’ while the empty packet represents ‘0’.
When EPROM is erased using UV light source all these 20 gems are pushed into the packet so its provide the charge named as ‘1’.
When we program EPROM we push these gems out until they come out by applying some pulse of high voltage.
This pulse drives the gems out and convert the value fro ‘1’ to ‘0’.
During programming we can only change bit from ‘1’ to ‘0’ , if we want to change the bits from ‘0’ to ‘1’ that leads to erasing and again all the gems are pushed into packet.
What do you think now EPROM is analog or digital device?I would say it is analog.
Lets go in a contradiction manner if it was digital it has only two states digital high or digital low.
Zero gems indicates digital low and digital high indicates one gem .
But here we are using 20 gems so our contradiction fails here.
Here comes the concept of cell sensory circuitry.
This circuit fix a threshold value in sense if there are more than 10 gems then the cell state is ‘1’ otherwise ‘0’.
While programming EEPROM you have to apply some programming voltage for a specific time which is a very important factor if time is too short there is chance of leaving gems inside the packet.
If the time is very high there is chance that all the gems come out along with tears of gems packet so there has to be some specific programming voltage time.
We consider 2764 EEPROM the pin diagram as follows:Pin diagram of 2764 EEPROMLets do not go very deep into this just understand what is whatA0-A12 — address lines.
Using these lines we can extra the data from a particular address.
EPROMs are rated in k-bits where k is equal to 1,024 and the EPROM number generally reflects the size.
But when we talk about memory size, we speak in terms of k-bytes.
To change bits to bytes, simply divide the number of bits by 8 to get bytes.
2764 end with number 64 so 64*1024=65536 now dividing the result by 8,we get 8192 i.
e 8k bytes of memory.
Why are we using 13 address lines (A0-A13) while in case of 2716 EPROM we use 8 address lines (A0-A7).
The concept is that converting 8192 into binary form the output we get is (10000000000000) which has 13 bits so we have to give 13 inputs that points to some address in memory and the data available in that memory is fetched out.
Now you workout with 2716 EPROM.
D0-D7 are the data lines.
One address contains one byte of memory which is fetched out by accessing that particular address.
Other pins which you can find are PGM( program enable) , CE (chip enable).
OE(output enable ) these pins must be made low for the EPROM to work.
Vpp is program voltage pin generally supplied with 12V and we find vcc and gnd pin for the working of EPROM.
I guess you have downloaded Proteus from above link if not do it now.
Follow the below steps:Create a new projectleft of your screen you will find P and L option in blue color boxes pics ‘P’ and search for these devicesLOGIC STATE,LED,2764 type these in search box and then connect them according to below given picture.
Now you may have a question how to add ground so right click on window then click on place then go to terminal there you can find the ground.
Observer that OE, CE and PGM are always enabled so they must be given logic ‘0’ always.
Now the concept is when you change these address lines i.
e suppose consider the input as (1001000010100) in decimal it is 4628 so the we had given the address 4628 so the value in that address lets suppose it is (A9) i.
e 10101001 so any four LED’s will glow .
If you had understood this para then the rest is very simple.
Now we have to create a binary file and store that data in our EEPROM so it has 8192 bytes we can create that data using Frhed software and fill the data till it reaches 8192 bytes.
Frhed softwareUnderstand the above picture only first row is given the value 24 means that is $ symbol according to ASCII chart and remaining all I gave space the ASCII value of ‘space’ in hexadecimal is 20.
See below chart to get some knowledge on ASCII values.
According to our concept we had filled every byte i.
e 8192 bytes with 20 value except starting a address i.
e we filled with 24 (0010 0100) so two LED’s glow and coming to remaining address it is just 20 (0010 0000) only one LED glowsBut the problem is how to upload this file so save the file in Frhed with extension (.
bin) now go to Proteus and double click on 2764 window and you will find to add one source img file add the file which we have saved with .
bin extension now go to debug options and run simulation you can easily find when all the address lines are zeroes we can find two LED’s glow and other cases one LED glows I will attest both the screen shots check below.
Two LED’s glowOnly one LED glowNow its your turn manipulate some more bits and play with EPROM .
There’s no magic here understand the roots.
You can mail me at chetanreddy.
comThanks for showing your interest.
Waiting for your comments and suggestions.
HAPPY LEARNING!!.. More details