【正文】
外文翻譯Serial MemoriesOverviewMany of us like to use small, single chip micro controllers. They are relatively cheap, easy to wire up to make run, and over all just mighty convenient to use. One down side to using these single chip controllers is the lack of large amounts of memory. Sure, you can hook up external memory to most of them, but that requires a lot of work, and usually consumes other valuable resources, mainly the I/O pins that make the chip useful.There is help out there! There are several forms of memory that don39。t require the standard address bus and data bus wiring. These memories are called serial memories, and they are just the ticket to allow you to store large amounts of information without giving up those precious I/O lines. There are several different styles of serial EEPROM. The focus of this article is going to be SPI based devices. There are also 1, 2, and 3 wire serial EEPROM devices that function in a similar way, but have different interface logic.This article is going to introduce the basics of serial memories, and present the driver software needed to make it operate.Missing the BusThe big advantage to using a Serial EEPROM is that the wiring only requires 4 signal lines from the CPU to operate it. Compare this with a more standard memory, which requires an address bus and a data bus! The amount of glue logic required to make a Serial EEPROM operate is extremely low. For example, check out the following two packages. A traditional memory, such as a 27256, requires a 28pin part to be wired into your circuit. There are 15 address lines, 8 output lines, plus assorted control lines. On the other hand, a serial EEPROM can be purchased using in a 8pin package. There is 1 input line, 1 output line, 1 control line, and 1 clock line required. There are a couple of other control lines available, but are not actually required if you wish to avoid them. As you can imagine, these parts a lot easier to wire in, much smaller and best of all are mighty cheap! An 8kx8 part costs about $ at Dig key.Of course, there are tradeoffs. Since the memory of the serial EEPROM is accessed one bit at a time, there is a speed penalty to be paid. However, these are still extremely fast parts. They can output their data at over 2 million bits per second, which is quite reasonable for many applications. So, for a small amount of software overhead and only 4 I/O pins, you can have yourself some substantial data storage!Would you like to super Size that?Serial EPROM’s are available in a variety of different sizes. They seem to range from 128 bytes all the way up to 32k bytes. Atmen also has a 128k byte device that fits the same form factor. All of these parts are electrically patible. However, some require minor software changes. For example, some allow writes of 32 bytes at a time, where others allow 64 bytes at a time. These minor differences are easily dealt with in software. It turns out that serial EPROM’s are available from several different manufacturers. At least two, Microchip and Atmen, have patible chips. I haven39。t looked into the other manufacturers, but I would expect theirs may be as well. They are also available in several package sizes, including an 8pin DIP as well as SOIC surface mount. The BasicsThere are 8 pins on one of these parts. Here is a list and their functions1CSChip select. This is a critical pin on these parts. The CS line not only enables the part, but it also acts as the end of operation marker. More about this pin later 2SOSerial Output pin. In SPI terminology, this would be the Slave Out, and should be connected to the MISO pin of the SPI port. Data being output from the serial EEPROM is clocked out on this line.3WPThe WP pin allows for hardware write protection. If appropriate bits in the control register are set, then the WP pin will disable any write operations when the pin is held low. This wou