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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/05/04 01:51
Read: times


 
#75439 - RE: ° LCD (44780) works in only ASM not C! °
Responding to: ???'s previous message
When things stop making sense, you've got to stop and work through the problem carefully.Too often we try all kinds of black magic to coax something into working only to find out the problem is elsewhere. A simulator helps here.

It's incredible how one device can cause such a waste of human effort! Them darn lcds! I too had heaps of problems when I first started using them and people still have problems. My problems stemmed from not reading the datasheet - just because you don't understand a requirement won't let you off the hook! Firstly the timing when talking to these devices is critical - these lcds are slow by today's standards. Setup, hold times and minumum pulse widths must be obeyed. Setup times are the time the data must be stable before doing something: outputing the data before asserting E, hold times are the time the data must be held after something has happened, pulse width is the minumum on or off time. The signal E has a minumum width of around 1uS (I'm guessing here as I don't have the data handy), therefore your code must ensure that timing is adhered to - for a 12clock 8051 at 11.0592MHz, just setting and clearing the bit will meet that requirement, if you have a 6 clock or faster micro, that won't. Therefore you have to put in NOP() or just repeat the instruction:

E=1;
E=1; //keep E high for two cycles
E=0;

There's plenty of examples for lcd code that 'works' but if your particular situation is different to the one the author had, well it may not work. If you can tell us what cpu and frequency you are using, then we can better give suggestions. I'm using a Philips LPC2129 micro at the moment running at 60MHz - you really have to be aware of the timing in this instance!



List of 43 messages in thread
TopicAuthorDate
° LCD (44780) works in only ASM not C! °            01/01/70 00:00      
   RE: ° LCD (44780) works in only ASM not            01/01/70 00:00      
      Reply: Keil uVision limits            01/01/70 00:00      
         RE: Reply: Keil uVision limits            01/01/70 00:00      
            Reply to Bartosz Wucke...            01/01/70 00:00      
   RE: ° LCD (44780) works in only ASM not C! °            01/01/70 00:00      
      RE: ° LCD (44780) works in only ASM not C! °            01/01/70 00:00      
         oops-lets try tis again for the code            01/01/70 00:00      
            RE: oops-lets try tis again for the code            01/01/70 00:00      
               RE: oops-lets try tis again for the code            01/01/70 00:00      
   Reply to Ijaz: Comments + my code...            01/01/70 00:00      
      RE: Reply to Ijaz: Comments + my code...            01/01/70 00:00      
         Oleg: Thanks but no success...            01/01/70 00:00      
   RE: ° LCD (44780) works in only ASM not            01/01/70 00:00      
      RE: ° LCD (44780) works in only ASM not            01/01/70 00:00      
   RE: ° LCD (44780) works in only ASM not C! °            01/01/70 00:00      
      RE: ° LCD (44780) works in only ASM not            01/01/70 00:00      
      RE: ° LCD (44780) works in only ASM not            01/01/70 00:00      
         RE: ° LCD (44780) works in only ASM not            01/01/70 00:00      
            RE: ° LCD (44780) works in only ASM not            01/01/70 00:00      
               RE: ° LCD (44780) works in only ASM not            01/01/70 00:00      
               A scope IS a magic wand!            01/01/70 00:00      
                  Oh no it isnt!            01/01/70 00:00      
                     RE: Oh no it isnt!            01/01/70 00:00      
                        RE: Oh no it isnt!            01/01/70 00:00      
                     RE: Oh no it isnt!            01/01/70 00:00      
                        Fix it!!            01/01/70 00:00      
   Reply to Erik, Russell, Bartosz---            01/01/70 00:00      
      RE: Reply to Erik, Russell, Bartosz---            01/01/70 00:00      
      RE: Reply to Erik, Russell, Bartosz---            01/01/70 00:00      
   RE: ° LCD (44780) works in only ASM not C! °            01/01/70 00:00      
      Reply to Kai            01/01/70 00:00      
         RE: Reply to Kai            01/01/70 00:00      
            uVision Project LCD            01/01/70 00:00      
   RE: ° LCD (44780) works in only ASM not C! °            01/01/70 00:00      
      RE: memory mapped LCD            01/01/70 00:00      
      Erik, Russell, Kai...LCD Code...            01/01/70 00:00      
         RE: Erik, Russell, Kai...LCD Code...            01/01/70 00:00      
   It is time to take a look with the scope            01/01/70 00:00      
   Thanks..and final comments...            01/01/70 00:00      
      UPDATE: Traced problem to LCALL...            01/01/70 00:00      
         RE: UPDATE: Traced problem to LCALL...            01/01/70 00:00      
            Reply to Jon..            01/01/70 00:00      

Back to Subject List