Searching \ for 'look up tables??' 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 tables??'.

Truncated match.
PICList Thread
'look up tables??'
1999\02\23@200010 by Stewart Pye

flavicon
face
Hi All,

I know you can define bytes in rom using the db command, What is the best
way to access these???
( I'm lost without a data pointer!! )

Thanks,

Stewart Pye

1999\02\23@202536 by Regulus Berdin

picon face
Stewart Pye wrote:
> I know you can define bytes in rom using the db command, What is the best
> way to access these???
> ( I'm lost without a data pointer!! )

In a PIC architechture it is almost impossible.  The only way is to use
the RETLW command.

ex:
       addwf   PCL,f
       retlw   12              ;if w=0
       retlw   23              ;if w=1
       retlw   34              ;if w=2
       .
       .
       .

regards,
Reggie

--
e-mail: spam_OUTrberdinTakeThisOuTspambigfoot.com
ICQ#:   31651436
URL:    http://www.bigfoot.com/~rberdin

1999\02\23@231548 by Roy Tate

flavicon
face
Stewart Pye wrote:
>
> I know you can define bytes in rom using the db command,
> What is the best way to access these???
> ( I'm lost without a data pointer!! )

An easier way to implement lookup tables is in Microchip Application
Note 556.  The simplified version is copied below, but read the
App. Note for the full scoop.

== BEGIN CODE ==
 .
 movlw offset ;load offset in w reg
 call Table
 .
 .
 .
Table:
 addwf pcl ;add offset to pc to
           ;generate a computed goto
 retlw 'A' ;return the ASCII char A
 retlw 'B' ;return the ASCII char B
 retlw 'C' ;return the ASCII char C
 .
 .
== END CODE ==

Regards,

Roy Tate
.....roytateKILLspamspam@spam@ionet.net
http://www.ionet.net/~roytate

1999\02\24@153003 by Pedro Barrios

flavicon
face
I was wondering, for the case of the 16F84, how many characters can we put
in tables? Does this depend on the size of your program or is there space
reserved just for tables in the memory of the MCU?

Thanks,

PJB

At 10:15 PM 2/23/99 -0600, Roy Tate wrote:
{Quote hidden}

1999\02\25@020353 by w. v. ooijen / f. hanneman
picon face
> I was wondering, for the case of the 16F84, how many characters can we
put
> in tables? Does this depend on the size of your program or is there space
> reserved just for tables in the memory of the MCU?

No spare MCU space, unless you want to use the 64 bytes data eeprom.
Coding a table larger than 256 entries is more complex than smaller tables
(because you must essentially first brach ff to the correct table).
So the upper limit is the 1K code.
beyond that you must add e.g. an external serial eprom.

Wouter

1999\02\25@064641 by caisson

flavicon
face
> Van: Pedro Barrios <.....barriosKILLspamspam.....nanofab.physics.tamu.edu>
> Aan: EraseMEPICLISTspam_OUTspamTakeThisOuTMITVMA.MIT.EDU
> Onderwerp: Re: look up tables??
> Datum: woensdag 24 februari 1999 21:27
>
> I was wondering, for the case of the 16F84, how many characters can we
put
> in tables? Does this depend on the size of your program or is there space
> reserved just for tables in the memory of the MCU?

RETLW -instructions are plain old code.  When you stack them together you
cold refer to the group-of-RETLW's as a Table.  So, the answer is : It's
dependend on your (the PIC's :-) Code-size.

By the way : Don't forget to read the part about the Page-boundaries when
using the ADDWF PCL command to access your RETLW table.  And don't forget
the PCLATH for that matter :-)

Greetz,
 Rudy Wieser

1999\02\25@130334 by Pedro Barrios

flavicon
face
I was wondering if there is on the web any simple example, nothing fancy
please,
of how to store and read data from one of these microchip serial eeproms
using a 16F84.

Any help will be greatly appreciated.

Thanks,

PJB

At 07:55 AM 2/25/99 +0100, w. v. ooijen / f. hanneman wrote:
{Quote hidden}

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