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.

char lcd question

Status
Not open for further replies.

peeta

New Member
hi ,
first of all sorry for my poor english :D
hier's the thing:i'm playing with pic16f84, part of my code includes some basic routines to control lcd.the lcd has only one row (16chars long) and has 8bit interface.when i attempt to write something to screen , it works well - until 8. chars (1/2 screen lenght) is written - cursor just moves to the right, but no character is displayed.should i switch some memory bank or what?lcd has e,rw,rs and data bus.so my question is how can i write to the rest of screen?(to the second half of it :D )
thanks for any answer.
 

ericgibbs

Well-Known Member
Most Helpful Member
hi ,
first of all sorry for my poor english :D
hier's the thing:i'm playing with pic16f84, part of my code includes some basic routines to control lcd.the lcd has only one row (16chars long) and has 8bit interface.when i attempt to write something to screen , it works well - until 8. chars (1/2 screen lenght) is written - cursor just moves to the right, but no character is displayed.should i switch some memory bank or what?lcd has e,rw,rs and data bus.so my question is how can i write to the rest of screen?(to the second half of it :D )
thanks for any answer.

hi,:)
Some 16 character LCD's require a different ram address for the first 8 characters and the last 8 characters.

Do you have a model number for the LCD.? also what LCD ram address are you using in your program.
 

peeta

New Member
thanks for very quick answer :) lcd model is cv4161h.datasheet in attachment :)
 

Attachments

  • CV4161H.pdf
    775.6 KB · Views: 506

ericgibbs

Well-Known Member
Most Helpful Member
thanks for very quick answer :) lcd model is cv4161h.datasheet in attachment :)

hi,
Thanks for the d/s, it as I suspected the 2nd 8 characters start at address 0x40.

Look at the image.

So when you write to the LCD on the second 8 characters use address 0x40.

OK.?:)

EDIT:
if you have problem, post your program listing.
 

Attachments

  • AAesp03.gif
    AAesp03.gif
    9.6 KB · Views: 72
Last edited:

peeta

New Member
jj i understand :) so i will use opcode for 'set ddram address' - but how can i input address 40h here, if there is only 7 bits left?
 

ericgibbs

Well-Known Member
Most Helpful Member
jj i understand :) so i will use opcode for 'set ddram address' - but how can i input address 40h here, if there is only 7 bits left?

hi,
You are confusing characters with addresses.

In your program when you initialised the LCD you wrote Command codes to the LCD.

You do the same action, load the Wreg with 0x40 and write a Command instruction. This will tell the LCD controller that the next Character you write will goto the 8th LCD position.

If you dont understand, please post your program.
 

peeta

New Member
i got it :) it's working now :) thanks so MUCH for your help and your time:) :)
and final question : to switch back to 1st 8chars i have to just switch back to ddram 0, right?
 

ericgibbs

Well-Known Member
Most Helpful Member
i got it :) it's working now :) thanks so MUCH for your help and your time:) :)
and final question : to switch back to 1st 8chars i have to just switch back to ddram 0, right?

Well done.:)

Yes for the first 8 chars use addr 0x00.

You can also use the same method for writing a character to any position on the LCD.
Set the ram addr in Wreg and write a command.
 
Status
Not open for further replies.

EE World Online Articles

Loading
Top