Announcement

Collapse
No announcement yet.

Accessing the 2 E registersof a 40x4 module with LCDOUT

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Accessing the 2 E registersof a 40x4 module with LCDOUT

    I recently got a 40x4 LCD text module and have applied myself to the task of writing a test program in PBP3. I then realized that the E register bit define is singular. I have already imagined a way to divert the E bit data using hardware but that is anything but elegant.

    I have assembly code I downloaded somewhere and got to work years ago on a PIC16F84 but it was large and limited. Remodeling that might give me what I need but in-lining it would not be reasonable nor would linking it using MPASM since I prefer to work with MicroCode Studio.

    Can anyone suggest a work-around like perhaps an in-line assembly patch the could be invoked prior to writing to the second pair of lines to the 40x4? Could the assembly code listing be hacked and then manually compiled into the .HEX file?

  • #2
    it would be possible I think , to steer the "E" signal to two different pins using the CLC module and one additional pin . [you would need to set that pin appropriately for the line you are about to write to]
    assuming your chip has one,
    otherwise you would need to create a new lcd driver or "hack" the pbpxx.lib function to suit the display

    Comment


    • #3
      This is what I used some years ago for an 4 x 40 lcd display. Maybe it will help...
      4X40 DISPLAY TEST.txt
      Dave Purola,
      N8NTA
      EN82fn

      Comment


      • #4
        Thanks Richard and Dave.

        I guess initially I was thinking that since all the pins are assigned their proper PBP identifiers using "DEFINE"s that they were fixed at compile time and not available for modification in the program body. In David's code "SELDISP:" does do just that and it is indeed very simple. Perhaps I should have tried this before posting.

        My fall back solution (hardware method) was to use an analog DPDT switch with the "coil" side controlled by a PIC pin and the singular E-bit pin data from the PBP code routed each way through the DPDT switched side. As I'm not a "Real" engineer, I was just hoping that the analog switch would be simple to use and not give me current, noise or other problems.

        Any further thoughts or enlightenment are welcomed, otherwise I'll just get down to it.

        Comment


        • #5
          abecker, That is exactly what the attached code does. It acts like an OR gate shunting the unwanted lines from being modified when writing to the lines of interest. No relays or external hardware or gates installed except 2 resistors.
          Dave Purola,
          N8NTA
          EN82fn

          Comment


          • #6
            dave
            that method looks pretty simple ,much simpler than my idea .i have never used one of them
            did you need to initialise each section ? , and do the displays support 4 bit mode ?

            Comment


            • #7
              Richard, Yes you have to initialize each of the 2 line displays and Yes the few that I have used in the past do support 4 bit mode.
              Dave Purola,
              N8NTA
              EN82fn

              Comment


              • #8
                I haven't completed wiring up the interface board I am making as of yet so it follows that I haven't adapted the code to my PIC and programmed the test yet.

                I understand Dave's logic exactly as I was thinking along these lines when I first conceived of this project.

                My doubts had arisen when I thought about the "DEFINE" statements that "LCDOUT" uses. As a programmer in "C" and its many derivatives, I equated "DEFINE" to something like "const" in "C" which is fixed at compile time and is not able to be treated as a variable in the program code.

                In the case of the 4x40 test, logically the branch is made prior to calling "LCDOUT" so my reasoning followed that if the "LCDOUT" command used the E_BIT DEFINE during execution, then it would always use the fixed value given to it. Apparently this is not so if Dave's code works as intended. It seems that flipping the right pin value can over-ride the initial definition.

                This is all good news for me and anyone else that wishes to do the same thing.

                Comment


                • #9
                  abecker, The code segment I wrote does not override any of the DEFINE's. In fact acts like a "Diode OR" circuit to the eclocks on the display. It shunts the master eclock that is wired to both the upper and lower lines of the display.
                  Dave Purola,
                  N8NTA
                  EN82fn

                  Comment

                  Working...
                  X