Creating and Writing to Editable Fields on 4x20 HCD44780-Based Character LCD


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2007
    Posts
    4

    Default Creating and Writing to Editable Fields on 4x20 HCD44780-Based Character LCD

    Hi everyone.

    I am fairly new to PicBasic programming. I have the PicBasic Pro compiler and have some of the basics down. I have made a 40-pin demo board and have successfully gotten analog input values and written them to the on-board LCD.

    I have the LCD set up in a standard parallel configuration on PortD (all 8) with PortE (RE0, RE1, & RE2) as control.

    I have familiarized myself with the LCDOut statement, and it is working fine on my board.


    What I need to do now is learn how to, using the on-board keypad, enter and edit editable fields on the LCD, then save the values to variables to be used in the program. Is there a document somewhere that covers this? Thank you for any and all input!

    Best Regards,
    mikerho


    I'm including this in case it helps:

    I am currently using a PIC18F4455 microprocessor; pin-mapping is as follows:
    ============ ===== ======
    Function/
    Component Pin ID Pin #
    ============ ===== ======
    Reset MCLR 1
    Pot01 RA0(AN0) 2
    Pot02 RA1(AN1) 3
    Pot03 RA2(AN2) 4
    Pot04 RA3(AN3) 5
    DQ001 RA4 6
    DQ002 RA5 7
    20MHz Crystal OSC1 13
    20MHz Crystal OSC2 14
    DQ003 RC0 15
    DQ004 RC1 16
    DQ005 RC2 17
    DQ006 RC3 18
    DI001 RC4 23
    DI002 RC5 24
    DI003 RC6 25
    DI004 RC7 26
    LCD RS RE0 8
    LCD R/W RE2 10
    LCD E RE1 9
    LCD DB0 RD0 19
    LCD DB1 RD1 20
    LCD DB2 RD2 21
    LCD DB3 RD3 22
    LCD DB4 RD4 27
    LCD DB5 RD5 28
    LCD DB6 RD6 29
    LCD DB7 RD7 30
    Key Row1 RB0 33
    Key Row2 RB1 34
    Key Row3 RB2 35
    Key Row4 RB3 36
    Key Col1 RB4 37
    Key Col2 RB5 38
    Key Col3 RB6 39
    Key Col4 RB7 40

  2. #2
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    699


    Did you find this post helpful? Yes | No

    Default Re: Creating and Writing to Editable Fields on 4x20 HCD44780-Based Character LCD

    Do you know how to read the input from a 4x4 keypad? If the answer is no, there are many threads here that cover that. Maybe, somebody else can find the right thread for you. You say that you are familiarized with the LCDOUT command. So, that part shouldn't be a problem. About saving the values to a variable, if you post the code that you have so far we can guide you in the right direction.
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  3. #3
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    699


    Did you find this post helpful? Yes | No

    Default Re: Creating and Writing to Editable Fields on 4x20 HCD44780-Based Character LCD

    Ok. Here is a keypad include file that MisterE wrote,

    http://www.picbasic.co.uk/forum/cont...Keypad-routine
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  4. #4
    Join Date
    Apr 2011
    Location
    Welches, Oregon
    Posts
    198


    Did you find this post helpful? Yes | No

    Default Re: Creating and Writing to Editable Fields on 4x20 HCD44780-Based Character LCD

    Quote Originally Posted by mikeRho View Post

    [B]What I need to do now is learn how to, using the on-board keypad, enter and edit editable fields on the LCD, then save the values to variables to be used in the program. Is there a document somewhere that covers this? Thank you for any and all input!
    As I understand it, the LCD is a display only device - you will not be able to edit anything on screen; rather, you must edit the underlying variables and display the changed values. What I mean is that if you are displaying variable "A" at position 1, changing the value of "A" and rewriting it to the LCD will be the "edit". You might then change only limited values - say as in setting a clock (which BTW there are plenty of examples of on the forums that should give you ideas how this may be done) or, perhaps, you might want to define an array as an area of video memory and reprint that as the values change.

    If you wish to incorporate some "rollback" feature (not finalize the change until approved, perhaps) you will copy the original value of "A" to say... "B", then display "B" until the final step where you write A=B to finalize - or B=A to rollback.

    Generally, I find numeric fields easier (less tedious) to "edit" as addition or subtraction may be used to scroll through a range of numbers, but alphanumeric isn't too bad - I designate an area in EEPROM and manipulate READ values to increment or decrement values rather than deal with alphas directly.

    HTH-

  5. #5


    Did you find this post helpful? Yes | No

    Default Re: Creating and Writing to Editable Fields on 4x20 HCD44780-Based Character LCD

    This article has some really good info on keypad entry. He shows how to count key presses
    and convert individual entries to a usable variables. Ignore the circuit since you are directly
    connecting your keypad.

    http://www.rambal.com/descargas/libr...%20Display.pdf

Similar Threads

  1. Big Digits on 4x20 LCD
    By Heckler in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 1st March 2014, 23:18
  2. Trouble with Optrex 4x20 LCD module
    By Brock in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 15th January 2007, 01:49
  3. code for LCD-4x20 HD44780....HELP
    By Martin.... in forum mel PIC BASIC
    Replies: 13
    Last Post: - 24th July 2006, 22:31
  4. LCD 4x20 HD44780
    By inteco in forum mel PIC BASIC
    Replies: 13
    Last Post: - 27th June 2006, 16:52
  5. 4x20 LCD Display Problem
    By kayki in forum mel PIC BASIC
    Replies: 0
    Last Post: - 24th August 2005, 15:42

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