Searching \ for 'Look up table: can I do this? a rethink and ASCII' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/mems.htm?key=table
Search entire site for: 'Look up table: can I do this? a rethink and ASCII'.

No exact or substring matches. trying for part
PICList Thread
'Look up table: can I do this? a rethink and ASCII '
1998\08\29@024358 by Quentin

flavicon
face
Thanks to all that reply. What I did now was this:

org 0
Start
init PIC
call to LCD setup routines
Lookup Table
Main program
Subroutines
end

It works. I now only loose 32 addresses to the Start before the Lookup
Table (And I am sure with a little tinkering, can make it less).

Another idea hit me. Instead of having lines of RETLW to write a message to
the LCD, how about putting the whole ASCII table in the lookup table.
Then with some sort of formula (or codes) make up a message. It would be
easier to edit.

Even better, no ASCII table, just work out the ASCII values as needed. I've
done this to display a counter, all I do is add 30H to my numbers and send
it to LCD (ones, tens, hunderds, etc.). But I've never tried it with
Letters.

Any ideas?

Quentin

1998\08\29@123620 by Mike Keitz

picon face
On Sat, 29 Aug 1998 08:42:15 +0200 Quentin <spam_OUTqscTakeThisOuTspamICON.CO.ZA> writes:

>Another idea hit me. Instead of having lines of RETLW to write a
>message to
>the LCD, how about putting the whole ASCII table in the lookup table.
>Then with some sort of formula (or codes) make up a message. It would
>be
>easier to edit.

MPASM lets you make tables of text (string constants in a way) easily
with the 'dt' directive.  For example,
       dt      "Text"
is the same as
       retlw   "T"
       retlw   "e"
       retlw   "x"
       retlw   "t"

>Even better, no ASCII table, just work out the ASCII values as needed.

As you see above, MPASM will handle the ASCII for you.  The value which
is actually stored is the ASCII code of the letter in quotes.  For
example, "0" converts to 0x30.


_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

1998\08\31@065703 by Caisson

flavicon
face
> > Van: Quentin <.....qscKILLspamspam@spam@ICON.CO.ZA>
> > Aan: PICLISTspamKILLspamMITVMA.MIT.EDU
> > Onderwerp: Re: Look up table: can I do this? a rethink and ASCII code
> > Datum: zaterdag 29 augustus 1998 8:42
> >
> Thanks to all that reply. What I did now was this:
>
> org 0
> Start
> init PIC
> call to LCD setup routines
> Lookup Table
> Main program
> Subroutines
> end
>
> It works. I now only loose 32 addresses to the Start before the Lookup
> Table (And I am sure with a little tinkering, can make it less).

Move your data to another page (preferrably the last one) and you can use
all 256 bytes of data to put a table into.

> Another idea hit me. Instead of having lines of RETLW to write a message
to
> the LCD, how about putting the whole ASCII table in the lookup table.
> Then with some sort of formula (or codes) make up a message. It would be
> easier to edit.

That's true, but text is not really something you can "calculate".

> Even better, no ASCII table, just work out the ASCII values as needed.
I've
> done this to display a counter, all I do is add 30H to my numbers and
send
> it to LCD (ones, tens, hunderds, etc.). But I've never tried it with
> Letters.

This works because there is a lineair link between the numbers 0 thru 9 an
the ASCII characters "0" thru "9"

> Any ideas?
>
> Quentin

Try something like this (an exerpt outof one of my own programs) :

   org 0x0000

  movlw  TextPage  ;Set Text-Page
  movlw  PCLATH   ;/

 call LCD_Init

   movlw  Txt_Hello
   call      LCD_WriteLine
  <Main program>

   org 0x03f0  ;I'm using a 16C84 and this is the last page

TextPage  equ high $

TXT_LCDInit  dt B'00101000'  ;4-bit interface
                   dt B'00000001'  ;Clear display & home cursor
                   dt B'00001110'  ;Display on, Cursor on, No blink
                   dt B'00000110'  ;Cursor auto advance, no display shift
                   dt 0x00            ;EOL

TXT_Hello  dt "Hello world :-)",0

(End of exerpt)

An example tells more than a thousand words ;-)

Greetz,
 Rudy Wieser

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...