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

Mysterious #ROM

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



Joined: 01 Nov 2007
Posts: 6

View user's profile Send private message

Mysterious #ROM
PostPosted: Tue Nov 06, 2007 2:34 pm     Reply with quote

Hi,

I have to write some values in EEPROM of a 18F4620 at programming time.

I use the code below:

Code:
#rom int8 0xF00020={0x41,0x64,0x43,0x64,0x4B,0x54,0x52,0x20,0x35,0x37,0x32,0x35,0x49,0x6E,0x69,0x74}


My software does not work correctly, so I have controled the EEPROM content with WinPic800 and the result is:



I have only one byte over two in the EEPROM !!! Shocked
The same think with IC-Prog.

Does anyone have an idea?

Thank's in advance for your help.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Nov 06, 2007 2:57 pm     Reply with quote

Compile a test program and look in the hex file.

Test program:
Code:

#include <18F4620.h>
#fuses XT,NOWDT,BROWNOUT,PUT,NOLVP
#use delay(clock=4000000) 

#rom int8 0xF00020={0x41,0x64,0x43,0x64,0x4B,0x54,0x52,0x20,0x35,0x37,0x32,0x35,0x49,0x6E,0x69,0x74}

//=======================================
void main()
{

while(1);
}


The eeprom data is in the Hex file:
Quote:
:020000040000FA
:1000000002EF00F0F86AD09EEA6AE96AC150C00BBC
:0C0010000F09C16E070EB46EFFD703008D
:0200000400F00A
:10002000416443644B54522035373235496E69740C
:020000040030CA
:0E00000000011E1E008381000FC00FE00F40A4
:00000001FF
;PIC18F4620


You didn't post your compiler version. This program was compiled with
PCH vs. 4.059.
jt06



Joined: 01 Nov 2007
Posts: 6

View user's profile Send private message

PostPosted: Tue Nov 06, 2007 3:20 pm     Reply with quote

Hi,

I have compiled the test program and the result is the same:

:020000040000FA
:1000000002EF00F0F86AD09EEA6AE96AC150C00BBC
:0C0010000F09C16E070EB46EFFD703008D
:0200000400F00A
:10002000416443644B54522035373235496E69740C
:020000040030CA
:0E00000000011E1E008381000FC00FE00F40A4
:00000001FF
;PIC18F4620

My compiler version is 4.049

Regards
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Nov 06, 2007 3:31 pm     Reply with quote

Try a different programmer software.
Ttelmah
Guest







PostPosted: Tue Nov 06, 2007 3:37 pm     Reply with quote

It looks like your programmer is handling this wrong then.
If you look at the two lines:

:0200000400F00A
:10002000416443644B54522035373235496E69740C

The first is an 'extended address'record, setting the offset to 0F000000, and the next loads 16 bytes, at 0020 from this point.

The compiler is generating the values correctly, but it looks as if your programmer is incorrectly handling this. I think it is getting confused by the fact that the EEPROM, like the main memory in the 18 series, is programmed in 16bit words, and is 'losing' the alternate bytes, and half the address offset.
You need to talk to the programmer manufacturers.

Best Wishes

Best Wishes
jt06



Joined: 01 Nov 2007
Posts: 6

View user's profile Send private message

PostPosted: Wed Nov 07, 2007 11:55 am     Reply with quote

You're right.

It was a problem with the configuration of WinPic800.
It's necessary to uncheck :

File .HEX -> Data 18Fxxx Address * 2

in the Software Settings.

Thank's a lot for your helps.

Best regards
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