Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/11/07 18:02
Read: times


 
#130675 - Which ports you use doesn't matter ...
Responding to: ???'s previous message
Ralph Sac said:
Richard Erlacher said:
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


Hi Richard:
So you want me subsitute Calls for Movx instructions where they come up in Tims program. Don't I have also change the port assignments because I use ports 1 and port 3 on the 89c4051 mcu. And the 80c31 does not in tester?

Best regards,

Ralph Sac

P.S. As far as the schematic I read the correct way post it on the 8052.com website.


Ralph,

I don't care how you do this, but, you do have to recognize that you have to comprehend what the external-memory-based (memory mapped) circuit does, and then do that in port-mapped mode. In the memory-mapped application, you use external circuitry to generate the strobes, e.g. the 'E' strobe that was subject of your original query. In port-mapped mode, for example, you set the RS bit as needed, you set the R/W bit as needed, and then you do what makes the I/O happen, as I prefiously indicated. Which ports you use doesn't matter at all. If you use port 0, you'll need pullup resistors in order to meet the LCD's input voltage requirements. The point of my earlier post was that you have to know what the purportedly working circuit you're copying does, regardless of how you emulate its functions. If you fail to do that, you're on your own and in uncharted waters.

RE




List of 44 messages in thread
TopicAuthorDate
How to create wr rd for E strobe on LCD            01/01/70 00:00      
   No research!            01/01/70 00:00      
      Wrong plenty of research            01/01/70 00:00      
         clock speed?            01/01/70 00:00      
            Erik it is 12 clocker            01/01/70 00:00      
               the question is moot ...            01/01/70 00:00      
         Wrong!            01/01/70 00:00      
            My error            01/01/70 00:00      
               Asm code            01/01/70 00:00      
                  missing boldface            01/01/70 00:00      
                  4051 has no port 0            01/01/70 00:00      
                     Tell me something I don't know!            01/01/70 00:00      
   when posting a schematic PLEASE do not do it in a            01/01/70 00:00      
      This why Erik            01/01/70 00:00      
         upset?            01/01/70 00:00      
            Your 1 True Love            01/01/70 00:00      
               I don't what happen but see below            01/01/70 00:00      
   AT89C4051 hardware            01/01/70 00:00      
      A better schematic post            01/01/70 00:00      
         Understanding the schematic will help.            01/01/70 00:00      
            Thanks for the your reply            01/01/70 00:00      
               Which ports you use doesn't matter ...            01/01/70 00:00      
   LCD interface            01/01/70 00:00      
      Thanks for the comment            01/01/70 00:00      
         Cant post code?            01/01/70 00:00      
      Yikes, that interface is old-skool !            01/01/70 00:00      
         yikes, your attitude sucks            01/01/70 00:00      
         You don't like my idea            01/01/70 00:00      
            It is here!            01/01/70 00:00      
               don't quite understand            01/01/70 00:00      
                  I can            01/01/70 00:00      
                     commodore 64            01/01/70 00:00      
   STOP - THINK - START OVER            01/01/70 00:00      
      Thanks for your comments            01/01/70 00:00      
         You must know what is required            01/01/70 00:00      
            an addition            01/01/70 00:00      
               shortcut            01/01/70 00:00      
                  in response to Andy, there is now one worse            01/01/70 00:00      
                     That's why these queries continue to appear HERE!            01/01/70 00:00      
                     Mapquest            01/01/70 00:00      
   Nice Thread. Lots of passion.            01/01/70 00:00      
      This was a popular PIC demo about 15 years ago            01/01/70 00:00      
         We're dating ourselves a bit arent we?            01/01/70 00:00      
            Well ... Yes ... maybe ... those were the days ...            01/01/70 00:00      

Back to Subject List