Searching \ for '[PIC]: help with large table' 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/microchip/memory.htm?key=table
Search entire site for: 'help with large table'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: help with large table'
2001\12\21@024451 by Roman Black

flavicon
face
Hi guys, i'm doing some more work on the PIC
sound software, i'd like to make it so it will
generate complete .asm code to play the sound back,
not just the retlw table.

I need some code for a neat large table reader,
which just gets one data byte and incs the 16bit
pointer. The table is formatted in a continuous
string of retlw instructions, and the first byte
of the table can be anywhere in memory.
* 16bit address of table first byte
* 16bit address of table last byte
(table can be any length up to 8k)

Can anyone help with code to do this? Especially
code that will suit 12 core and 14 core PICs,
so min stack use.
Thanks! :o)
-Roman

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body


2001\12\21@155412 by Fabio Pereira

flavicon
face
> I need some code for a neat large table reader,
> which just gets one data byte and incs the 16bit
> pointer. The table is formatted in a continuous
> string of retlw instructions, and the first byte
> of the table can be anywhere in memory.
> * 16bit address of table first byte
> * 16bit address of table last byte
> (table can be any length up to 8k)
>
> Can anyone help with code to do this? Especially
> code that will suit 12 core and 14 core PICs,
> so min stack use.
> Thanks! :o)
> -Roman

Roman:

I don't think the PIC12 series (well, at least the 12 bit core ones) will
support the RETLW instruction ....

Fabio

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam@spam@mitvma.mit.edu with SET PICList DIGEST in the body


2001\12\21@163320 by uter van ooijen & floortje hanneman

picon face
>  I don't think the PIC12 series (well, at least the 12 bit core ones) will
> support the RETLW instruction ....

They do, in fact they don't support the RET instruction...

Wouter van Ooijen

Van Ooijen Technische Informatica: http://www.voti.nl
Jal compiler for PIC uC's:  http://www.voti.nl/jal
PICs kopen? http://www.voti.nl/shop

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body


2001\12\21@163937 by Martin Peach

flavicon
face
----- Original Message -----
From: "Fabio Pereira" <.....fabioKILLspamspam.....PP.ADV.BR>
To: <EraseMEPICLISTspam_OUTspamTakeThisOuTMITVMA.MIT.EDU>
Sent: Friday, December 21, 2001 3:44 PM
Subject: Re: [PIC]: help with large table


{Quote hidden}

They do have RETLW but the problem is with the CALL instruction that only
uses address bits 10-9 and 7-0, so half the memory is inaccessible to a
CALL.

/\/\/\/*=Martin

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body


2001\12\21@164903 by Don Hyde

flavicon
face
indexlsb        equ     0x80
indexmsb        equ     0x81            ;table index is here
temp            equ     0x82

lookup:
       movlw   low table
       addwf   indexlsb,w
       movwf   temp
       movfw   indexmsb
       skpnc
       incf    indexmsb,w
       addlw   high table
       movwf   PCLATH
       movfw   temp
       movwf   FSR

table   retlw   1
       retlw   2
       ...


> {Original Message removed}

2001\12\21@191025 by Scott Dattalo

face
flavicon
face
On Fri, 21 Dec 2001, Don Hyde wrote:

> indexlsb        equ     0x80
> indexmsb        equ     0x81            ;table index is here
> temp            equ     0x82
>
> lookup:
>         movlw   low table
>         addwf   indexlsb,w
>         movwf   temp
>         movfw   indexmsb
>         skpnc
>         incf    indexmsb,w
>         addlw   high table
>         movwf   PCLATH
>         movfw   temp
>         movwf   FSR
>
> table   retlw   1
>         retlw   2
>         ...

Why not save a couple instructions:

    movlw   HIGH(table)
    addwf   indexmsb,w
    movwf   PCLATH
    movlw   LOW(table)
    addwf   indexlsb,w
    skpnc
     incf   PCLATH,F
    movwf   PCL

But the table probably is accessed sequentially:

    incf    PCLATH,F
    incfsz  index,w
    decf    PCLATH,F
    movwf   index
    movwf   PCL

But even better IMO, is to use the 16F877 or similar flash device and
store the table directly in ROM. One word holds 14-bits, 9 words hold 16
bytes. Also, since this is a bit stream, you really don't have to worry
about artificial byte boundaries.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email @spam@listservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body


2001\12\21@205535 by Bob Ammerman

picon face
Actually, the 12C supports RETLW, but not RETURN.

Bob Ammerman
RAm Systems

----- Original Message -----
From: "Fabio Pereira" <KILLspamfabioKILLspamspamPP.ADV.BR>
To: <RemoveMEPICLISTTakeThisOuTspamMITVMA.MIT.EDU>
Sent: Friday, December 21, 2001 12:44 PM
Subject: Re: [PIC]: help with large table


{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email TakeThisOuTlistservEraseMEspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body


2001\12\22@011105 by Roman Black

flavicon
face
Martin Peach wrote:

{Quote hidden}

Thanks Martin, you're correct. The table probably
won't be worth doing on a 12 core PIC, so I will
just code it for the 14 core parts.

I got the table read code working ok, I found you
don't have to call the table if you prime the
stack with your return address, so I can place the
sound data table starting anywhere and finishing
anywhere in program memory, which suited the app
perfectly.

It will play the sound from start to finish at any
length up to 8kbyte (64kbits), or the table can
contain a number of sounds and as long as start and
end pointers are known for each sound the PIC can
play each sound separately. Perfect for talking PIC
products, or sound on buttonpress.

I was hoping someone would have some input re what
things they want added to my PIC sound encoder
software, *free sound software* here:
http://centauri.ezy.net.au/~fastvid/picsound.htm

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestspamTakeThisOuTmitvma.mit.edu


2001\12\22@011859 by Roman Black

flavicon
face
Scott Dattalo wrote:
{Quote hidden}

Thanks for the input Don and Scott re the table!
That last idea is very nice Scott, thanks, I will
definitely implement that. Since the encoder
software outputs the sound wave data in .asm format
how would I go about using all 14 bits?

And any suggestions for reading bits squentially
from the program memory?? :o)
-Roman

PS. I have a couple of nice compression systems
also under test, they will go well with a 7bit
data unit size.

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestEraseMEspam.....mitvma.mit.edu


2001\12\22@144202 by Dwayne Reid

flavicon
face
I think you can avoid the use of TEMP:

indexlsb        equ     0x80
indexmsb        equ     0x81            ;table index is here
temp            equ     0x82

lookup:
        movfw   indexmsb
        addlw   high (table)            ;don't need if table starts in
first segment
        movwf   PCLATH

        movlw   low (table)
        addwf   indexlsb,w
        skpnc
          incf   PCLATH,F
        movwf   PCL

table   retlw   1
        retlw   2
        ...

2 cycles shorter / faster.

dwayne


At 03:46 PM 12/21/01 -0600, Don Hyde wrote:
{Quote hidden}

> > {Original Message removed}

2001\12\22@164717 by Alexandre Domingos F. Souza

flavicon
face
> I don't think the PIC12 series (well, at least the 12 bit core ones) will
>support the RETLW instruction ....

       Fabio, Pic12 does not support RETURN instructions, instead you use RETLW...


---8<---Corte aqui---8<----

Alexandre Souza
EraseMEtaitospamterra.com.br
http://planeta.terra.com.br/lazer/pinball/

---8<---Corte aqui---8<----

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestEraseMEspamEraseMEmitvma.mit.edu


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