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

interrupt during write_eeprom

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



Joined: 17 Nov 2011
Posts: 187

View user's profile Send private message Send e-mail

interrupt during write_eeprom
PostPosted: Sun Feb 09, 2014 6:57 am     Reply with quote

I want to know is int_ext interrupt posible during write_eeprom ?
I'm measuring short 1 ms random pulses that makes interrupts to
B0/INT pin and I don't want to loose any of them... maybe write_eeprom
function last several milliseconds
Chip I'm using is 16f8777a
best regards
-arto-
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

PostPosted: Sun Feb 09, 2014 8:13 am     Reply with quote

..
_________________
Google and Forum Search are some of your best tools!!!!


Last edited by dyeatman on Sun Feb 09, 2014 9:58 am; edited 2 times in total
Ttelmah



Joined: 11 Mar 2010
Posts: 19496

View user's profile Send private message

PostPosted: Sun Feb 09, 2014 9:08 am     Reply with quote

Also, remember that the interrupt _flag_ will still be set, and the interrupt serviced immediately after the EEPROM write finishes, so, provided the repeat rate of the interrupt never exceeds the time it takes for a single EEPROM write to occur, they won't be 'missed', just the servicing will be delayed.
The EEPROM write takes 8mSec 'worst case', 4mSec 'typical'.

Best Wishes
artohautala



Joined: 17 Nov 2011
Posts: 187

View user's profile Send private message Send e-mail

PostPosted: Sun Feb 09, 2014 9:30 am     Reply with quote

dyeatman wrote:
The problem has been discussed here many times before.
You can't have interrupts during EEPROM writes.
Using FRAM will solve the problem, no 1ms write delay.
Available from most electronics suppliers.


Thank you for your good answer ... in my case delayed writing to EEPROM is no problem ...

I was only worried missing those 1 ms random pulses ...

have fun and thank's
-arto-
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

PostPosted: Sun Feb 09, 2014 9:35 am     Reply with quote

You misunderstand. I am not talking about delayed writing to EEPROM.
I am talking about the MANDATORY time it takes to complete the EEPROM
write cycle. As was stated earlier it can take upwards of 4MS which is a
huge amount of time. During that time you must have interrupts disabled.
If two or more interrupts occur during that time you WILL miss all but the
first one. FRAM writes are instantaneous.
_________________
Google and Forum Search are some of your best tools!!!!


Last edited by dyeatman on Sun Feb 09, 2014 10:21 am; edited 2 times in total
artohautala



Joined: 17 Nov 2011
Posts: 187

View user's profile Send private message Send e-mail

PostPosted: Sun Feb 09, 2014 9:42 am     Reply with quote

Ttelmah wrote:
Also, remember that the interrupt _flag_ will still be set, and the interrupt serviced immediately after the EEPROM write finishes, so, provided the repeat rate of the interrupt never exceeds the time it takes for a single EEPROM write to occur, they won't be 'missed', just the servicing will be delayed.
The EEPROM write takes 8mSec 'worst case', 4mSec 'typical'.

Best Wishes


OK

it don't matter in my case if writing to EEPROM is delayed ...
but if during writing to EEPROM there is two
1 ms pulses do I miss one pulse ?

lot of thank's for your professional answer ... I really respect it

Smile

-arto-
artohautala



Joined: 17 Nov 2011
Posts: 187

View user's profile Send private message Send e-mail

PostPosted: Sun Feb 09, 2014 10:05 am     Reply with quote

dyeatman wrote:
You misunderstand. I am not talking about delayed writing to EEPROM.
I am talking about the MANDATORY time it takes to complete the EEPROM
write cycle. As was stated earlier it can take upwards of 4MS which is a
huge amount of time. During that time you must have interrupts disabled.
If two or more interrupts occur during that time you WILL miss all but the
first one. FRAM writes are instantaneous.


OK!

so if I don't want to loose any 1 ms pulses during write to pic EEPROM
I have to use FRAM? no pic internal EEPROM ?

Sorry I do not understand what FRAMs are... and how to use them ...

is this OK:

disable_interrupts(GLOBAL);
write_eeprom ( something ... )
enable_interrupts(GLOBAL);
?

in this case I loose pulses during writing to EEPROM ? except one pulse entered during writing ?

pls tell me how to use FRAM!

best wishes


-arto- Smile
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

PostPosted: Sun Feb 09, 2014 10:11 am     Reply with quote

Unfortunately all EEPROM has this limitation so yes internal or external has the same problem.

Because of this I have used FRAM for many applications. FRAM is
essentially exactly the same as EEPROM (in many cases a drop in
replacement) but writes occur in one clock cycle rather than 4+ms.

http://en.wikipedia.org/wiki/Ferroelectric_RAM

One additional note, EEPROM has a limited number of write cycles before
they "burn out". FRAM is virtually unlimited.

Here is a great Ramtron document on FRAM
http://documents.rs-components.com/EITC/UK/electronics/an304.pdf

