Searching \ for '[PIC]: filling unused program memory' 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=memory
Search entire site for: 'filling unused program memory'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: filling unused program memory'
2002\03\12@180835 by Terence Monteith

flavicon
face
I would like to fill in unused portions of the program memory with a
specific value (0x0000), but am unsure how this can be done without
tediously inserting the values manually or by using FILL directives
throughout the code.  Using a FILL directive at the very beginning of code
of course will give me overwrite errors when compiled.  Any suggestions?

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


2002\03\12@183205 by mike

flavicon
face
On Tue, 12 Mar 2002 16:55:29 -0600, you wrote:

>I would like to fill in unused portions of the program memory with a
>specific value (0x0000), why?

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


2002\03\12@190027 by Pendley, Michael

picon face
Using what assembler or compiler?

If you are using MPASM (and I am new to this so be gentile if I am
wrong)...how about the "fill" directive.

From the MPASM help file:  <label> fill <expr>, count

Generates <count> occurrences of the program word .... <expr>

If you used this after the last real instruction in your program then
<label> will have the value of the first location you want to zero.  The
last address depends on the processor type but is certainly known in
advance.  Call it lastProgramAddress.

I assume something like this would work

ZeroFill: fill 0,lastProgramAddress - ZeroFill + 1




-Mike



{Original Message removed}

2002\03\12@192431 by Sean Alcorn - Avion Sydney

flavicon
face
on 13/3/02 10:31 AM, Mike Harrison at mikespamKILLspamWHITEWING.CO.UK wrote:


>> I would like to fill in unused portions of the program memory with a
>> specific value (0x0000),
> why?

Probably because many text books have told him that he should.

That should spark a debate! :-)

Sean

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


2002\03\13@100056 by Terence Monteith

flavicon
face
Yes, I had thought of the FILL directive, but due to the nature of the code
(tables, code spread over 4 pages) I would need to put in quite a few.  I
was wondering if their was a more elegant way of doing this using MPASM.

I am implementing code to reprogram the microcontroller remotely, and I want
to generate a hex file that will set all unused program words to 0x0000.
This way I can determine if the code was loaded in the field (since the
unused portions contain 0x0000), or if it was loaded at the factory (where
unused portions will contain 0x3FFF).

{Original Message removed}

2002\03\13@102520 by Claudio Tagliola

flavicon
face
Can't you FILL the complete range as the first MPASM operator, and then
ORG back to the beginning?

{Original Message removed}

2002\03\13@102744 by Terence Monteith

flavicon
face
No, then I get overwrite errors.

-----Original Message-----
From: Claudio Tagliola [EraseMEcptagliolaspam_OUTspamTakeThisOuTCHELLO.NL]
Sent: March 13, 2002 9:23 AM
To: PICLISTspamspam_OUTMITVMA.MIT.EDU
Subject: Re: [PIC]: filling unused program memory


Can't you FILL the complete range as the first MPASM operator, and then
ORG back to the beginning?

-----Original Message-----
From: pic microcontroller discussion list
[@spam@PICLISTKILLspamspamMITVMA.MIT.EDU] On Behalf Of Terence Monteith
Sent: woensdag 13 maart 2002 15:57
To: KILLspamPICLISTKILLspamspamMITVMA.MIT.EDU
Subject: Re: [PIC]: filling unused program memory


Yes, I had thought of the FILL directive, but due to the nature of the
code (tables, code spread over 4 pages) I would need to put in quite a
few.  I was wondering if their was a more elegant way of doing this
using MPASM.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\03\13@102951 by Carlos Ojea

flavicon
face
>I am implementing code to reprogram the microcontroller remotely,

In the future (not far) I also will reprogram the pic remotely.
I though in somethig like send the new code via a telephone mobile module
and save it in an external eeprom. Then check if the code is ok and program
it in the pic (flash pic).
How is your idea?
Regards,
Carlos

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\03\13@103749 by Pic Dude

flavicon
face
Isn't this the purpose of erasing a chip before programming?  I'm new to
this PIC stuff still, but the Tait programmer I'm using seems to state
that using the erase command on the same command-line as dumping
the hex file to the PIC will erase the chip first and then drop on the
code whereever there is code.  All mem locations w/o code will not
be touched.

