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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/11/06 08:26
Read: times


 
#124023 - Many ways to skin a cat
Responding to: ???'s previous message

The 4bit mode was discussed here. I presented a method that allows you to use any port pin in any order.

http://www.8052.com/forum/read.phtml?id=120300

This removes the need to and & or bits. This is using the 8051 bit features - it is also very obvious what the code is doing.
However, it is always good practice to be fluent with anding and oring.

Some other hints - when you start to write larger assembler programs, you start running out of registers. I tend to choose a 'c' compiler and use its rules for passing parameters. For example:

byte - Acc
word R7:R6
long R7:R6:R5:R4

Storing temps in registers ends up creating more problems than it solves. Best to push Acc if a routine to be called trashes it rather than copy to R3 as you do. Not that this solves your immediate problem.

List of 52 messages in thread
TopicAuthorDate
4-bit LCD ... single PORT            01/01/70 00:00      
   there's a datasheet            01/01/70 00:00      
      LCD datasheets ...            01/01/70 00:00      
         the Hitachi Datasheet for HD44780 is not like that            01/01/70 00:00      
         VFDs: Lucky b*stard            01/01/70 00:00      
   4-bit LCD            01/01/70 00:00      
      There are examples on 8052.COM if you search            01/01/70 00:00      
         And you don't need R/W*            01/01/70 00:00      
            but be aware! You discard several functions.            01/01/70 00:00      
               on saving pins            01/01/70 00:00      
                  wait a minute ...            01/01/70 00:00      
                     Richard, please            01/01/70 00:00      
                        Why should he change direction?            01/01/70 00:00      
                           no such impilcation            01/01/70 00:00      
                              well, the logic is simple ...            01/01/70 00:00      
                                 OK, as always            01/01/70 00:00      
                  Richard, quit bickering            01/01/70 00:00      
                     it goes to an OLD issue            01/01/70 00:00      
                        as I see it is that this is GREAT.            01/01/70 00:00      
                  On saving pins            01/01/70 00:00      
                  read the forum messages, don't glance            01/01/70 00:00      
   Here is my example            01/01/70 00:00      
      why do you persist in 'advertising' this CRAP            01/01/70 00:00      
         Attack, Attack, Attack.            01/01/70 00:00      
            get your facts straight            01/01/70 00:00      
               Did you understand real life ?            01/01/70 00:00      
                  yes, I do            01/01/70 00:00      
   Answer            01/01/70 00:00      
      Jon, great answer            01/01/70 00:00      
         Yes, indeed, ... BUT ...            01/01/70 00:00      
            How do you know...            01/01/70 00:00      
               It's possible that things worked that way            01/01/70 00:00      
   Better late than never            01/01/70 00:00      
      \"It works\"            01/01/70 00:00      
         Yes, it does            01/01/70 00:00      
            does that mean they're all alike?            01/01/70 00:00      
               Yes, if all guys would read the datasheets...            01/01/70 00:00      
                  Hitachi JHD 162a            01/01/70 00:00      
                     Point missed            01/01/70 00:00      
                     That's not relevant!            01/01/70 00:00      
                        Advice appriciated            01/01/70 00:00      
                           where are you going to find that?            01/01/70 00:00      
      well, you just posted your own 'comment'            01/01/70 00:00      
   Simple Guidance            01/01/70 00:00      
      One LCD, One Port            01/01/70 00:00      
      horsefeathers, male cow manure            01/01/70 00:00      
   GOD!!!            01/01/70 00:00      
      try a shadow register            01/01/70 00:00      
   Full assembly Code ... LCD 4 bit            01/01/70 00:00      
      On first reading...            01/01/70 00:00      
      probs in 2 SUBROUTINES ...            01/01/70 00:00      
   Many ways to skin a cat            01/01/70 00:00      

Back to Subject List