Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

clear character in LCD with matriz keypad and pic 16f877

Status
Not open for further replies.

david_mora

New Member
hi people i am buildng a simple project: a simple LDC and matrix keypad controlled by an 16f877. i already had made the program, i can print what i press in the keypad, but i don't how to delete a letter using the "clear" button. the hardware is as follows:

1 / 2 / 3 / UP
4 / 5 / 6 / DOWN
7 / 8 / 9 / 2nd
Help/ 0 / clear / enter

well the idea is that when i press the clear button, the cursor return one space, but i have no idea about doing that. I think that i can do that with the control lines of the LCD (R, RS,RW) but i need help, how can i use this lines to return one space???? help is needed please!!!!!!
 
david_mora said:
hi people i am buildng a simple project: a simple LDC and matrix keypad controlled by an 16f877. i already had made the program, i can print what i press in the keypad, but i don't how to delete a letter using the "clear" button. the hardware is as follows:

1 / 2 / 3 / UP
4 / 5 / 6 / DOWN
7 / 8 / 9 / 2nd
Help/ 0 / clear / enter

well the idea is that when i press the clear button, the cursor return one space, but i have no idea about doing that. I think that i can do that with the control lines of the LCD (R, RS,RW) but i need help, how can i use this lines to return one space???? help is needed please!!!!!!

You need to use command mode to position the cursor, so you need to keep track of where it is in order to move it back one space - as far as I know, you can't just move it back one.
 
thanks a lot, but i need the code, i mean , the states of the control lines so the cursor return a space.
 
david_mora said:
thanks a lot, but i need the code, i mean , the states of the control lines so the cursor return a space.

From what I remember control code $80 selects the first line, and $C0 selects the second - you need to add the character position along the line to the values above to get the position along the line you want, 0 being the first one.
 
Please forgive me, but I am so in the dark about how you are using the matrix keypad to send characters to the LCD through the 16F877. I am not asking how to send data to an 4bit or 8bit interface LCD, for I have done so with many assemble projects and Visual Basic parallel port projects.

What I do not understand is how are your printing the corresponding keys which are pressed on the keypad without first sending E, RS, and Data signals to the LCD? These codes must originate from a controller. Equally important of the command codes is the correct timing wait states.

1. Command in Hex 0x1C or binary '0001 11XX' (XX = don't care) will move the cursor one position to the right.
2. Command in Hex 0x18 or binary '0001 10XX' (XX = don't care) will move the cursor one position to the left.

Ok now I understand, the keypad is "controlled" by the 16F877 and you are not actually controlling/programming the 16F877. Well as you said, you need the code. Unforunately the code is very invovled. It will possess routines to: create appropriate defined wait delays, initialize the LCD, send characters, and send commands, all through the Data and RS / E status lines. The LCD initialization routine may not be needed if using the pre-existing one.

Now tell me this, how are you going to add this code to an already programmed PIC without erasing the pre-existing data?
 
well i am not going to do that, but i can answer your question, there is a program named as ic-prog, with thisd free internet software, you can read or write the pic. when you had read the pic, you obtain the HEX code, and then there is a lot of free software that converts HEX code to ASM. then you can edit the program and with ic-prog you can burn the pic.
 
david_mora said:
Obtain the HEX code, convert HEX code to ASM, edit the program, and with ic-prog you can burn the pic.

Correct, burn modified code into the PIC with something like IC-Prog or
Win NOPPP. Not the burning, but the modifying is far too difficult. The
read HEX to ASM is non descriptive. All registars and more importantly
the variables will be listed in numerical fashion and not in intelligable
numonics. I can not and have no desire to understand interpreted HEX
to ASM even for code written by me, myself, and I.

Here is one of the following that I would do. Make my own code from
scratch. Else, go with an ancillary device. Add another PIC with just
enough code to process the few operative fuctioning keys of the keypad.
This extra PIC will share the LCD controll lines through address buffers.
True, I know I know, no need to tell me about that. Seems drastic
indeed.

I big you good luck with decifering upto 1k of anothers interpreted code.
 
My routines

see this if it can help
**broken link removed**
**broken link removed**

P.S. I can't do attachments... :(
 
donniedj said:
Correct, burn modified code into the PIC with something like IC-Prog or
Win NOPPP. Not the burning, but the modifying is far too difficult. The
read HEX to ASM is non descriptive. All registars and more importantly
the variables will be listed in numerical fashion and not in intelligable
numonics. I can not and have no desire to understand interpreted HEX
to ASM even for code written by me, myself, and I.

My disassembler (included as part of WinPicProg) gives the standard PIC registers their correct names, but obviously you can't restore variable names.

Although it's still reasonably hard work, having the register names helps a great deal - biggest problem is what the code was written in originally, if it was a high level language like C, it's quite difficult to follow the code it generates (and it's also far longer than it needs to be).
 
Status
Not open for further replies.

Latest threads

Back
Top