Optimizing LCD commands?


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2006
    Posts
    36

    Default Optimizing LCD commands?

    I have been working on code for a small handheld programmer with a 16x2 LCD (that uses a 16F690) that will be used to program another circuit (that also has a 16F690). The programmer is used to adjust different variables and then pass them to the application circuit. The problem I have is that in my efforts to gain more control, I have added a lot of settings creating a large piece of code. The total memory space for the 16F690 is 4096 bytes of space. I have two different but similar versions of software for the handheld programmer and would like to put both on the same 16F690 but do not have enough room. I do have a lot of similar functions that I use over and over again but I am not sure if I can somehow condense the code.

    I use the serial command to send out data:
    SEROUT2 INFRARED_LED, 1646, ["A", EXTEND_FILL_SETTING]
    SEROUT2 INFRARED_LED, 1646, ["B", EXTEND_DUMP_SETTING]
    SEROUT2 INFRARED_LED, 1646, ["C", EXTEND_PULSES]
    SEROUT2 INFRARED_LED, 1646, ["D", RETRACT_PULSES]
    SEROUT2 INFRARED_LED, 1646, ["E", CHECKSUM_WORD.HIGHBYTE]
    SEROUT2 INFRARED_LED, 1646, ["F", CHECKSUM_WORD.LOWBYTE]
    SEROUT2 INFRARED_LED, 1646, ["G", RETRACT_FILL_SETTING]
    and so on. I cannot think if there is a way to call this over and over again as the following
    SEROUT2 INFRARED_LED, 1646, ["X", "Y"]
    where X is a letter constant, and Y is the variable that I want sent out.


    If possible I would want to do this with my read and write functions that I use.
    WRITE 0, EXTEND_FILL_SETTING
    WRITE 2, EXTEND_DUMP_SETTING
    WRITE 5, EXTEND_PULSES
    WRITE 6, RETRACT_PULSES
    WRITE 14, RETRACT_FILL_SETTING
    as WRITE "ADDRESS", Y, changing the address of each variable and changing each variable.

    I also use a lot of LCDOUT commands, which I imagine are eating up alot of code. I was wondering if it would be possible to some how use a subroutine to print things that output several times.
    Lcdout "Down Vent"
    Lcdout "Down Fill"
    Lcdout "Up Vent"
    Lcdout "Up Fill"
    I use Up and Down in couple other places and didn't know I could do something else other than writing them out again. I mean Call Display Up + Call Display Vent to display "Up Vent"

    Any possible thoughts at making elements alittle more optimized.

    Thanks for your time.

  2. #2
    Join Date
    May 2006
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    With the code that I have written, I have a total of 4064 lines and need to add some more. The total available on the 16F690 is 4096. Is there anyway that I can attach a separate EEPROM chip and then utilize it for more program memory space? If so does any one have any examples. Thanks.

Similar Threads

  1. Is this code not initialising the LCD properly?
    By Platypus in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 30th January 2010, 19:14
  2. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 19:54
  3. LCD commands
    By ruijc in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 26th September 2008, 12:09
  4. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30
  5. Dedicated LCD Controller question
    By chuckles in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 27th February 2006, 14:44

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts