View previous topic :: View next topic |
Author |
Message |
INT01
Joined: 21 Feb 2011 Posts: 5
|
Data EEPROM Initialization with #rom |
Posted: Mon Feb 21, 2011 10:19 am |
|
|
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
|
|
Posted: Mon Feb 21, 2011 11:12 am |
|
|
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
|
|
Posted: Mon Feb 21, 2011 11:47 am |
|
|
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
|
|
Posted: Mon Feb 21, 2011 12:51 pm |
|
|
What is your compiler version ? |
|
|
INT01
Joined: 21 Feb 2011 Posts: 5
|
|
Posted: Mon Feb 21, 2011 1:00 pm |
|
|
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
|
|
|
INT01
Joined: 21 Feb 2011 Posts: 5
|
|
Posted: Tue Feb 22, 2011 3:10 am |
|
|
Thanks. Solved.
#rom getenv("EEPROM_ADDRESS")={
Works fine. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19499
|
|
Posted: Tue Feb 22, 2011 3:20 am |
|
|
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
|
|
Posted: Tue Oct 08, 2019 9:14 am |
|
|
The Address EEPROM for PIC16F1937 Start in 0xF000 Address, You Can See This at: Tools/Device Editor/Memory/Data EE Start |
|
|
|