View previous topic :: View next topic |
Author |
Message |
gpsmikey
Joined: 16 Nov 2010 Posts: 588 Location: Kirkland, WA
|
writing to eeprom and interrupts ... |
Posted: Tue Dec 07, 2010 7:52 pm |
|
|
After much snooping, I have a question on writing to eeprom and interrupts. In his examples, Ttelmah shows disabling the interrupts before the actual write then re-enabling (if they were enabled to start with) them again after the write operation has completed. However, in reading in the CCS compiler manual for version 4 (pg 99), it talks about the
#device WRITE_EEPROM=NOINT
and says "Allows interrupts to occur while the write_eeprom() ..." which implies to me that they are already disabling interrupts in the write routine. Anybody have any experience on this or am I missing something ? (yes, I did see in another post about the recommendation to disable interrupts during writes and the reasoning for it). Is it still necessary for me to disable them during my write routine or is CCS handling that for us now ?
thanks !
mikey _________________ mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3 |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19506
|
|
Posted: Wed Dec 08, 2010 2:54 am |
|
|
The option, postdates my code (by a lot - that write/read routine, was originally coded with an early V3 compile).
There are lots of CCS options like this, that have slowly been added to make things work right. It is up to you, whether you prefer to use their stuff, or ensure things are coded the way you want, with stuff you can see....
Best Wishes |
|
|
gpsmikey
Joined: 16 Nov 2010 Posts: 588 Location: Kirkland, WA
|
|
Posted: Wed Dec 08, 2010 7:07 am |
|
|
OK, thanks Ttelmah - I was just trying to figure out if we were dealing with the "department of redundancy department" or if it had evolved with the current code(back in version 2.x that I originally had, you did it all yourself).
What do you use these days with the current compiler version for your eeprom writes ? (I understand the concern for what goes on behind the curtain)
mikey _________________ mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3 |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19506
|
|
Posted: Wed Dec 08, 2010 7:46 am |
|
|
I use what I posted. I trust CCS to do this as little as I trust some businessmen....
Best Wishes |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Wed Dec 08, 2010 11:19 am |
|
|
Ttelmah wrote: | I use what I posted. I trust CCS to do this as little as I trust some businessmen....
|
Hahah... Yea...
It's like I've said before...
You can shortcut using the wonderful CCS pre-built functions.
If they don't work... then you end up writing it yourself... like C18.
;) _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
gpsmikey
Joined: 16 Nov 2010 Posts: 588 Location: Kirkland, WA
|
|
Posted: Wed Dec 08, 2010 11:22 am |
|
|
OK, thanks folks - I will use Ttelmah's examples and not worry about the "man behind the curtain" in this case (contrary to what my wife says, I can be trained ! )
mikey _________________ mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3 |
|
|
|