PDA

View Full Version : LCD questions



Christopher4187
- 30th March 2011, 22:51
I haven't picked up a PIC in two years. I've dusted off some stuff and wanting to create a new project. My Prius doesn't have ANY engine gauges so I wanted to route some inputs to an LCD screen. I was never really good with coding and after being out for two years, I feel like I know nothing. Anyhow, enough about my personal history......

I have a 2 X 16 LCD (may use a 4 X 20 later on) and I can't seem to locate the correct documentation.

I'm using this:


LCDOUT $FE,1, "RPM", DEC4

I know that will clear the display and display my RPM's on the first line but what if I want something after that. Do I use LCDOUT, $FE, 8? I want to move the characters past the last digit of the RPM's but not sure how.

Same goes for the second line. I know that I can use:


LCDOUT $FE,$C0

I know this will start on the beginning of the second line but what if I want to put a character in the middle of the second line, what do I use?

Charles Linquis
- 30th March 2011, 23:11
I don't usually help Prius owners, but I'll make an exception in this case.

Most two-line displays use $80 as the first location on the first line, and location
$C0 as the first location on the second.

When you give the command $FE,1, you are actually performing two operations in one command: clearing the display and setting the first display address to $80. To write halfway down the first line, write to $88 ($FE,$88). To write halfway down the second line write to $C8.
Note that you can send $FE,1 "string" and later write $FE,$88 "string2". The second write won't erase the first string that you wrote. Your display will now show 'string1 string2'

Christopher4187
- 30th March 2011, 23:22
I don't usually help Prius owners, but I'll make an exception in this caseThanks for making the exception ;-)

I got that all except for one thing - some sort of datasheet would probably help me out. How are the numbers determined when going from left to right for places 0 to 15? In other words, what are the specific values for each place on the LCD screen?

Archangel
- 31st March 2011, 01:25
I can answer that


128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 ' 1ST LINE FOR 2 OR 4 LINE
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 ' LINE 2 OF 2 LINE,
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 ' LINE 3 OF 4 LINE
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 ' LINE 4OF 4 LINE

_1_ _2___3__ 4___5__ 6__7___8___9_ _10__11__12_ 13_ 14__15_16_ _17_ 18__19__20

$80 $81 $82 $83 $84 $85 $86 $87 $88 $89 $8A $8B $8C $8D $8E $8F $90 $91 $92 $93
$C0 $C1 $C2 $C3 $C4 $C5 $C6 $C7 $C8 $C9 $CA $CB $CC $CD $CE $CF $D0 $D1 $D2 $D3
$94 $95 $96 $97 $98 $99 $9A $9B $9C $9D $9E $9F $A0 $A1 $A2 $A3 $A4 $A5 $A6 $A7
$D4 $D5 $D6 $D7 $D8 $D9 $DA $DB $DC $DD $DE $DF $E0 $E1 $E2 $E3 $E4 $E5 $E6 $E7



I think I have this right

Christopher4187
- 31st March 2011, 01:31
Thanks, that's what I was looking for.

kellyseye
- 5th April 2011, 21:18
Have a look at http://lcdsmartie.sourceforge.net/

for a mine of information on all types of LCDs that you may come across.

The articles found here

http://www.epemag.wimborne.co.uk/lcd1.pdf
http://www.epemag.wimborne.co.uk/lcd2.pdf

give a good insight into how the most common LCD devices work.