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

Problem using function write_eeprom() in 18F97J60 *** Locked

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
orazio



Joined: 03 Sep 2010
Posts: 27

View user's profile Send private message

Problem using function write_eeprom() in 18F97J60 *** Locked
PostPosted: Thu May 24, 2012 9:30 am     Reply with quote

Excuse me, I'm using CCS 4.084 compiler and PIC 18F97J60.
I want write to eprom using function write_eprom().
When i try to compile i have following error:
Undefined identifier -- write_eeprom

could anyone say to me if PIC 18F97J60 have eprom and why doesn't support write_eprom() function?

When i use CCS 4.084 compiler and PIC 18F8723, write_eprom() function is compiled correctly.

thanks in advance
RF_Developer



Joined: 07 Feb 2011
Posts: 839

View user's profile Send private message

Re: Problem using function write_eeprom() in PIC18F97J60
PostPosted: Thu May 24, 2012 9:47 am     Reply with quote

orazio wrote:
Excuse me, I'm using CCS 4.084 compiler and PIC 18F97J60.
I want write to eprom using function write_eprom().
When i try to compile i have following error:
Undefined identifier -- write_eeprom

could anyone say to me if PIC 18F97J60 have eprom and why doesn't support write_eprom() function?

When i use CCS 4.084 compiler and PIC 18F8723, write_eprom() function is compiled correctly.

thanks in advance


The 18F97J60 does NOT have eeprom. Possibly as it has Network interface these PICs usually have to have an external eeprom (SPI or I2C) to hold webpages and configurations.

You also seem to be confused, it's write_eeprom(), not write_eprom().

RF Developer
orazio



Joined: 03 Sep 2010
Posts: 27

View user's profile Send private message

PostPosted: Thu May 24, 2012 10:53 am     Reply with quote

OK RF_developer thank you for the clarification.

Another question.
Suppose that i install bootloader in a PIC18 with eproom.
Suppose that on power-on, i enter in bootloader section and i install via RS232 myapp.hex. After installation, the PIC reset and start with myapp.he.
Suppose that myapp.hex save data in eprom.
If i re-install myapp.hex using bootloader, after installation and PIC reset do i lose my data saved in eprom?
Or they remain saved in eprom?

Thanks in advance.
orazio



Joined: 03 Sep 2010
Posts: 27

View user's profile Send private message

Re: Problem using function write_eeprom() in PIC18F97J60
PostPosted: Thu May 24, 2012 2:39 pm     Reply with quote

Hey Forum Moderator non ti incazzare.
Don't worry. Stay well!!!
Ok i spell eeprom. Ary you happy now?
Do not make me lose time and let me talk to the people's forum.



People's forum, exucuse me, i'd like to know information about BOOTLOADER IN PIC18 with eeprom and mantaining data in EEPROM when i re-install myapp.hex using bootloader.

Suppose that i install bootloader in a chip PIC18 with eeproom.
Suppose that on power-on, i enter in bootloader section and i install via RS232 myapp.hex. After installation, the PIC reset and start with myapp.hex.
Suppose that myapp.hex save data in eprom.
If i re-install myapp.hex using bootloader, after installation and PIC reset do i lose my data saved in eprom?
Or the data remain saved in eprom?

Thanks in advance.
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Thu May 24, 2012 4:07 pm     Reply with quote

Hi,

I've never seen EEPROM spelled so many (incorrect) ways in one thread!

John
orazio



Joined: 03 Sep 2010
Posts: 27

View user's profile Send private message

Re: Problem using function write_eeprom() in PIC18F97J60
PostPosted: Fri May 25, 2012 12:53 am     Reply with quote

oh!!! maremma bucaiola!!!!

Do you like now, Johnny?

People's forum, excuse me, I'd like to know information about BOOTLOADER IN PIC18 with eeprom and maintaining data in EEPROM when i re-install myapp.hex using bootloader.

Suppose that i install bootloader in a chip PIC18 with eeproom.
Suppose that on power-on, i enter in bootloader section and i install via RS232 myapp.hex. After installation, the PIC reset and start with myapp.hex.
Suppose that myapp.hex save data in eeprom.
If i re-install myapp.hex using bootloader, after installation and PIC reset do i lose my data saved in eeprom?
Or the data remain saved in eeprom?

John, avoids the comments and answer the question, please.
RF_Developer



Joined: 07 Feb 2011
Posts: 839

View user's profile Send private message

Re: Problem using function write_eeprom() in PIC18F97J60
PostPosted: Fri May 25, 2012 1:55 am     Reply with quote

orazio wrote:
oh!!! maremma bucaiola!!!!

Do you like now, Johnny?

People's forum, excuse me, I'd like to know information about BOOTLOADER IN PIC18 with eeprom and maintaining data in EEPROM when i re-install myapp.hex using bootloader.

Suppose that i install bootloader in a chip PIC18 with eeproom.
Suppose that on power-on, i enter in bootloader section and i install via RS232 myapp.hex. After installation, the PIC reset and start with myapp.hex.
Suppose that myapp.hex save data in eeprom.
If i re-install myapp.hex using bootloader, after installation and PIC reset do i lose my data saved in eeprom?
Or the data remain saved in eeprom?

