Searching \ for '[PIC] creating buildable 18F452 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/microchip/memory.htm?key=table
Search entire site for: 'creating buildable 18F452 tables'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] creating buildable 18F452 tables'
2005\05\05@164402 by Rob Robson

flavicon
face
I'm moving existing 16F877 code to the 18F452 and want to use tables for the first time.  How do I create these permanent tables in program memory so that MPLAB won't flag them as syntax errors when I go to build the project?

Many thanks,
Rob

2005\05\05@181330 by Jan-Erik Soderholm

face picon face
Rob Robson wrote :

> I'm moving existing 16F877 code to the 18F452 and want to use
> tables for the first time.  How do I create these permanent
> tables in program memory so that MPLAB won't flag them as
> syntax errors when I go to build the project?

Show an example of the "syntax error".

Jan-Erik.



2005\05\05@181508 by Jinx

face picon face

> How do I create these permanent tables in program memory so
> that MPLAB won't flag them as syntax errors when I go to build
> the project?

To store aa bb cc dd ee ff

 data 0xbbaa,0xddcc,0xffee etc   ;note indent and "swapped" values

2005\05\05@183816 by Rob Robson

flavicon
face
AHA!!!  Many thanks!

RR

----- Original Message -----
From: "Jinx" <spam_OUTjoecolquittTakeThisOuTspamclear.net.nz>
To: "Microcontroller discussion list - Public." <.....piclistKILLspamspam@spam@mit.edu>
Sent: Thursday, May 05, 2005 3:15 PM
Subject: Re: [PIC] creating buildable 18F452 tables


>
>> How do I create these permanent tables in program memory so
>> that MPLAB won't flag them as syntax errors when I go to build
>> the project?
>
> To store aa bb cc dd ee ff
>
>  data 0xbbaa,0xddcc,0xffee etc   ;note indent and "swapped" values
>
> --

2005\05\05@184003 by olin_piclist

face picon face
Rob Robson wrote:
> I'm moving existing 16F877 code to the 18F452 and want to use tables
> for the first time.  How do I create these permanent tables in
> program memory so that MPLAB won't flag them as syntax errors when I
> go to build the project?

With the DATA assembler directive and its various related directives.

*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

2005\05\05@184013 by Jinx

face picon face
> To store aa bb cc dd ee ff
>
>   data 0xbbaa,0xddcc,0xffee etc   ;note indent and "swapped" values

Forget what I just said. Was thinking of something completely
different

org 1000

data 0x1122,0x3344,0x5566 ;will result in

1000  1122 3344 5566

org 1000

data "ABCD",0x1122,0xff ;will result in

1000   4241 4443 1122 3344 00FF



2005\05\05@193954 by olin_piclist

face picon face
Jinx wrote:
> To store aa bb cc dd ee ff
>
>  data 0xbbaa,0xddcc,0xffee etc   ;note indent and "swapped" values

Or use the DB directive with bytes in the order you want.

*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

2005\05\05@194304 by olin_piclist

face picon face
Jinx wrote:
>> To store aa bb cc dd ee ff
>>
>>   data 0xbbaa,0xddcc,0xffee etc   ;note indent and "swapped" values
>
> Forget what I just said. Was thinking of something completely
> different
>
> org 1000
>
> data 0x1122,0x3344,0x5566 ;will result in
>
> 1000  1122 3344 5566

You were right the first time if you want the byte 11h, 22h, 33h, etc to end
up in memory in that order.  The PIC 18 addresses bytes of program memory,
with the lower address being the least significant byte of each program
memory word.  In your example above, the first word will indeed hold 1122h,
but when addressed as bytes will contin 22h 11h in that order.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

2005\05\05@202434 by Jinx

face picon face
> You were right the first time if you want the byte 11h, 22h, 33h, etc
> to end up in memory in that order.  The PIC 18 addresses bytes of
> program memory, with the lower address being the least significant
> byte of each program memory word.  In your example above, the
> first word will indeed hold 1122h, but when addressed as bytes will
> contain 22h 11h in that order

Yes, shouldn't have been so succint in my first answer and added an
explanation. My first run-in with 18F tables was a byte-order disaster
of AT commands that was a mix of "text" and 0x0a and 0x0d bytes

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