Cheers.


----- Original Message -----
From: "Terence Monteith" <RemoveMETerence.MonteithTakeThisOuTspamWAVECOM.CA>
To: <spamBeGonePICLISTspamBeGonespamMITVMA.MIT.EDU>
Sent: Wednesday, March 13, 2002 9:25 AM
Subject: Re: [PIC]: filling unused program memory


> No, then I get overwrite errors.
>
> {Original Message removed}

2002\03\13@104238 by Terence Monteith

flavicon
face
I cannot get into too much detail since ultimately this will end up in
someone else's product, but here is a brief explanation.  The unit itself is
connected to a headend via an RS485 connection, where the reprogramming is
controlled from.  On the uC is a modified version of a Microchip application
note (AN732).  In the microcontroller data is received, verified with a CRC,
and programmed 16 words at a time.  It is then reverified to make sure it
was programmed correctly, and then an ACK (or NACK if somewhere the process
failed) is sent back to the headend.  If an ACK is returned the next 16
words are sent, if a NACK is returned the 16 words that failed are re-sent.

{Original Message removed}

2002\03\13@104440 by Claudio Tagliola

flavicon
face
Can't you build a custom .HEX file modify program? It shouldn't be too
hard to make a program which replaces the 0x3FFF into 0x0000.

On another note: you wrote it's for determining a factory or a field
load. Do you have to have every 3FFF replaced by 0000? Can't you pick
ONE memory location and hardcode a pre-defined value there? You can make
it with MPASM using IFDEFs which trigger only for a factory build.

{Original Message removed}

2002\03\13@105535 by Terence Monteith

flavicon
face
>Can't you build a custom .HEX file modify program? It shouldn't be too
>hard to make a program which replaces the 0x3FFF into 0x0000.

I could but was hoping for an easier way.

>On another note: you wrote it's for determining a factory or a field
>load. Do you have to have every 3FFF replaced by 0000? Can't you pick
>ONE memory location and hardcode a pre-defined value there? You can make
>it with MPASM using IFDEFs which trigger only for a factory build.

I am thinking I might just have to do this.  Thanks for the help.

{Original Message removed}

2002\03\13@130836 by Olin Lathrop

face picon face
> Yes, I had thought of the FILL directive, but due to the nature of the
code
> (tables, code spread over 4 pages) I would need to put in quite a few.  I
> was wondering if their was a more elegant way of doing this using MPASM.

You could just post process the HEX file by inserting hard zeros for all
values that aren't explicitly specified.

> I am implementing code to reprogram the microcontroller remotely, and I
want
> to generate a hex file that will set all unused program words to 0x0000.
> This way I can determine if the code was loaded in the field (since the
> unused portions contain 0x0000), or if it was loaded at the factory (where
> unused portions will contain 0x3FFF).

How about a single ID or version word at a know location, like the last
location in memory.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, TakeThisOuTolinEraseMEspamspam_OUTembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\03\13@130847 by Olin Lathrop

face picon face
> Isn't this the purpose of erasing a chip before programming?  I'm new to
> this PIC stuff still, but the Tait programmer I'm using seems to state
> that using the erase command on the same command-line as dumping
> the hex file to the PIC will erase the chip first and then drop on the
> code whereever there is code.  All mem locations w/o code will not
> be touched.

He wants to set unused memory to 0 (although his reasons seem silly),
whereas "erase" implies setting it to all 1s.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, RemoveMEolinspamTakeThisOuTembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\03\13@134928 by Pic Dude

flavicon
face
"whereas "erase" implies setting it to all 1s".

Ahhh.....never knew that.  Always assumed it was zero.  Thanks!

Didn't pay attention to the start of this thread.  Should i ask about
the reason....???


{Original Message removed}

2002\03\14@195641 by parkiss

picon face
Recognizing that the original question referred to an MPASM
solution, an alternate approach would be an offline program to
manipulate the .hex file so that zeroes are written to all addresses
not otherwise filled.  Would take a few hours to write and test the
program, but may save time in the long run once the capability
exists.

Regards,

Steve

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


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