View previous topic :: View next topic |
Author |
Message |
ChrisL
Joined: 16 Apr 2007 Posts: 26 Location: Arizona
|
Use of FILL_ROM |
Posted: Mon Apr 16, 2007 2:16 pm |
|
|
Hello All,
This is our first post to the forum. Our company has started doing all of it's development using the CCS Compiler. Previously we used only assembler for our applications. I must say that the change was one of the best decisions we ever made...!
Our question centers around the use of FILL_ROM and what to fill it with. In all of our assembler based programs that used the watch-dog timer all un-filled locations in Flash Memory were filled with GOTO$. This statement was used because of it's ability to basically "lock" the processor cold until the WDT timed out if the code ran-away for any reason. We cannot determine how this would be done using FILL_ROM or if there is some directive in the CCS Compiler that would function the same way causing the processor to produce the same kind of "stop here forever" command. We looked at SLEEP, but the effect is not the same as the GOTO$. _________________ Thank you,
Chris |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Mon Apr 16, 2007 3:03 pm |
|
|
Am I right in assuming that GOTO$ has the effect of jumping to the same address again, so you are caught in a never ending loop?
What processor family are you using? On the PIC18 you could achieve a similar result with an RCALL -1, this either times out your watchdog or you will get a reset on stack overflow (when this feature is activated). |
|
|
ChrisL
Joined: 16 Apr 2007 Posts: 26 Location: Arizona
|
|
Posted: Mon Apr 16, 2007 3:05 pm |
|
|
We are using the PIC16F690 in the application.. Yes, the command was basically "Goto Me"... _________________ Thank you,
Chris |
|
|
kevcon
Joined: 21 Feb 2007 Posts: 142 Location: Michigan, USA
|
|
Posted: Tue Apr 17, 2007 7:04 am |
|
|
Something like this might do the trick, or point you in the right direction.
Code: |
#fill_rom 0 // 0 = NOP
void main( void )
{
while ( 1 );
}
#org 0xffe,0xfff //End of rom
void spin( void )
{
while( 1 );
}
|
|
|
|
|