Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

16F628 EEP Read/Write

Status
Not open for further replies.

tom3000

New Member
having ruff time reading and writing to eeprom .....

for some strange reason it's intermittant....i have my read/write procedures in a short program....works perfectly fine......

i stick the exact same code into a larger program....it doesnt work right.....

anybody had something like that happen to them ??? what's the damn solution here

fact is the larger program is over 1k, has more 'CALLS', 'jmps' ...i also put short delay after every read/write cause it seemed to work better on my old 16f84's

? ? ?
 
Instead of delaying after the write, how about you wait until the EECON1,WR bit is cleared before writing.

If you're trying to write to the eeprom in both the main code and in the isr (assuming you're using it) you may have problems with the timing as well.
 
If you're trying to write to the eeprom in both the main code and in the isr (assuming you're using it) you may have problems with the timing as well.

no im not using int service routine at all if that's what you mean by isr

im using the simple

EEREAD
blah
blah
blah
retlw 0

EEWRITE
blah
blah
blah
retlw 0

both are CALLED from various other procs....AND IT DOESNT WORK RIGHT for READS either !!!!! (in the longer program of course)
in the short program it works perfectly fine, the short program is about 100 bytes long, no more

WTF ? ? ? ? ? ? ? ? ? ? ? ? ?
 
Last edited:
Post the code for your ee read and write routines. It's very odd that the reads don't work properly. Have you decoupled the power supply with a capacitor close to the pic?
 
no im not using int service routine at all if that's what you mean by isr

im using the simple

EEREAD
blah
blah
blah
retlw 0

EEWRITE
blah
blah
blah
retlw 0

both are CALLED from various other procs....AND IT DOESNT WORK RIGHT for READS either !!!!! (in the longer program of course)
in the short program it works perfectly fine, the short program is about 100 bytes long, no more

WTF ? ? ? ? ? ? ? ? ? ? ? ? ?

WTF stand for Watchdog Timer Function

Hope this help/

HAhahahahahahaaaaa
 
Look for title effect at bottom....

having ruff time reading and writing to eeprom .....

for some strange reason it's intermittant....i have my read/write procedures in a short program....works perfectly fine......

i stick the exact same code into a larger program....it doesnt work right.....

anybody had something like that happen to them ??? what's the damn solution here

fact is the larger program is over 1k, has more 'CALLS', 'jmps' ...i also put short delay after every read/write cause it seemed to work better on my old 16f84's

? ? ?

Can u take a look of my example? I used more calls in pic16F628A Reasoning is why i used more procedure events is preventing links errors.
https://www.electro-tech-online.com...to-left-right-fade-in-out-wipe-in-out.103240/
 
Post the code for your ee read and write routines. It's very odd that the reads don't work properly. Have you decoupled the power supply with a capacitor close to the pic?

the code is STRAIGHT OUT OF the MicroChip BOOK....only difference i add 25microsecond delays after each read/write call
 
okay thanks for those who replied....i got it going....was just being reckless for not double checking the whole big program....some corrections were needed with the EEDATA and EEADR....forgot that in the 628's those 2 can only be accessible from bank1, in F84's 1 can access them from both 0 and 1
 
Status
Not open for further replies.

Latest threads

Back
Top