John, avoids the comments and answer the question, please.


The PIC18F97J60 has flash program memory that can be loaded by a bootloader. Yes, that is a type of "eeprom", but the PIC18F97J60 does not have the seperate data eeprom that many other PICs have.

To write to program flash you need write_program_memory(), not write_eeprom() which writes to the data eeprom in PICs that have have it. PIC18F97J60 does NOT have the data eeprom, so write_eeprom() doesn't work.

It is possible to store "data" in program flash in a limited way (I use it to store a diagnostic data dump on system failure), but its main use is of course for storing code.

RF Developer
Ttelmah



Joined: 11 Mar 2010
Posts: 19538

View user's profile Send private message

PostPosted: Fri May 25, 2012 2:17 am     Reply with quote

Take a breath. Smile

An EEPROM, is a type of EPROM or PROM.....
All are 'programmable read only memories', but the former is electrically erasable, while the second is erasable without telling you how it is done (typically UV).

Now, ignoring the spelling problems, let's step into the rest of the question.

EEPROM, as a term, is normally used in the PIC to refer to an area of electrically erasable memory, supporting single byte erase/write, with a large write life, designed for storing things like configuration information.
There has become an 'industry standard' in this regard to reserve the term EEPROM, for memory that is _byte_ erasable.

This is 'distinct' from the main 'program memory', which is also technically a type of EEPROM (aargh), called 'Flash', for which the erase cycle, has to be done 'page at a time'. To distinguish this, it is commonly referred to just using the word 'flash', and omitting the EEPROM, to make this page access form obvious. The advantage of this memory form, is it reduces the number of transistors needed, making larger memories at lower costs possible. Only one erase transistor is needed for each whole 'page', instead of having one for every cell.

Now, using the term EEPROM, to specifically refer to byte erasable forms:

The PIC 18F97J60, _does not have EEPROM_ in the chip.
It has flash memory only.

You can add an external EEPROM, like a 2464, and use the supplied drivers, and read/write_ext_eeprom functions to access this.

You cannot write a bootloader 'into' a chip, using an external EEPROM (without adding an external processor to do this) - (slightly 'qualify' this, since on the 100pin devices from this family, a _byte_ accessible external memory could be mapped to be the bootable device using extended micro controller mode, with address shifting, and then with care, could be written to reprogram itself, but this is getting very complex....).

However a bootloader already written into a chip, _can_ be written to program the rest of the chip from the contents of an external EEPROM.
By ensuring the bootloader is not overwritten (this is the 'point' of the bootloader),

Reading and writing the EEPROM are separate functions, so whether you destroy it's contents, are up to you.

Best Wishes
orazio



Joined: 03 Sep 2010
Posts: 27

View user's profile Send private message

Re: Problem using function write_eeprom() in PIC18F97J60
PostPosted: Fri May 25, 2012 4:09 am     Reply with quote

Forget the PIC18F97J60. Now i'm using PIC18F8723 with CCS 4.084.
PIC18F8723 have an eeprom, and in myapp.hex i use it to store configutation data using write_eeprom() function.
In PIC18F8723 i want use eeprom only for storing things like configuration information.

Now i want add to the possibility of being able to download via RS-232 new firmware in my chip, using bootloader concept, but without losing configuration data when i re-install myapp.hex.
Is it possible?
Or when i re-install myapp.hex, via RS-232 using bootloader, i lose configuration data previously saved on eeprom?

This is my question: I want to know if i lose data saved in eeprom after a re-installation firmware by bootloader.
Is it clear the question?

thanks in advance
Ttelmah



Joined: 11 Mar 2010
Posts: 19538

View user's profile Send private message

PostPosted: Fri May 25, 2012 4:19 am     Reply with quote

No.
The bootloader only overwrites what it is told to overwrite. If your file contains data for the EEPROM, then this will be overwritten, but if it doesn't, then it won't.

Best Wishes
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Fri May 25, 2012 4:12 pm     Reply with quote

Quote:
Hey Forum Moderator non ti incazzare.
Don't worry. Stay well!!!
Ok i spell eeprom. Ary you happy now?
Do not make me lose time and let me talk to the people's forum.

No. When you spell incorrectly you often change the meaning.

Then you are wasting time for ALL of us, including yourself.

Mike
orazio



Joined: 03 Sep 2010
Posts: 27

View user's profile Send private message

PostPosted: Tue May 29, 2012 2:37 pm     Reply with quote

Eh.... basta!!!!!

Mike Walne wrote:

No. When you spell incorrectly you often change the meaning.

Then you are wasting time for ALL of us, including yourself.

Mike
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Tue May 29, 2012 2:50 pm     Reply with quote

That's out of order.

We're trying to help you.

Mike


+++++++++++++++++++++
Locked.

Everyone, please try to reduce the dissension
and the provocations which cause it. Keep
the discussion on a technical level. This applies
to both parties.

- Forum Moderator
+++++++++++++++++++++
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    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