| ??? 03/31/03 20:09 Read: times |
#42642 - RE: Using P2 and external RAM - Pranav Responding to: ???'s previous message |
Actually, kalpak\'s answer made me think of something. Since you normally write 1\'s to port pins that are to be used as inputs, why not have the DIP switch connect the pins to ground when closed. That way, I can write FF to the port, read the switch, and then forget about it. It seems to me that any instructions which would then write 1\'s to the port (such as a MOVX or anything else) would be harmless, essentially configuring to an input, so grounding it is no worse then reading a low input anyway.
Yes Erik, I am using an actual 8751H and an 8155. I use Intel's original assembler too. You pros must be having a good laugh just about now! I'm using the 8155 mostly for the extra I/O ports but the RAM could come in handy. By connecting the M/IO line to P2.0, the ports become memory mapped at addresses 101, 102 and 103 hex. Just one note about the forum. I appreciate seeing that most of you are people doing this for a living, designing circuits that will be commercially produced in great numbers. The reason why I identified myself as a hobbyist making just one circuit for my own use was to avoid the frequent response of suggesting other ways of doing the same thing. A well appreciated member named Michael Karas suggested using an EEPROM, using a serial routine (which means I would need a software UART because the serial port is already used for RS-485) and implementing an EEPROM routine into already precious code space would multiply the time and effort needed to implement the functionality of the DIP by at least 20, instead of using just a simple DIP switch that I already have and that will probably get set only once or twice in the life of my circuit. My point is: please let us hobbyists identify ourselves as such and don\'t try to re-engineer the whole project! ;-) I\'ve learned assembler programming with this processor on my own, and it has developed into a great hobby, allowing me to do complex things like communicate using the X10 home automation protocol and talking to a RS485 bus with very little hardware, but I try to use what I have and keep it simple. So thanks to every one so far and I\'m looking forward to keep reading the same informative threads I often see. |