Here is an FRAM that allows SPI writes at up to 40MHZ speeds.
http://www.cypress.com/?docID=44769
_________________
Google and Forum Search are some of your best tools!!!!


Last edited by dyeatman on Sun Feb 09, 2014 10:36 am; edited 1 time in total
artohautala



Joined: 17 Nov 2011
Posts: 187

View user's profile Send private message Send e-mail

PostPosted: Sun Feb 09, 2014 10:36 am     Reply with quote

dyeatman wrote:
Unfortunately all EEPROM has this limitation so yes internal or external has the same problem.

Because of this I have used FRAM for many applications. FRAM is
essentially exactly the same as EEPROM (in many cases a drop in
replacement) but writes occur in one clock cycle rather than 4+ms.

http://en.wikipedia.org/wiki/Ferroelectric_RAM

One additional note, EEPROM has a limited number of write cycles before
they "burn out". FRAM is virtually unlimted.


OK
I understand that EEPROM is nonvolatile memory and maybe 100 000 write cycles is maxĂ­mum and that's why in PC:s they use random access ...

and FRAM is like dynamic RAM ... and fast ...

what chip of FRAM I have to use to solve a problem ?

What chip FRAM you are used?

serial or parallel ....

in my hardware there's a broblem that it's ready ....

and I did not thought that little problem at all when I did printed circiuti board Twisted Evil

... but maybe I can do some "prototyping " to my hardware ...


have fun

all the best for you

-arto-
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

PostPosted: Sun Feb 09, 2014 10:42 am     Reply with quote

I originally started with (and still like) Ramtron but there are better ones out
now like the one from Cypress I provided the link to above. I prefer and use
SPI.

Parallel is obviously the fastest but, at high speeds, an SPI write can be
accomplished in us rather than ms.
Size is purely depending on how much data you need to store. If you have
very little use the smallest size.

It appears Ramtron has been bought out by Cypress anyway...
_________________
Google and Forum Search are some of your best tools!!!!
artohautala



Joined: 17 Nov 2011
Posts: 187

View user's profile Send private message Send e-mail

PostPosted: Sun Feb 09, 2014 10:49 am     Reply with quote

dyeatman wrote:
I originally started with (and still like) Ramtron but there are better ones out
now like the one from Cypress I provided the link to above. I prefer and use
SPI.

Parallel is obviously the fastest but, at high speeds, an SPI write can be
accomplished in us rather than ms.
Size is purely depending on how much data you need to store. If you have
very little use the smallest size.

It appears Ramtron has been bought out by Cypress anyway...


OK

lot of thank's

-arto-
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

PostPosted: Sun Feb 09, 2014 10:53 am     Reply with quote

I understand your dilemma. I have been caught flatfooted when a problem
cropped up after a design was finalized. Now, I always do a prototype and
test extensively before the final. I have avoided a number of bad situations
(and egg on my face) this way.
_________________
Google and Forum Search are some of your best tools!!!!
artohautala



Joined: 17 Nov 2011
Posts: 187

View user's profile Send private message Send e-mail

PostPosted: Sun Feb 09, 2014 11:13 am     Reply with quote

dyeatman wrote:
I understand your dilemma. I have been caught flatfooted when a problem
cropped up after a design was finalized. Now, I always do a prototype and
test extensively before the final. I have avoided a number of bad situations
(and egg on my face) this way.


HI

OK,

I did prototype too but my project is so complicated ...

my project is just for fun and just for hobby ...

it measures backround radioactive radiation and shows it in big LCD display pulses in 1 second and 1 minute
and pulses minimum and maximum...
and there are menus to control all things...

and same pulses in big (about 7 centimeters) 7 segment displays...

if you are intersted I'll be happy to send photos and software listings for you... and shematic and print layouts

we are great people

Smile

-arto-
Ttelmah



Joined: 11 Mar 2010
Posts: 19496

View user's profile Send private message

PostPosted: Sun Feb 09, 2014 12:28 pm     Reply with quote

I too like FRAM.
However you might consider not using an interrupt at all!....
If you instead of connecting the pulses to the interrupt, feed them to a clock input for one of the timers supporting external clocks, the timer will simply count the pulses. It'll do this whether or not the EEPROM is updating.
The count will be the number of pulses, whether one, two, ten or twenty arrives while the write is taking place....

Best Wishes
artohautala



Joined: 17 Nov 2011
Posts: 187

View user's profile Send private message Send e-mail

PostPosted: Sun Feb 09, 2014 1:04 pm     Reply with quote

Ttelmah wrote:
I too like FRAM.
However you might consider not using an interrupt at all!....
If you instead of connecting the pulses to the interrupt, feed them to a clock input for one of the timers supporting external clocks, the timer will simply count the pulses. It'll do this whether or not the EEPROM is updating.
The count will be the number of pulses, whether one, two, ten or twenty arrives while the write is taking place....

Best Wishes


OK yeah

good idea ... !

I will think it tomorrow ... but now I have to go to sleep ...

clock in finland is now 21:01 PM and tomorrow is very busy working day...

lot of thanks and best life for you !

-arto-
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