The odd things had to do with the limitations of CCS C, not really with anything else, and would not apply in assembly language. Here's how I approached it. 1. I created a string for line #1 of the display, then printf'ed the string to the display. 2. I created another string for the second line of the display, which is the bar graph, initialized to all blanks. 3. One of the characters in the LCD character set was a big black rectangle, which I used to create the bargraph. You may have a similar character in the hitachi character set I don't know. I think it was 0X123 but I forget. 4. Let's say the measurement controlling the bargraph is Y, maybe an analog input or a timer. Y ranges from 0 to 255 and there are 8 spots in my bargraph, so Y has to change 255/8 or 32 for each character in the bargraph. YMMV (Your Math May Vary) 5. Divide Y by 32, this is the number of bars lit, say it's called NumBars. 6. For (j = 0 to NumBars) {String[j] = 0X123;} 7. then print this string to the display. That's the easy part. The hard part is doing this all in assembler. ;-) If you are doing anything this complex, consider getting a C compiler and learning it, it will save you gobs of headscratching time. --Lawrence Lile ----- Original Message ----- From: "cflat" To: "Lawrence Lile" Sent: Monday, March 04, 2002 11:53 AM Subject: Re: Re: Bar graph code? > > Hi Lawrence, > Thanks for the reply. I am using a standard interface with the > Hitachi chip. I am doing this in assembly but if you had to do > some odd things to make it work, it might be helpful to look at > your C code. Any help is appreciated. Thanks again! > Charles > > ---------- Original Message ---------------------------------- > From: "Lawrence Lile" > Reply-To: "Lawrence Lile" > Date: Mon, 4 Mar 2002 08:12:53 -0600 > > >I've done this on a scott edwards serial LCD, are you using that > type? or > >some Hitachi interface? > > > >I did it on CCS C. Had to resort to some odd tricks to get it to > work. > > > >If any of this would be useful to you lemme know. > > > >--Lawrence > > > > > >----- Original Message ----- > >From: "Dale Botkin" > >To: > >Sent: Sunday, March 03, 2002 3:06 PM > >Subject: Re: Bar graph code? > > > > > >> On Sun, 3 Mar 2002, cflat@ev1.net wrote: > >> > >> > Hi all, > >> > I am reading a value (0-5volts) from the A/D on a PIC16F877 > and I > >> > want to display it as sort of a bar graph along the 2nd line > of the > >> > 2X16 LCD display to show a relative strength indication. Does > >> > anyone know of any code out there already? I just thought > I'd ask > >> > before I reinvent the wheel. > >> > >> I don't have any code per se, but it's a very, very small > wheel... > >> > >> Your ADC output will be 10 bits, from 0 to 1023. Shift it to > the right > >> six times (divide by 64) and you have the number of block > characters or > >> whatever to print on your LCD. Of course if you're using the > ADC in 8-bit > >> mode, just use the upper 4 bits for the number of blocks to > print. Heck, > >> I could even do that in assembly! 8-) > >> > >> Dale > >> > >> -- > >> http://www.piclist.com hint: PICList Posts must start with ONE > topic: > >> [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:, > [AD]: ->Ads > >> > >> > > > > > > > ________________________________________________________________ > Sent via the EV1 webmail system at mail.ev1.net > > > > -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics