Thomas: Use the LCD's "set address" to move to the appropriate= coordinates, then just write the 3 bytes. Here is some code: //=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=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=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D void LCD_Position_Cursor(ubyte x, ubyte y) { //Valid x is 0-15, valid y is 0-1 if((x<=3D15)&&(y<=3D1)) Write_LCD_Control(0x80|(y<<6)|x); } //=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=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=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D //Prints a 3 character string of input at the current location. void LCD_put_dec(ubyte input) { ubyte digit; ubyte no_blank; digit=3Dinput/100; if(digit) { Write_LCD_Data(digit+'0'); no_blank=3D1; } else { Write_LCD_Data(' '); no_blank=3D0; } input%=3D100; digit=3Dinput/10; if(digit|no_blank) Write_LCD_Data(digit+'0'); else Write_LCD_Data(' '); Write_LCD_Data(input%10+'0'); } //=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=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=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D | Brent A. Crosby | Crystalfontz America, Incorporated | 15611 East Washington Road | Valleyford, WA 99036-9747 | brent@crystalfontz.com http://www.crystalfontz.com | voice (509) 291-3514 fax (509) 291-3345 US toll-free (888)= 206-9720 On Thu, 26 Jul 2001 23:28:25 +0000, Thomas N wrote: >I am using the PIC16F877 with an 16x2 LCD module. =A0I am trying= to display >the A/D results on the LCD, 4 numbers per each row. > >What I did is that I set aside 32 bytes of memory and each byte= of memory >represents one ASCII character on the LCD (16 bytes for Line 1= and the >others for Line2). =A0Then I store the A/D results in appropriate= "coordinate" >in the memory. =A0After that, I "copy" the entire memory block= (the 32 bytes >block) to the LCD. =A0Whenever I want to update a certain A/D= number, I go to >its memory location and update the number, then do the "copy" to= the LCD >again. > >Is there a better way to do this? =A0There must be... > >Another "pain" I have to go through is to convert the A/D number= to ASCII. >Let say the A/D result is 173 decimal, I have to separate number= 1, number >7, and number 3. =A0Then covert them to ASCII, then store them in= the memory >block, then copy the memory block to the LCD. > >There must be a better way to do this too, right? > >Thank you in advance! >Thomas -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads