PDA

View Full Version : Memory Loss??



BobEdge
- 23rd October 2006, 13:20
Hi,

I am using a pic to control the current produced by a welding machine. I measure the current using analog input, then do some maths and send a value to a DAC to adjust the phase angle. After a weld I save the value to the internal memory, so that when welding again this value can be read, to give a good starting point for the weld.


Ok this is the problem. A machine was left for a couple of weeks, and when it came to be used again the current was on full (about 3000A making a nice big hole in the welding bench) It was as if the value saved to memory had been corrupted or set to zero. (the lower the value the higher the current) I reprogrammed the pic and all worked fine, so I dont think a hardware fault was to blame. I was just wondering if anyone has had problems with the internal pic memory?

Best regards
Bob...

Charles Linquis
- 23rd October 2006, 13:46
I initially had lots of problems with EEPROM until I made a few code changes. Since then, I have had values hold for 3 years. My changes are:

Always issue a delay between successive WRITEs. I use 100uSec.
Make certain that interrupts are disabled during WRITEs.

I don't know if these have any relevance to your code.

Charles Linquist

sayzer
- 23rd October 2006, 15:22
...

Always issue a delay between successive WRITEs. I use 100uSec....


Hi Charles,

I also made a rule myself to use some delay before each WRITE command until I read the post by Melaine that WRITE command already has its own delay for write operation. Thus, I no longer use any pause/delay before WRITE.

Here is the post.
http://www.picbasic.co.uk/forum/showthread.php?t=549

-----------------

Jerson
- 24th October 2006, 03:51
Are you exceeding the max writes specification? Are you saving too often that the eeprom is getting damaged? Ideally you should save just before power down.

Jerson

BobEdge
- 24th October 2006, 11:10
Thanks for the response guys. I have found the problem, after all it was a fault with the hardware. A lose crimp terminal was intermittently giving only about a fith of the output from the current shunt, thus the feedback was ramping the current to full output, and thinking the output was only 1000 amps or so.

Good to know there is no problem with the PIC

Best regards
Bob...