I am using ASM in MPLAB. Thank you Andy for your help! Thomas >From: "Robert E. Griffith" >Reply-To: pic microcontroller discussion list >To: PICLIST@MITVMA.MIT.EDU >Subject: Re: [PIC]: Display Method. Need help! >Date: Thu, 26 Jul 2001 19:42:29 -0400 > >What are you programming in? ASM, C? If you are using the CSS compiler, I >just found out this trick a couple of days ago (see the "string cheese" >thread) from (I think it was) Hans. > >Even though the rtl has not sprintf or itoa functions it has a printf. >Printf can be redirected to a string or to an LCD display like this. > >void displayCharOn(char ch) >{ > // copy char to next location on display > // increment next display position >} > >{ >... > printf(displayCharOnLCD, "The value is %ld", adValue32); >} > >--BobG > >-----Original Message----- >From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On >Behalf Of Thomas N >Sent: Thursday, July 26, 2001 7:28 PM >To: PICLIST@MITVMA.MIT.EDU >Subject: [PIC]: Display Method. Need help! > >I am using the PIC16F877 with an 16x2 LCD module. I 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). Then I store the A/D results in appropriate >"coordinate" >in the memory. After that, I "copy" the entire memory block (the 32 bytes >block) to the LCD. Whenever 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? There 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. Then 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 > >_________________________________________________________________ >Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp > >-- >http://www.piclist.com hint: PICList Posts must start with ONE topic: >[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads > >-- >http://www.piclist.com hint: PICList Posts must start with ONE topic: >[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads > > _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads