«2006-1546: THE BENEFITS OF USING ORCAD-PSPICE WHEN DESIGNING ROM DEVICES Saeid Moslehpour, University of Hartford The author is assistant professor ...»
2006-1546: THE BENEFITS OF USING ORCAD-PSPICE WHEN DESIGNING ROM
Saeid Moslehpour, University of Hartford
The author is assistant professor in the Department of Electrical and Computer Engineering
Racquel Brown, University of Hartford
The author graduated from the University of Hartford
© American Society for Engineering Education, 2006
2006-1546: The Benefits of using Orcad-PSpice when Designing ROM devices
Saeid Moslehpour, University of Hartford
The author is assistant professor in the Department of Electrical and Computer Engineering Racquel Brown, University of Hartford The author graduated from the University of Hartford Abstract For a long time TTL (Transistor Transistor Logic) integrated circuits (7400 series) have been used to design digital circuits, with the creation of ROM (Read Only Memory), SPLD (Simple Programmable Logic Devices), CPLD (Complex Programmable Logic Devices) and FPGA (Field Programmable Gate Array). This paper discusses the programming and simulation of ROM family devices such as EPROM (Erasable Programmable Read Only Memory), E2PROM (Electronically Erasable Programmable Read Only Memory) and Flash ROM and their uses in the practical engineering environment. We are using PSpice software to program ROM family devices. The PSpice manual provides little information about the procedures of ROM programming. The following steps will include programming the chip in PSpice which is similar to programming the actual ROM devices.
Introduction In most digital textbooks used in colleges and universities today, ROM family devices are not mentioned in great detail. It is important for the students of electrical and computer engineering to receive a great detail about ROM devices family. These products and other integrated circuits such as SPLDs, CPLDs and FPGAs are used to develop the latest dynamic logic programming.
Once students understand the behavior of the ROM devices, they will be able to design and implement the basic logic and other circuit logics such as state machines which can be used to implement real world applications1.
We are using an interactive computer simulation program called Orcad-PSpice. This program provides students with a teaching environment to virtually design digital and analog circuits. The ROM programming starts from simulation and goes on to programming the real devices. A program called TT2ROM is used along with Orcad-PSpice to make the student fully comprehend the usage of these devices. The TT2ROM program is used to produce an Intel Hex File and then these files are linked to Orcad-PSpice for simulation purposes. Students now have the opportunity to design and program their information onto ROM devices2.
Orcad-PSpice is an electronic simulator used to test and design analog and digit
Quick and easy schematic editing • Library can be edited or designed from scratch • Working with other CAD applications • The files used to design different devices can be used to upload the information into the • devices Design complete printed circuit boards (PCB) including auto routing • With these features, Orcad-PSpice is used by different engineering companies and in colleges around the world and has assisted in design and troubleshooting.
Relevant Information ROM ROM holds a bit pattern for each distinct address applied to its input. The device is used to access stored information needed for operating systems, software language compilers, and for other electrical mechanisms to help operate necessary functions. Once the device is programmed, the information on the device is nonvolatile which means it can not lose information when there is no power. The information on the mask ROM device can not be changed once the device is programmed. The other types of ROM family are PROM, EPROM, EEPROM and Flash Memory which is similar to E2PROMs3.
PROM ROM developers came up with a blank ROM device called PROM. The PROM is made up of fuses which are all initially a value of 1. The value of selected fuses on the PROM device are changed when the programmer sends a certain amount of current to a particular fuse cell to open it up. This is known as burning a PROM device. Once this device is burned the information on it can not be modified. 4 EPROM and E2PROM Any programming error using ROM or PROM devices can not be undone; however, EPROM and E2PROM can solve this potential problem. To erase an EPROM an ultraviolet light source is used. If the user does not want to completely erase the EPROM device or wait for a long time for the EPROM to erase then E2PROM is suitable.
E2PROM which stands for Electrically Erasable Programmable Read Only Memory uses about 21V to erase a single bit or the entire device in 10 ms, this is a lot faster than using UV to erase and the procedure can be done easily while the chip is still in the circuit. 9 Flash Memory Flash Memory is the latest E2PROM product and is better than the E2PROM because it erases a single block or erases an entire device much faster. There are Flash Memories that are removable and are used in the latest technology. SmartMedia, FlashStick, and CompactFlash are some the names of removable ROMs used in digital cameras, cell phones, video games, printers, and computer storage.5
There are two ways to program ROM devices in Orcad-PSpice:
1. To program the ROM by including the program data on the device line
2. To link an Intel Hex Format file to a ROM device Programming in Orcad-PSpice The first method is usually used for testing purposes only. The second method is for a more practical way of programming ROM devices. The TT2ROM (Truth Table to ROM Converter) is a program used to develop the Intel Hex File necessary for programming ROM devices.8 This program is a utility program which converts a logical truth table into an Intel Hex format appropriate for EPROM and EEPROM.6 Intel Hex The Intel 32-bit Hexadecimal Object file record format has a 9-character, 4 fields prefix that defines the start of record, byte count, load address and record type. The record format also has a 2-character suffix containing a checksum7.
There are six types of records for the Intel 32-bit Hexadecimal Object file. The record types are 00 Data Record, 01 End Record, 02 Extended Segment Address Record, 03 Start Segment Address Record, 04 Extended Linear Address Record, and 05 Start Linear Address Record.
1. Data Record The data record which is record type 00 is the record that holds all of the data of the file. This record begins with a colon “:” followed by the count of the byte, the first byte of the address and the type of record “00”. After the data record type “00”, the data bytes follow. The checksum follows the data bytes and is 2’s complement of the preceding bytes in the record, excluding the starter character.
Here are some examples of data records:
:10 0000 00 FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0 FF
(The spaces are used for clarity only and should not be found in a Intel 32-Bit Hexadecimal Object File)
2. End Record The purpose of the end record type “01” is to indicate the data file when it reaches the end. The end record starts with the colon “:” followed by count of the byte “00”, the address “000”, the record type “01” and the checksum “FF”.
Example :00 0000 01 FF
the absolute memory address of all subsequent data records in the file unit. Extended segment address record start off with a colon “:” followed by the byte count “02”, the 4 character ASCII representation of the hexadecimal number represented by bits 4 through 19 of the segment base address and the 2 character checksum.
Example: 02 0000 02 1000 55
4. Start Linear Address Record The start segment address record “03” identifies bits 4 through 19 of the execution start segment base address for the object file. This record type is currently ignored.
Procedures and Implementation Locating parts in Orcad Orcad Capture interface is easy to use once the user gets an understanding of where all the parts are. There are wires, buses, and libraries of different analog and digital parts and power. Figure 1 displays the library family for the “ROM32kX8break” part. If a part cannot be found in the parts list there is an Add Library option and depending on what part is needed the file category for that part is selected. You can make any size ROM in Orcad-PSpice using the Model Editor8.
Using Intel Hex File to Program ROM Circuit Figure 3 is a sample of the text file (test.txt) used to implement an Intel Hex file. In the test.txt file, the “As” represent the addresses line and the “0s” represents the data at a particular address. If the addresses are not specified in the STIM4 file the data for a particular address will not display as an output. The TT2ROM program is used to produce the Intel Hex file. This program is DOS based and easy to learn if the user has an understanding on how to use MS-DOS. When the program completes the process, a new file is created, shown in Figure 4 test0.hex.
Programming ROM by Linking Intel Hex File 9 The Edit PSpice Model from the ROM chip is used to link the Intel Hex File to the chip (Figure 5 and Figure 6) 10. To link the Intel Hex file the location of a file is in the Orcad Model Editor “FILE” line displayed in Figure 7.
Figure 7 Page 11.1256.8 Final Output Figure 8 displays the final waveform after simulating the circuit in Orcad. Comparing the results with the Figure 3 you’ll see that each address that was specified from the STIM4 and the text file matches with the output waveform.
Conclusion Utilizing the Orcad-PSpice program for developing state machine circuits will be helpful for students in electronic engineering, computer engineering, and electrical engineering. Designing with the Orcad-PSpice program by creating individual designs or new parts will help students understand the ROM families. Orcad-PSpice is like a test bench for designing because users can input different parameters and see the results quickly. This will give students a better understanding of what digital circuits encompass by providing a practical learning experience.
The more interaction with building digital design the better prepared students will be when integrating with industry. The demo version of Orcad-PSpice is available on www.ema-eda.com website.
Benefit to students Visualizing the operations of electronic circuits has been a challenge for instructors every since the first electronic course was introduced. Integration of Orcad-PSpice into the classroom assists
the learning process by visualizing:
Intel Hex Program
Students’ feedback has been positive:
“Having the PSpice simulation software to utilize and program a ROM device is beneficial to my understanding. This was evident because of the distinct input that a ROM has and the output corresponding to it. The ROM programming through the use of the hex file was a great experience. The simulation of the ROM integrated circuits showed exactly what hex value was stored in each address location. Programming the ROM also gave an understanding of how manipulates the PSpice model editor.” “Writing to and reading back from 'read only memory' chips has been made simple with use of the Orcad PSpice software. Using the programs library, you can find and even create a ROM chip. There is a text file associated with the part that is available by clicking on the part. Entering the hexadecimal values into that file in the proper lines is all that has to be done. Simulating the circuit will show that when you access a specific address in the memory, you will find the data that was entered in the file. This is an excellent practical tool that doesn't lead to wasting real physical chips if mistakes are made.” “I just remember that it was a big project, and it was pretty straight forward. It was tough to use at first, but very quickly it became simple and easy, and I remember doing well on it.” Students have been supportive of simulated instruction; the fact that ROM program from PSpice is used in industry is another advantage of using computer simulated instruction.
1. “How ROM Works” http://computer.howstuffworks.com/rom.htm, 1998-2005 How Stuff Work.Inc. 2.
2. “Microprocessor”, EDN, Vol 49 Issue 25, p110, 2p 12/7/2004 3. “Orcad Capture”, http://www.orcad.com/orcadcapture.aspx, Cadence Design Systems, Inc. 2004 4. “Using tt2rom to Synthesize Truth Table in ROM”.
http://www.thayer.darmouth.edu/~bpoque/labs/tt2rom.pdf, Spring 2002
5. Ameen, M., Brown, R., Rashik R, Sundaran S., Zeeshan, M. “Programming Read Only Memory with Orcad”, unpublished manual.
6. Cook, N., “Electronics: A Complete Course, 2/E”, Chapter. 27 Semiconductor Memory, Prentice Hall 2004.
7. Kleitz, W., “Digital Electronics with VHDL”, Chpt. 16 Semiconductors, Magnetic, and Optical Memory, Prentice Hall 2005.
8. Manes, S., “The Weird New World of Hardware Fixes”, PC World, Vol. 23 Issue pg 176, 1p, 1c.
9. Schweber, B., “Mems Make a Nonvolatile-Memory Match”, EDN, Vol.49 Issue 16 pg 20, 1/4p, 8/5/2004
10. Tocci, R, N. Widmer, and G. L. Moss, “Digital Systems: Principles and Applications, 9/E, Chpt. 12 Memory Devices, Prentice Hall 2003