> First time using an LCD (Jameco/Ampire 2x16 unit), and just > experimenting a bit for now. If you're curious, datasheet > is at: https://www.jameco.com/Jameco/Products/ProdDS/171715.pdf >=20 > I'm controlling the LCD manually (for now) with 11 DIP switches. > Sounds painful I know, but it's not that bad... if it works. > Which it doesn't exactly. >=20 > For each bit-combo. I setup the bits with enable set LOW, then > toggle enable to HIGH and back to LOW. First I ran though the > initialization sequence this way, then set DDRAM to address 0, > then wrote data LLHHLLHH to the RAM. What I get is the char > '3' display, but on the first 6 character positions. If I > toggle the enable to HIGH and back to LOW again, it writes '3' > in the next 6 or so positions. >=20 > That's odd. Anyone know why? My guess is that I'm missing > something fundamental on the operation of LCD's, and the > datasheet is not exactly as well detailed as, say, a Microchip > datasheet. You have to use a debounced signal to the enable input. The LCD=20 writes one character and advances to the next position with=20 every high to low transition on the enable input. Since the=20 input isn't debounced you get several high to low transitions=20 for every toggle of the switch. >=20 > Another Q... I guess CG stands for character generator, but > why is there an operation to write to CG RAM? What's the > purpose of that? Can I create my own fonts or something? Character number 0-7 (mirrored in 8-15) are mapped to CGRAM=20 (character generator RAM) instead of the internal ROM character=20 table. One character needs 8 bytes in the CGRAM to represent=20 it's image on the display. Character 0 uses address 0-7 in=20 CGRAM, character 1 uses address 8-15 and so on. The First byte=20 is the top row and only the five lowest bits in every byte are=20 used. This means that you can only show 8 different user defined=20 characters on the display simultaneously. You write to the CGRAM just as you write to the DDRAM, You just=20 have to send the 'set CGRAM address' command to the display=20 first. You do this once, then the LCD controller advances the=20 address for every byte you write to it. When you are done,=20 writing to the CGRAM you have to reset the address pointer to=20 DDRAM with the 'set DDRAM address' command or 'Cursor home' or=20 'Clear display'. Hope this helps,=20 Ruben >=20 > Thanks, > -Neil. >=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D Ruben J=F6nsson AB Liros Electronic Box 9124, 200 39 Malm=F6, Sweden TEL INT +46 40142078 FAX INT +46 40947388 ruben@pp.sbbs.se =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.