LCD control lines in Version 2 development board.

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
KeithSloan
Posts: 114
Joined: Fri Jul 27, 2007 10:50 am
Been thanked: 1 time
Contact:

LCD control lines in Version 2 development board.

Post by KeithSloan »

I am trying to convert a program that uses

;* 1 A2 - LCD Register Select *
;* 2 A3 - Vcc for LCD *

;* 10 B4 - LCD Data 4 *
;* 11 B5 - LCD Data 5 *
;* 12 B6 - LCD Data 6 *
;* 13 B7 - LCD Data 7 *

;* 17 A0 - LCD Enable *
;* 18 A1 - LCD Read/Write *

What are the equivalent on the Version 2 development Board and I guess the LCD E-Block.

Thanks

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Post by Benj »

Hello

The equivalent for the Dev boards and E-Blocks are as follows.

LCD Data 4 - B0
LCD Data 5 - B1
LCD Data 6 - B2
LCD Data 7 - B3
LCD RS - B4
LCD E - B5

LCD VCC - 5V
LCD R/W - GND

Note that the E-Block does not have to be connected to port B.

KeithSloan
Posts: 114
Joined: Fri Jul 27, 2007 10:50 am
Been thanked: 1 time
Contact:

LCD R/W - GND

Post by KeithSloan »

LCD R/W - GND

Does this mean I can only write to the LCD NOT read

User avatar
Steve
Matrix Staff
Posts: 3424
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Post by Steve »

yes - the dev board (and E-Blocks) LCD is configured to be write-only.

KeithSloan
Posts: 114
Joined: Fri Jul 27, 2007 10:50 am
Been thanked: 1 time
Contact:

LCD write only.

Post by KeithSloan »

Pity as it would have only taken one more control line and would have allowed scrolling etc.

Looks like I will have to give up porting the program I had in mind as it does read from LCD as well as write.

User avatar
Steve
Matrix Staff
Posts: 3424
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Post by Steve »

Left-right and right-left scrolling (and almost any other LCD function) can be achieved without needing to read from the device.

KeithSloan
Posts: 114
Joined: Fri Jul 27, 2007 10:50 am
Been thanked: 1 time
Contact:

Scrolling.

Post by KeithSloan »

Steve

Yes I was aware that scrolling was possible by sending commands, but that's not the way the original program was written. Obviously more work to convert. I will have a word with the original Author.

Keith

User avatar
Steve
Matrix Staff
Posts: 3424
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Post by Steve »

Scrolling text that is already written onto the LCD display is very easy to achieve. The command "0x07" sets the display up to allow scrolling and the commands "0x18" and "0x1C" shift the display in either direction.

I hope this helps.

KeithSloan
Posts: 114
Joined: Fri Jul 27, 2007 10:50 am
Been thanked: 1 time
Contact:

Scrolling.

Post by KeithSloan »

What happens to the second line when you scroll left/right? Does it wrap?
I think the application needs to insert text in the top left and characters would fall off the bottom right.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Post by Benj »

Hello Keith

Two line alphanumeric displays all have an 80 character buffer.

On a top line you have locations 0 - 39
On the bottom line you have locations 40 - 79

When you write to the display you start at location 0 and then each subsequent write will be placed into the next location.

Therefore you can fill up all 80 characters if you like and scroll across the display. You can also jump to points in the memory. eg shift the display right 16 places.

The thing to note is that the memory does not change whilst scrolling. It is simply the display that is displaying a different portion of the memory.

Therefore if you move the cursor to location 0 and send a character you are not shifting the data in the buffer but merely overwriting the data in memory location 0.

If you wanted a rolling buffer then you would have to code this on the pic by using an array. The display (visible portion of memory 0-15 & 40-55 on 2x16 line LCD) would have to be completely rewritten each time from the contents of the array.

I hope this helps.

Post Reply