Searching \ for 'Access a External Memory' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: massmind.org/techref/mems.htm?key=memory
Search entire site for: 'Access a External Memory'.

Truncated match.
PICList Thread
'Access a External Memory'
1997\10\08@190632 by WF AUTOMA‚̀O

flavicon
face
Hi,

       Did someone have experience how to write and read a information
at 8000H external position memory! Using the PIC17c42 assembly code?

       Miguel.

1997\10\08@211022 by Andrew Warren

face
flavicon
face
WF AUTOMA_AO <spam_OUTPICLISTTakeThisOuTspamMITVMA.MIT.EDU> wrote:

> Did someone have experience how to write and read a information at
> 8000H external position memory! Using the PIC17c42 assembly code?

mIGUEL:

To read the contents of address 8000H into registers HIBYTE and
LOBYTE:

   MOVLW   HIGH (08000H)   ;TBLPTR points to 08000H.
   MOVWF   TBLPTRH         ;
   MOVLW   LOW (08000H)    ;
   MOVWF   TBLPTRL         ;

   TABLRD  0,0,LOBYTE          ;Copy the 16-bit data from 08000H into the
                           ;table latch.

   TLRD    0,LOBYTE        ;Copy the low 8 bits from the table latch
                           ;into the "LOBYTE" register.

   TLRD    1,HIBYTE        ;Copy the high 8 bits from the table
                           ;latch into the "HIBYTE" register.

To write the contents of registers HIBYTE and LOBYTE to address
8000H:

   MOVLW   HIGH (08000H)   ;TBLPTR points to 08000H.
   MOVWF   TBLPTRH         ;
   MOVLW   LOW (08000H)    ;
   MOVWF   TBLPTRL         ;

   TLWT    0,LOBYTE        ;Copy the contents of the "LOBYTE"
                           ;register to the low 8 bits of the
                           ;table latch.

   TABLWT  1,0,HIBYTE      ;Copy the contents of the "HIBYTE"
                           ;register to the high 8 bits of the
                           ;table latch, then copy the contents
                           ;of the table latch to address 8000H.

You may want to look at Microchip's appnote AN548; it's probably on
the Microchip web site.

-Andy

=== Andrew Warren - .....fastfwdKILLspamspam@spam@ix.netcom.com
=== Fast Forward Engineering - Vista, California
=== http://www.geocities.com/SiliconValley/2499

1997\10\09@012046 by Mike Keitz

picon face
On Wed, 8 Oct 1997 21:04:28 -0700 WF AUTOMA=?iso-8859-1?Q?=C7=C3O ?=
<wfspamKILLspamAMBIENTE.COM.BR> writes:
>Hi,
>
>        Did someone have experience how to write and read a
>information
>at 8000H external position memory! Using the PIC17c42 assembly code?
>

The TABLPTR is 16-bits wide.  So write 80 to TBLPTRH and 00 to TBLPTRL.
Then execute a TABLRD instruction.  The trick here is that the data read
is not immediately passed to the file register of your choice.  It passes
through a (not mapped in data space) latch first.  (Though you can
specify a register to put data in with the TABLRD, the data returned is
that which was in the latch from last time.)  Use a TLRD to get the data
out of the latch.  Writing is the same way, put the data in the latch
first then TABLWR it to external memory.  Hopefully this clarifies what's
all explained in Microchip's data book a little.

>        Miguel.
>

1997\10\09@021514 by John Payson

picon face
> The TABLPTR is 16-bits wide.  So write 80 to TBLPTRH and 00 to TBLPTRL.
> Then execute a TABLRD instruction.  The trick here is that the data read
> is not immediately passed to the file register of your choice.  It passes
> through a (not mapped in data space) latch first.

What's the best way of doing a context save/restore if an ISR needs to use
TABLRD [in ROM-only systems] or else both TABLRD and TABLWT [in systems with
external RAM]?

According to what others have posted, the 17Cxx uses seperate latches for
the table-read and table-write instructions.  Does this mean that the only
way to put something into the table-read latches is to read it from memory?
If so, is there any good way to accomplish this other than [in a RAM-based
system] doing something like:

SAVE:
       save a copy of the current table pointer
       point to a spare spot in RAM
       save the contents of the table-read latches
       do a table-write (to record the contents of the write latches)

RESTORE:
       point to another spare spot in RAM
       put the saved table-read latch contents into the write latches
       do a table write, followed by a table read
       put the saved table-write latch contents into the write latches

That seems ickly.  Is there a better way?

1997\10\09@023257 by Andrew Warren
face
flavicon
face
John Payson <.....PICLISTKILLspamspam.....MITVMA.MIT.EDU> wrote:

> What's the best way of doing a context save/restore if an ISR needs
> to use TABLRD [in ROM-only systems] or else both TABLRD and TABLWT
> [in systems with external RAM]?

   John:

   TABLWT can also be used in systems with external FLASH or
   EEPROM, and even in systems with NO external memory at all,
   since the PIC17s can write to their own internal EPROM.

> According to what others have posted, the 17Cxx uses seperate
> latches for the table-read and table-write instructions.

   As far as I can tell, this is false.

{Quote hidden}

   Since there's only one latch, it shouldn't be QUITE that icky...
   But it still doesn't look easy.  I haven't yet needed to read
   from program-space memory in an interrupt routine, but I'm not
   looking forward to trying.

   -Andy

=== Andrew Warren - EraseMEfastfwdspam_OUTspamTakeThisOuTix.netcom.com
=== Fast Forward Engineering - Vista, California
=== http://www.geocities.com/SiliconValley/2499

1997\10\10@054027 by Frans Gunawan

flavicon
face
At 09:04 PM 10/8/97 -0700, you wrote:
>Hi,
>
>        Did someone have experience how to write and read a information
>at 8000H external position memory! Using the PIC17c42 assembly code?

yes, if you like 68hc11 instruction(macro), you can download the code from
my homepage.
I use that for accessing RAM, but for IO I've built IO extender (because
this chip is just too fast for peripheral). Don't forget to download
schematics.
goodluck
http://www.poboxes.com/f
f

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