Searching \ for '[PIC]: Erasing last LCD character - how?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/io/lcd/pic.htm?key=lcd
Search entire site for: 'Erasing last LCD character - how?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Erasing last LCD character - how?'
2001\04\25@102136 by E. C. Short

flavicon
face
Hello,
 How do you erase the last character written to an LCD?
I have a PICF84 driving a typical Hitachi 16x2 LCD and I
cannot find any info on how to erase the last character sent.
I have Myke Predko's book - but I cannot find any info on this.
I'd much appreciate your help on this!
Thanks,
        Ed

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body


2001\04\25@103107 by D Lloyd

flavicon
face
part 1 1038 bytes content-type:text/plain; charset=us-ascii
Hi,

You'd have to move the cursor back to the last position (i.e. the one you
want to erase), then write a space to that position.

Regards,
Dan




(Embedded     "E. C. Short" <.....shortKILLspamspam@spam@ENG.BUFFALO.EDU>KILLspamspam@spam@MITVMA.MIT.EDU>> image moved   25/04/2001 15:21
to file:
pic32014.pcx)





Please respond to pic microcontroller discussion list
     <
PICLISTspamKILLspamMITVMA.MIT.EDU>
Sent by:  pic microcontroller discussion list <.....PICLISTKILLspamspam.....MITVMA.MIT.EDU>


To:   EraseMEPICLISTspam_OUTspamTakeThisOuTMITVMA.MIT.EDU
cc:
Subject:  [PIC]: Erasing last LCD character - how?

Security Level:?         Internal


Hello,
 How do you erase the last character written to an LCD?
I have a PICF84 driving a typical Hitachi 16x2 LCD and I
cannot find any info on how to erase the last character sent.
I have Myke Predko's book - but I cannot find any info on this.
I'd much appreciate your help on this!
Thanks,
        Ed

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body






part 2 165 bytes content-type:application/octet-stream; (decode)

part 3 136 bytes
--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email @spam@listservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body


2001\04\25@132112 by E. C. Short

flavicon
face
Yes, but how do you move the cursor back?  I have tried a number of
things, but to no avail.  The only info I have is sketchy - so if you
know the instruction or could easily look it up I'd be very grateful.

Thanks again,
              Ed


On Wed, 25 Apr 2001, D Lloyd wrote:

{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservEraseMEspam.....mitvma.mit.edu with SET PICList DIGEST in the body


2001\04\25@134650 by Robert

flavicon
face
If I recall correctly, you write 00010000 to the LCD as a command.


"E. C. Short" wrote:

> Yes, but how do you move the cursor back?  I have tried a number of
> things, but to no avail.  The only info I have is sketchy - so if you
> know the instruction or could easily look it up I'd be very grateful.
>

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspammitvma.mit.edu with SET PICList DIGEST in the body


2001\04\25@144432 by Drew Vassallo

picon face
> > Yes, but how do you move the cursor back?  I have tried a number of
> > things, but to no avail.  The only info I have is sketchy - so if you

You don't move it "back," you just issue an instruction to the LCD to
POSITION the cursor to whereever you want it.  How did you position the
cursor initially?  Or didn't you?  Check out Myke Predko's LCD page at
http://www.myke.com.  It should have all the information you need.

--Andrew
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservEraseMEspamEraseMEmitvma.mit.edu with SET PICList DIGEST in the body


2001\04\25@145431 by E. C. Short

flavicon
face
But I dont want to have to know the address of the cursor because I dont
want to tie up an extra pin - and the delete or backspace may occur at any
location.  Isnt there just a way to tell the cursor to just go back one
character?


On Wed, 25 Apr 2001, Drew Vassallo wrote:

{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservTakeThisOuTspamspammitvma.mit.edu with SET PICList DIGEST in the body


2001\04\25@150943 by Edson Brusque

face
flavicon
face
Hello Robert and E.C.,

>> Yes, but how do you move the cursor back?  I have tried a number of
>> things, but to no avail.  The only info I have is sketchy - so if you
>> know the instruction or could easily look it up I'd be very grateful.

>If I recall correctly, you write 00010000 to the LCD as a command.

   I have took a quick look at my includes and found:

#define LCD_CursorLeft()   LCD_SendCommand(0b00010000)
#define LCD_CursorRight()  LCD_SendCommand(0b00010100)

   So, Robert is right. :)

   Best regards,

   Brusque

-----------------------------------
Edson Brusque
Research and Development
C.I.Tronics Lighting Designers Ltda
(47) 323-2685  /  (47) 9993-6453
Blumenau  -  SC  -  Brazil
http://www.citronics.com.br
-----------------------------------

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspamspamspamBeGonemitvma.mit.edu with SET PICList DIGEST in the body


2001\04\25@152219 by 1?Q?Alexandre_N._Guimar=E3es?=

flavicon
face
Hi


> But I dont want to have to know the address of the cursor because I dont
> want to tie up an extra pin - and the delete or backspace may occur at any
> location.  Isnt there just a way to tell the cursor to just go back one
> character?


   I guess you have no option. You have to keep track of the LCD position.
The LCD can "roll" to the sides but have no backspace !

Best regards,
Alexandre Guimaraes
RemoveMEalexgKILLspamspamiis.com.br

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservSTOPspamspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body


2001\04\25@152424 by Nick Ray

flavicon
picon face
>
> But I dont want to have to know the address of the cursor because I dont
> want to tie up an extra pin - and the delete or backspace may occur at any
> location.  Isnt there just a way to tell the cursor to just go back one
> character?
>
>

Well, from my controller's datasheet (HD44780 compatible)......

(5) Cursor and display shift

DB7 0
DB6 0
DB5 0
DB4 1
DB3 D/C
DB2 R/L
DB1 x
DB0 x

When D/C = "L" and R/L = "L", the cursor and blink positions are shifted to
the left by 1 character position (ADC is decremented by 1).

When D/C = L and R/L = "H", the cursor and blink positions are shifted to
the right by 1 character position (ADC is incremented by 1).

When D/C = "H" and R/L = "L", the entire display is shifted to the left by 1
character position. The cursor and blink positions are also shifted with the
display (ADC remains unchanged).

When D/C = "H" and R/L = "H", the entire display is shifted to the right by
1 character position. The cursor and blink positions are also shifted with
the display (ADC remains unchanged).

In the 2-line display mode, the cursor and blink positions are shifted from
the first to the second line when the cursor is shifted to the right next to
the fortieth digit (27; hex.) in the first line. No such shifting is made in
other cases.
When shifting the entire display, the display pattern, cursor, and blink
positions are in no case shifted between lines (from the first to the second
line or vice versa).

HTH
Nick

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spamBeGonelistservSTOPspamspamEraseMEmitvma.mit.edu with SET PICList DIGEST in the body


2001\04\25@164803 by myke predko

flavicon
face
The problem with this method is what happens when you are at the edge of the
display?

To properly backspace, you are going to have to keep track of the column the
cursor is in.  If it is not the start character, then you can go back.

myke
{Original Message removed}

2001\04\25@170206 by Edson Brusque

face
flavicon
face
Hello Myke,

> The problem with this method is what happens when you are at the edge of
the
> display?

   I've already thought about it. I think it depends on the size
(characters) of the display. Say if you're using a 2x16 (2 lines of 16
characters each) display. When you print the last character of a line, the
controller think it's on the 17th column. That's because the controller have
a memory of 40 charactes. The controller doesn't distinguish a 2x16 of a
2x20 display. So, the back_cursor command will work ok.

   If you're using a 2x20 display, I don't know what could happen. I would
