CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

filling unused program space

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
koulbassa
Guest







filling unused program space
PostPosted: Fri Mar 14, 2003 4:08 pm     Reply with quote

Certain auto makers specify that unused program space be filled with commands that produce a graceful exit should the program counter go off in the weeds. Using the microchip assember, the fill command makes this easy. Unfortunately, CCS won't accept the following:

#asm
fill(GOTO 0x1FF), 0x7F
#endasm

The closest I can get to what I want is using the #ROM command, however I must still manually type in every entry in the command list:

#ROM 0x151, {0xBFF, 0xBFF, 0xBFF, etc., etc.)

Is there an easier way of doing this?
___________________________
This message was ported from CCS's old forum
Original Post ID: 12688
Tomi
Guest







Re: filling unused program space
PostPosted: Sat Mar 15, 2003 2:33 am     Reply with quote

If you are familiar to PC programming then you can write a small program to insert the requested data into the HEX file.

Example:
:100D700083168E1483124B21942064003A083902A2
:100D80000319C72EDD217808B700E32B4B21321958
:060D90005E2EBC2E630084 // last line of code
// insert your lines containing 0xBFF
:02400E00050D9E // config word (fuses)
:084000000100000000000000B7 // ID locations
:1042000008001000200028003000600000000000BE // data eeprom
:10421000000000000000000000000000000000009E
:10422000000005000500060005000500050003006C
:1042300003000900050005000B000900050005004A
:104240000500050005000500050005000500050046
:104250000500050005000500050005000500050036
:00000001FF
;PIC16F877


:=Certain auto makers specify that unused program space be filled with commands that produce a graceful exit should the program counter go off in the weeds. Using the microchip assember, the fill command makes this easy. Unfortunately, CCS won't accept the following:
:=
:=#asm
:=fill(GOTO 0x1FF), 0x7F
:=#endasm
:=
:=The closest I can get to what I want is using the #ROM command, however I must still manually type in every entry in the command list:
:=
:=#ROM 0x151, {0xBFF, 0xBFF, 0xBFF, etc., etc.)
:=
:=Is there an easier way of doing this?
___________________________
This message was ported from CCS's old forum
Original Post ID: 12701
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: filling unused program space
PostPosted: Mon Mar 17, 2003 5:35 pm     Reply with quote

:=Certain auto makers specify that unused program space be filled with commands that produce a graceful exit should the program counter go off in the weeds. Using the microchip assember, the fill command makes this easy. Unfortunately, CCS won't accept the following:
:=
:=#asm
:=fill(GOTO 0x1FF), 0x7F
:=#endasm
:=
:=The closest I can get to what I want is using the #ROM command, however I must still manually type in every entry in the command list:
:=
:=#ROM 0x151, {0xBFF, 0xBFF, 0xBFF, etc., etc.)
:=
:=Is there an easier way of doing this?
-------------------------------------------

It's possible that you could do it in MPLAB, if that's
an acceptable method. Maybe they require that the filling
is done in the source code ?

I have MPLAB 5.7.40, and if I click on the Window menu,
and then click on Modify, and get a small dialog box.
Then I can enter the Start and End address, and the Fill
value (in hex), and it fills the program memory.

I can't find this feature in MPLAB 6.13, unless it's
hidden somewhere in the menu system.
___________________________
This message was ported from CCS's old forum
Original Post ID: 12778
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group