EEPROM AND TIMER INTERRUPT PROBLEM

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
chmoc_1567941
Level 4
Level 4

hi.

   

when i use eeprom in Timer interrupt with isr than writing function is not working properly..

   

what is the reason behind this??

   

Here i am using two timer interrupt and one of them has a eeprom writing function.

0 Likes
9 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You should never use time-consuming functions (and programming EEProm is one) within an interrupt handler. Better is to just set a flag and react on it in the main loop. When really in need, re-enable interrupts in the handler before programming.

   

 

   

Bob

0 Likes
chmoc_1567941
Level 4
Level 4

hi bob 

   

i did the same as you suggested but still i cant find the solution.

   

how can i overcome it??

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Can you upload the project archive?

   

 

   

Bob

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I cannot see any interrupt handling in your project.

   

You are using an offset of 100 when writing, but you specified a length of the eeprom component of only 64 bytes.

   

 

   

Bob

0 Likes
chmoc_1567941
Level 4
Level 4

hi bob,

   

 

   

i think 100 is address and 64 is size than what is connection between them.

0 Likes
chmoc_1567941
Level 4
Level 4

if you check while loop than there is led function for check whether my programming line reach there or not. but unfortunately led is not on one of the time. so i think due to timer function while is not working correctly.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

even if 100 would be the address it is larger than the size. The 100 is offset from beginning, use zero (0)

   

 

   

Bob

0 Likes
chmoc_1567941
Level 4
Level 4

i also use zero...i almost spent 5 hour on just eeprom. i think my ic is not performing  well. 

   

is that i am thinking right??

   

how much time eeprom function take to write 8 byte data??

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

how much time eeprom function take to write 8 byte data??

   

Only a couple of ms.

   

I admitt: when you do not have got an ICE-Cube debugging for PSoC1 can be a pain in the ass!

   

 

   

Bob

0 Likes