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

Data EEPROM Initialization with #rom

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



Joined: 21 Feb 2011
Posts: 5

View user's profile Send private message

Data EEPROM Initialization with #rom
PostPosted: Mon Feb 21, 2011 10:19 am     Reply with quote

In the PIC16F886 to initialize the ROM (Flash EEPROM) I use:

#rom 0x2100={0xD0} ---> OK

In the PIC16F1937 I can't initialize the ROM using the #ROM command .

#rom 0x1E000={0xD0} ---> DON´T WORK

I know the address to use is 0x1E000, but can I do it? In the datasheet we can read:

7.3 Data EEPROM
The programmer should be able to read data memory information from a hex file and write data memory contents to a hex file. The physical address range of the 256 data memory is 0000h-00FFh. However, these addresses are logically mapped to address 1E000h-1E1FFh in the hex file.This provides a way of differentiating between the data and program memory locations in this range. The format for data memory storage is one data byte per address location, LSB aligned.


Any ideas? Another way to do this?

Thanks.
Ttelmah



Joined: 11 Mar 2010
Posts: 19499

View user's profile Send private message

PostPosted: Mon Feb 21, 2011 11:12 am     Reply with quote

This is down to your programmer.

0x1E000, is the correct address. What programmer are you using to write the chip?. It does work with a PICKIT3.

Best Wishes
INT01



Joined: 21 Feb 2011
Posts: 5

View user's profile Send private message

PostPosted: Mon Feb 21, 2011 11:47 am     Reply with quote

Thanks for your fast reply Ttelmah:

I'm using PICKIT3.

If I wrote:
Code:
#rom  0x1E000={0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x76}


I find in the .hex file:
:10C000007700770077007700770077007700770078
:0EC010007700770077007700770077007600E2

This is not correct. The 00C0 program position not is 1E000

When you write in eeprom in the .hex file you get something like this:
:10E000007700770077007700770077007700770058
:10E010007700770077007700770077007700770048

How I can get this with CCS compiler for this PIC?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Feb 21, 2011 12:51 pm     Reply with quote

What is your compiler version ?
INT01



Joined: 21 Feb 2011
Posts: 5

View user's profile Send private message

PostPosted: Mon Feb 21, 2011 1:00 pm     Reply with quote

PCM programmer wrote:
What is your compiler version ?


I´m trying in 4.114 version. Is a problem with the version? The last version goes fine with this?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Feb 21, 2011 1:22 pm     Reply with quote

Read this thread. It has the answer:
http://www.ccsinfo.com/forum/viewtopic.php?t=42386
INT01



Joined: 21 Feb 2011
Posts: 5

View user's profile Send private message

PostPosted: Tue Feb 22, 2011 3:10 am     Reply with quote

PCM programmer wrote:
Read this thread. It has the answer:
http://www.ccsinfo.com/forum/viewtopic.php?t=42386



Thanks. Solved.

#rom getenv("EEPROM_ADDRESS")={

Works fine.
Ttelmah



Joined: 11 Mar 2010
Posts: 19499

View user's profile Send private message

PostPosted: Tue Feb 22, 2011 3:20 am     Reply with quote

Aargh.
Yes.
I was using the 'getenv' - tend to always use this now, and the hex file, showed the data at 0x1E000, forgot about the 'word versus byte' addressing issue, which is what is causing this. #ROM uses a word address value, while 1E000, is a byte address.

Best Wishes
xtremeroboz



Joined: 15 Mar 2019
Posts: 2

View user's profile Send private message

PostPosted: Tue Oct 08, 2019 9:14 am     Reply with quote

The Address EEPROM for PIC16F1937 Start in 0xF000 Address, You Can See This at: Tools/Device Editor/Memory/Data EE Start
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