Searching \ for '[PIC]: 16F876 EEPROM Write Problem' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/memory.htm?key=eeprom
Search entire site for: '16F876 EEPROM Write Problem'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: 16F876 EEPROM Write Problem'
2001\09\02@163027 by Ian Jordan

flavicon
face
I'm having trouble writing to the EEPROM on a 16F876. I have code that was
written for a 16F872, and it works fine on that chip. If I burn the exact
same code into a 16F876, it doesn't work.

I can read the EEPROM, and I don't get an error on the '876, but when I go
back and read it again, it hasn't changed. I can change the value the EEPROM
read sees when programming the chip, but not in operation. My EEPROM address
block begins at 0x2100, and I have a loop that waits for EECON1,WR to go
low.

Is there anything really different between the '872 and '876 when it comes
to writing to the EEPROM? I looked over the datasheets and didn't really see
anything different. Seems strange to be that the '872 would write fine but
the '876 doesn't. They are using identical code and on the same breadboard,
same circuit.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body


2001\09\02@210535 by Olin Lathrop

face picon face
> I'm having trouble writing to the EEPROM on a 16F876. I have code that was
> written for a 16F872, and it works fine on that chip. If I burn the exact
> same code into a 16F876, it doesn't work.

I don't have the 16F872 data sheet in front of me, but it probably has
different register banks.  Take a look at your bank selection code very
carefully.  Most likely you ended up doing something like accessing an
aliased register on the 872 that isn't aliased on the 876, or something
similar.  If the 872 only has two banks, maybe you aren't setting RP1 at
all?


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, .....olinKILLspamspam@spam@embedinc.com, http://www.embedinc.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body


2001\09\03@080107 by Ing. Gustavo Quilosa

picon face
Hi.
   Welcome to the "Banked World" :):)

   You might check the bank asigment for 16F876. Probably It doesn't match
with 16F872's. Check also the status of RP0 and RP1 in STATUS register.
regards.
----------------------------------------------------------
Ing. G. Quilosa
Development Dept.
----------------------------------------------------------

----- Mensaje original -----
De: Ian Jordan <.....ianKILLspamspam.....TWINGLES.COM>
Para: <EraseMEPICLISTspam_OUTspamTakeThisOuTMITVMA.MIT.EDU>
Enviado: domingo 2 de septiembre de 2001 17:29
Asunto: [PIC]: 16F876 EEPROM Write Problem


> I'm having trouble writing to the EEPROM on a 16F876. I have code that was
> written for a 16F872, and it works fine on that chip. If I burn the exact
> same code into a 16F876, it doesn't work.
>
> I can read the EEPROM, and I don't get an error on the '876, but when I go
> back and read it again, it hasn't changed. I can change the value the
EEPROM
> read sees when programming the chip, but not in operation. My EEPROM
address
> block begins at 0x2100, and I have a loop that waits for EECON1,WR to go
> low.
>
> Is there anything really different between the '872 and '876 when it comes
> to writing to the EEPROM? I looked over the datasheets and didn't really
see
> anything different. Seems strange to be that the '872 would write fine but
> the '876 doesn't. They are using identical code and on the same
breadboard,
> same circuit.
>
> --
> http://www.piclist.com#nomail Going offline? Don't AutoReply us!
> email listservspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body
>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
http://www.piclist.com hint: To leave the PICList
@spam@piclist-unsubscribe-requestKILLspamspammitvma.mit.edu


2001\09\03@100737 by Christian Dorner

flavicon
face
Hi!



> Is there anything really different between the '872 and '876 when it comes
> to writing to the EEPROM? I looked over the datasheets and didn't really
see
> anything different. Seems strange to be that the '872 would write fine but
> the '876 doesn't. They are using identical code and on the same
breadboard,
> same circuit.

The 876 has the possibility to write to the "flash" program part of it's
memory. Maybe it's the flag/bit to select the eeprom or the flash-program
memory?

cu, Christian

--
http://www.piclist.com hint: To leave the PICList
KILLspampiclist-unsubscribe-requestKILLspamspammitvma.mit.edu


2001\09\03@124657 by Ian Jordan

flavicon
face
I've checked both the '872 and '876 data sheets- they both use Bank 3 as the
initialization area for the EEPROM.

In fact, the code I am using to write to the EEPROM is direct off the '876
data sheet- it doesn't work on the '876, but it works fine on the '872. This
code specifically changes to certain banks when needed.

--Ian

{Original Message removed}

2001\09\03@133928 by Ian Jordan

flavicon
face
I specifcally clear the EEPGD bit in both the read and write routines in
order to access the EEPROM instead of flash.

Still searchin'!

Thanks,
   Ian

> The 876 has the possibility to write to the "flash" program part of it's
> memory. Maybe it's the flag/bit to select the eeprom or the flash-program
> memory?
>
> cu, Christian

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu


2001\09\03@145239 by Quentin

flavicon
face
Ian Jordan wrote:
>
> I've checked both the '872 and '876 data sheets- they both use Bank 3 as the
> initialization area for the EEPROM.
>
> In fact, the code I am using to write to the EEPROM is direct off the '876
> data sheet- it doesn't work on the '876, but it works fine on the '872. This
> code specifically changes to certain banks when needed.
Ian
Last week I posted my EEPROM write code to help somebody with a bank
problem. Do a search in the archives for: Re: [PIC]: EECON1,WR is not
set!!
I don't mind sharing the code here, as it is just my adaptation for what
is in the Data Sheet. I've used the same code on various '876 and '877,
both with 4Mhz, 20Mhz xtal and 2Mhz RC. It is a macro where I load the
data into Wreg and the address in a special reg before calling.
Please test it on both your '876 and '872 and let us know if it works.
Maybe you can find the problem by trying somebody elses code.

Quentin

--
http://www.piclist.com hint: To leave the PICList
spamBeGonepiclist-unsubscribe-requestspamBeGonespammitvma.mit.edu


2001\09\03@152602 by Ian Jordan

flavicon
face
Thanks Quentin. Turns out I wasn't switching back to Bank 0 when I read my
"EEDATA" variable. Weird thing is that it worked on the '972, but not the
'876.

The addition of two simple lines to switch back to bank 0 before reading my
data variable fixed it.

Thanks,
   Ian

{Original Message removed}

2001\09\03@193747 by Tony Nixon

flavicon
picon face
Ian Jordan wrote:
>
> Thanks Quentin. Turns out I wasn't switching back to Bank 0 when I read my
> "EEDATA" variable. Weird thing is that it worked on the '972, but not the
> '876.
>
> The addition of two simple lines to switch back to bank 0 before reading my
> data variable fixed it.


I'd be still looking for a problem. The F87x all have the same addresses
and mechanism for EEPROM access.

How can you switch to Bank 0 and read the EEPROM data when EEDATA is in
Bank 2?

--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
TakeThisOuTsalesEraseMEspamspam_OUTbubblesoftonline.com

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestspamTakeThisOuTmitvma.mit.edu


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...