Searching \ for 'Novice Code and Data Addressing ?' 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=data
Search entire site for: 'Novice Code and Data Addressing ?'.

Truncated match.
PICList Thread
'Novice Code and Data Addressing ?'
1997\02\08@222508 by Bob Segrest

picon face
Greetings,

I am working on a micro controller project using the PIC16C84 chip.

I am confused about one point and am hoping someone can offer a bit of
clarification....

How do you differentiate between the location of a variable (temporary
read/write storage) program memory (executable code) ???

Back in the days when we were using separate CPU, RAM and EPROM chips it
was easy to figure out what was where in the memory map.  After reading
through the PIC16C84 documentation, I am not sure where the registers,
general purpose registers and program memory start and stop.  Is there a
white paper somewhere on the Internet that might make this more clear ???

If this question is discussed in a FAQ somewhere, I would appreciate a
pointer...

Bob Segrest

1997\02\08@230050 by Clyde Smith-Stubbs

flavicon
face
Thus spake Bob Segrest (spam_OUTbobslanTakeThisOuTspamEROLS.COM):

> How do you differentiate between the location of a variable (temporary
> read/write storage) program memory (executable code) ???

RAM and ROM are in separate address spaces - on the 12 and 14 bit PICs
there is no way to read code address space. In the memory map the
address for code and data overlap - they both start from zero. the
16 bit PICs (17Cxx) have instructions to read from program memory,
but you can only do so with these special instructions. This is a
typical Harvard architecture, same as the 8051, as opposed to a Von
Neumann architecture, where code and data are in the same address space,
like a Z80 or 68xx.

--
Clyde Smith-Stubbs    | HI-TECH Software,       | Voice: +61 7 3354 2411
.....clydeKILLspamspam@spam@htsoft.com      | P.O. Box 103, Alderley, | Fax:   +61 7 3354 2422
http://www.htsoft.com | QLD, 4051, AUSTRALIA.   |
---------------------------------------------------------------------------
Download a FREE beta version of our new ANSI C compiler for the PIC
microcontroller! Point your WWW browser at http://www.htsoft.com/

1997\02\08@231741 by Bob Segrest

picon face
Thanks for the quick response... ;^)

OK, this makes sense....

When I use the MPASM assembler, how do I declare/allocate RAM storage ???

If I want to use three single byte variables, is this the right way to do it ?

        ORG  0000
 Temp1  DB         ; first storage location
 Temp2  DB         ; second storage location
 Temp3  DB         ; third storage location

Bob Segrest

At 01:58 PM 2/9/97 +1000, you wrote:
{Quote hidden}

1997\02\08@233851 by Clyde Smith-Stubbs

flavicon
face
Thus spake Bob Segrest (EraseMEbobslanspam_OUTspamTakeThisOuTEROLS.COM):

> When I use the MPASM assembler, how do I declare/allocate RAM storage ???

I'm not the best person to ask about this, since I don't use the
MPASM assembler. But I have seen other people do this:

ScratchPadRam   equ     0x20
AA      equ     ScratchPadRam+0
BB      equ     ScratchPadRam+1
CC      equ     ScratchPadRam+2

Note that the addressable RAM does NOT start from 0 - the registers like
the timer, indirect register etc. are located in low memory. Check the memory
map in the data sheet (it's on the web at http://www.microchip.com if you don't
have it).

Clyde

--
Clyde Smith-Stubbs    | HI-TECH Software,       | Voice: +61 7 3354 2411
clydespamspam_OUThtsoft.com      | P.O. Box 103, Alderley, | Fax:   +61 7 3354 2422
http://www.htsoft.com | QLD, 4051, AUSTRALIA.   |
---------------------------------------------------------------------------
Download a FREE beta version of our new ANSI C compiler for the PIC
microcontroller! Point your WWW browser at http://www.htsoft.com/

1997\02\08@235344 by Bob Segrest

picon face
Thanks Clyde,

I think you have given me what I need...

Bob Segrest

At 02:36 PM 2/9/97 +1000, you wrote:
{Quote hidden}

1997\02\09@115115 by Tony Matthews

flavicon
face
Bob Segrest wrote:
{Quote hidden}

The general purpose registers start at 0x0C on the 16c84.Download the
data sheets from the microsheet web site for remaining Special function
register addresses There are 36 consecutive words of gpr.Tony M.

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