![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
Vovachess
Joined: 15 Mar 2004 Posts: 33 Location: Swiss
|
PIC12 EEPROM & #Fuse |
Posted: Fri Aug 12, 2005 6:18 am |
|
|
Hello Evebody,
I have 3 Q to PIC12629:
1. I would like to save some data in EEPROM that it will be compiled in HEX file. For ex. in 16F876 you can do like
#rom 0x2100 = {0x55, 0xAA, 0x01, 0x23, 0x45, 0x67, 0x89}
It means that EEPROM is at 0x2100
What address of EEPROM has PIC12629?
2. In configuration bit of PIC12629 I have MASTER CLEAR ENABLE – internal & external.
If I use directive #fuses, how does this parameter look like? (for ex . XT, NOWDT, NOPROTECT..)
3. I use CCS compile with MPLAB. If I use directive #fuses, I get error from compiler: Unknown keyword in #FUSES
How can I include configuration bit in HEX file?
Thank you forwards. |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Fri Aug 12, 2005 7:54 am |
|
|
For the fuses, look at the include file for the chip.
At the top of this, is a list of all the fuses keywords. In your case, MCLR enables the master clear pin.
On these smaller chips, the EEPROM, is not mapped into the normal progam memory space. It is instead accessed by a seperate command. Some programmers will perform an automatic 'mapping', to allow the memory to be accessed at the same address as on the 16 chips, but this is a non standard 'extension'. Normally there is a seperate 'program EEPROM' command, and you just send the data for the EEPROM as a distinct block.
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
Vovachess
Joined: 15 Mar 2004 Posts: 33 Location: Swiss
|
|
Posted: Fri Aug 12, 2005 10:19 am |
|
|
Could you provide exmpls how to do it with EEPROM?
tnks |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Aug 12, 2005 12:17 pm |
|
|
Quote: | For ex. in 16F876 you can do like
#rom 0x2100 = {0x55, 0xAA, 0x01, 0x23, 0x45, 0x67, 0x89}
It means that EEPROM is at 0x2100
What address of EEPROM has PIC12629? |
The address is given in the Microchip Programming Specification for
the 12F629. To get that document, go here http://www.microchip.com
Then click on "Data Sheet Finder". Then pick 12F629.
Doing so will get you here:
http://www.microchip.com/stellent/idcplgidcplg?IdcService=SS_GET_PAGE&nodeId=1335&dDocName=en010113
Then scroll down and look on the right side for "Programming
Specification", and download that document.
Then search that document for the word "EEPROM". You will find
section 4.3.2 "Embedding Data EEprom Contents in Hex File".
It says the address is 0x2100.
You can do this same process to find the EEPROM address for any PIC
that has data eeprom.
To test this, compile the program below. Then use PicStart-Plus
or some other programmer to program the 12F629. Then shut down
MPLAB and re-start it (to prove that it's really been programmed).
Use PicStart-Plus to read the 12F629. Use the View menu to show
the EEPROM contents. Starting at address 0000, you will see
the following data. It's correct. It works.
Code: | 41 41 42 44 45 00 FF FF FF FF FF FF FF FF FF FF |
Code: | #include <12F629.h>
#fuses INTRC_IO,PUT,NOWDT,NOPROTECT,NOMCLR, NOBROWNOUT
#use delay(clock = 4000000)
#rom 0x2100 = {"ABCDE"}
void main()
{
while(1);
} |
|
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|