??? 01/09/07 18:48 Modified: 01/09/07 18:49 Read: times |
#130523 - Understanding the schematic will help. Responding to: ???'s previous message |
Ralph,
Whether you use an external memory interface, as was done on the 8031 in your schematic, or create the signals with port-mapped I/O, which is your only option with the MCU you've chosen, the only thing you have to do with any sort of care at all, is to ensure that the 'E' strobe is long enough to satisfy the requirement of your LCD's controller IC (consult the datasheet for this information). With port I/O, you set the bits into the state that your action requires, set the data on the port on a write, raise 'E' for the appropriate period of time, then lower it, or, on a read, set the bits into the state that your action requires, raise 'E', read the data port, then lower 'E' after the appropriate amount of time, including, of course, the time consumed by the data read. The memory-mapped version made this seem simple because it was on a relatively slow 12-clocker, the external bus cycle of which was always adequately long to cause a sufficiently long 'E' strobe. An access to the external LCD was simply a MOVX instruction. Communicating with an LCD is not "rocket science." I've never seen anything on "Circuit Cellar" (not that I've looked much in the last 20 years) that qualifies as rocket science. Of the few things I've seen there, not all of them work as advertised. This one is so simple, it probably does, however. One thing you might want to do differently, however, is take the upper and lower terminals of the 20K-ohm potentiometer to Vcc and the V- terminal of the MAX-232 through a 1 k-ohm resistor, in order to ensure you have a negative contrast control voltage (LCD pin 3) available if your LCD needs it. Those resistors will prevent damage, however unlikely it may be. Not all LCD's are "happy" with a bias voltage at GND or higher. As for using the code that you acquired from Circuit Cellar, or wherever, if you write a simple routine for Read, that does what I described, and, likewise, one for a Write, then you can substitute a call to each (or drop them in as a macro if you like) for the MOVX instructions that the indicated circuit probably uses. RE |