make a try tomorrow.

   Please, correct me if I'm wrong.

   Best regards,

   Brusque

-----------------------------------
Edson Brusque
Research and Development
C.I.Tronics Lighting Designers Ltda
(47) 323-2685  /  (47) 9993-6453
Blumenau  -  SC  -  Brazil
http://www.citronics.com.br
-----------------------------------

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email KILLspamlistservspamBeGonespammitvma.mit.edu with SET PICList DIGEST in the body


2001\04\25@180741 by myke predko

flavicon
face
Hi Brusque,


> Hello Myke,
>
> > The problem with this method is what happens when you are at the edge of
> the
> > display?
>
>     I've already thought about it. I think it depends on the size
> (characters) of the display. Say if you're using a 2x16 (2 lines of 16
> characters each) display. When you print the last character of a line, the
> controller think it's on the 17th column. That's because the controller
have
> a memory of 40 charactes. The controller doesn't distinguish a 2x16 of a
> 2x20 display. So, the back_cursor command will work ok.

As far as I know If you shift left past the top left most character, the LCD
controller will roll over and assign the cursor to the last line in memory
(offset 0x03F on the second line).

For a 16x2 LCD this character is not displayed and the cursor will not be
displayed until you either backspace until you get to the displayed
character memory or display new characters (and move the cursor to the
right) until you get to the displayed character memory.

>     If you're using a 2x20 display, I don't know what could happen. I
would
> make a try tomorrow.

The same thing as the 16x2.

>     Please, correct me if I'm wrong.

I'll be interested in hearing what happens with your experiment.

Take care,

myke

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspamEraseMEmitvma.mit.edu with SET PICList DIGEST in the body


2001\04\25@200529 by Gennette, Bruce

flavicon
face
Simple - reverse the cursor direction, then print 2 spaces, then reverse the
cursor direction again.

If you are implementing a full LINE_EDITOR you only move the flashing
cursor, without replacing the charator with a space (you wait for the user
to punch in a new charactor, then you update the string in software).

Of course you'll need bounds testing so that you don't have the cursor
dissapearing into non-displayed parts of the controller's memory, etc.

Bye.

{Original Message removed}

2001\04\26@061059 by Peter L. Peres

picon face
You have to keep track of the current cursor position. Call this x,y. Then
to erase the last character:

--x;
goto(x,y);
putc(' ');
goto(x,y);

There is another way to do this using the 'cursor moves left' option on
some LCDs. It is slightly faster.

Peter

--
http://www.piclist.com hint: To leave the PICList
@spam@piclist-unsubscribe-request@spam@spamspam_OUTmitvma.mit.edu


2001\04\30@135408 by Edson Brusque

face
flavicon
face
Hello Myke et all,

> I'll be interested in hearing what happens with your experiment.

   I've done a quick test with a 2x16 LCD. The one I've used (probably all
44780 based will work same way) have a character RAM of 80 bytes:

          this is shown    this isn't shown
          ---------------- ------------------------
   Line1: 1234567890123456 789012345678901234567890
   Line2: 1234567890123456 789012345678901234567890

   If you keep sending LCD_Right commands, the cursor will walk
left-to-right until the end of the line and then roll to the first character
of the other line. LCD_Left commands work accordingly.

   Best regards,

   Brusque

-----------------------------------
Edson Brusque
Research and Development
C.I.Tronics Lighting Designers Ltda
(47) 323-2685  /  (47) 9993-6453
Blumenau  -  SC  -  Brazil
http://www.citronics.com.br
-----------------------------------

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spamBeGonelistservspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...