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

PIC12 EEPROM & #Fuse

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



Joined: 15 Mar 2004
Posts: 33
Location: Swiss

View user's profile Send private message Visit poster's website ICQ Number

PIC12 EEPROM & #Fuse
PostPosted: Fri Aug 12, 2005 6:18 am     Reply with quote

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.
Ttelmah
Guest







PostPosted: Fri Aug 12, 2005 7:54 am     Reply with quote

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
Vovachess



Joined: 15 Mar 2004
Posts: 33
Location: Swiss

View user's profile Send private message Visit poster's website ICQ Number

PostPosted: Fri Aug 12, 2005 10:19 am     Reply with quote

Could you provide exmpls how to do it with EEPROM?
tnks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Aug 12, 2005 12:17 pm     Reply with quote

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);
}
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