PDA

View Full Version : strange problems with 18F2520 and 18F2525



Brock
- 4th July 2006, 02:48
I just started having problems with these parts. The PBP "WRITE" command is
not writing to the EEPROM. Also, the INT0 and INT1 flag bit doesn't seem to be
setting, but I haven't had a chance to look into that yet. The EEPROM is my
main concern right now as I have a new product out on the market that isn't
storing settings in the EEPROM. Has anyone heard of this? I'm using PBP 2.46
with the patch (2.46a) and brand new 18F2525-I/SO parts. Programming with
EPIC.

mister_e
- 4th July 2006, 03:54
i heard the issue on the 2520, but i used several 2525 as now, and those, as far as i'm aware of, never get this kind of EEPROM problem.

Can you post a snip of your program?

Darrel Taylor
- 4th July 2006, 05:13
... The PBP "WRITE" command is
not writing to the EEPROM. Also, the INT0 and INT1 flag bit doesn't seem to be setting...

I would suggest finding the interrupt problem first.

If a write to EEPROM gets Interrupted. It will fail. And, If you are having problems with the interrupts, it could be the cause.

Things to try,

Disable all interrupts and try to write to EEPROM.
Disable Interrupts while writing to EEPROM.
Write to EEPROM, read it back, and if it's different try again. If unsuccesfull after so many tries, Disable Interrupts and try again.
Use EE_Vars.pbp, and let it do it all for you.
http://www.picbasic.co.uk/forum/showthread.php?t=2444

Brock
- 4th July 2006, 06:22
All interupts are disabled, as always. I poll the interupt flag to look for a rising
edge on the interupt ports. This program is not any different from other
programs I have written, in regards to the WRITE command and the interupt
flag polling. I am baffled. I even tried an older 18F2520 chip that I had laying
around and the same thing is happening... a chip that didn't have this problem
before!

I use the EEPROM command to write initial contents to the EEPROM and there is
no problem there. But writing to it during runtime does not work. I think
something is happening with the compile, but nothing has changed on the
computer that I use, so I can't imagine what the problem is. I have been using
PBP for over 5 years and consider myself pretty good at writing programs, but
this has me completely stumped!

mister_e
- 4th July 2006, 07:48
This have to be a silicon batch problem. See the tons of errata on the Microchip website. But some use them and works a treat... it's certainely not even a PBP related problem.

Hum humn.. i saw almost the same question/comments on some competitor product.. and they mostely comes up with the same conclusion.

The Darrel suggestion could be a real great workaround... but i just hope it will never ends up in an endless loop... wich is... a real pain in the ...

I'll try those i have here to see if i'm better lucky.

Brock
- 4th July 2006, 20:19
OK, now I'm feeling kind of stupid... the flash program configuration also affects
the EEPROM, not just the program memory. Configuring the target device to
Enable Flash Programming allows the program to write to the program memory
AND the EEPROM. I thought it was only for the program memory. It says right
in the data sheet that EECON1.2 enables or disables writing to the Flash memory
or the EEPROM.

So, 1 problem solved and 1 to go.