??? 06/09/04 11:04 Read: times |
#72162 - RE: 8051 to access 16-bit external memory? Responding to: ???'s previous message |
Can you explain in more detail what you want to do? Do you:
- want to connect a memory chip with 16 data lines to an 8051? Can you name a type number of the memory device you plan to use? - want to store 16 bit values in a memory chip and are under the impression that can only be done by connecting a 16-bit wide memory device? If you are confronted with the need to access a 16-bit wide memory chip, I would do this: In case of a ROM chip, I would use the address bus' least significant bit (bit 0) to select between the high- and low byte of the 16-bit wide device. Hardware wise, this would require two 8-bit wide tri-state buffers to combine the high and low bytes of the ROM chip's data outputs to the 8051's data bus. The remaining addressing bits (15...1) I would connect to the ROM chip's address bits 14...0. Now, from the 8051, reading an odd location will give you the low order byte of a location, and reading an even location the high order one. If you want to work with a 16-bit wide RAM device, I would say you are going to have an impossible job, unless you can sacrifice a lot of performance on the 8051's part. It's not the reading which will be the problem (same as for ROM), but the writing. Because you will only be able to write 16 bits at a time, and you really only can offer 8 bits. The only way to do it then would be to connect the memory chip not as a memory chip, but as a generic piece of logic. Connect all lines of the memory chip to 8051 port pins, and do all the writing and reading by manipulating the I/O lines through software. This means you will be able to use the chip, but you will loose the use of MOVX instructions. In stead, you will have subroutines for reading and writing to the memory. As I indicated, in terms of performance, this is not a very desirable solution, but it may be useful if the amount of times you need to access the memory device is limited. If you need to access the memory device often, don't go this route. If you only think you need a 16-bit wide memory chip to store 16-bit information: You don't. It is perfectly well possible to store 16-bit information in an 8-bit wide memory device. All you need is two locations for each 16-bit value. Look at how the DPTR is stored in the 8051's internal memory as an example. As the 8051 is perfectly well equipped to interface with 8-bit memory devices, this is clearly the way to go, as you will not loose any performance. In the end, anything is possible, but at the cost of performance and "beauty". Maybe it is best first to explore why you think you need to do this. Are you forced to interface to a 16-bit memory device, or is it just an idea that you have? You may find there are better alternatives. |
Topic | Author | Date |
8051 to access 16-bit external memory? | 01/01/70 00:00 | |
RE: 8051 to access 16-bit external memor | 01/01/70 00:00 | |
RE: 8051 to access 16-bit external memor | 01/01/70 00:00 | |
RE: 8051 to access 16-bit external memor | 01/01/70 00:00 | |
RE: 8051 to access 16-bit external memory? | 01/01/70 00:00 | |
RE: 8051 to access 16-bit external memor | 01/01/70 00:00 | |
RE: 8051 to access 16-bit external memory? | 01/01/70 00:00 | |
RE: 8051 to access 16-bit external memory?![]() | 01/01/70 00:00 |