We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
When i use external memory, port 0 and 2 will be used for data and addressing, so i'll be left with only the serial port and port 1. I open to suggestion on ways to add another two I/O ports. Thanks
You need to use memory mapped I/O for additional ports. This will require adding some decode hardware, and the ports themselves (flip-flops, latches, etc.). They would interface just as an external memory chip would. Typically you would set up a range of addresses and decode chip selects with a PAL. Pay close attention to the timing of the 251, and how it accesses memory with different instructions. You should set up some test cases for accessing these ports, and look at the instructions. The simulator DOES NOT add any clock cycles for addressing external memory - this can lead to severe timing differences if you're trying to get an idea of performance. This caused us some grief in our project.
You have many possibilities, my 3 favorites are: 1) Use a CPLD to implement memory-mapped I/O 2) Use the Philips PCF8574 which gives you up to 8 '51 type ports for 2 port pins 3) Use a WSI chipm which gives you some RAM, some ROM and some ports (2 1/2) Have fun, Erik Malund
Ricky, We found the Atmel ATF15XXASL series of CPLDs to work fine for our port expansions. I do suggest the "L" version for reducing your power requirement. We just used the Atmel ATF1502ASL for expansion on a 89C51 device...works great. Alan