Searching \ for '[PIC]: 18F eeprom programming algorithm' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: massmind.org/techref/microchip/devprogs.htm?key=programming
Search entire site for: '18F eeprom programming algorithm'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: 18F eeprom programming algorithm'
2003\01\04@170941 by Wouter van Ooijen

face picon face
I have trouble programming the data eeprom of the 18F's (using my own
programmer, not by a programming running on the PIC). Contrary to what
p14/15 of the programming manual requires I can (only) get it to work
when I replace the 'Hold SDATA low until write completes' with a real
NOP (with clocking for the 16 'data' bits), followed by the wait. Any
programmer-authors got care to comment?

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\01\04@173306 by Olin Lathrop

face picon face
part 1 2205 bytes content-type:text/plain; (decoded 7bit)

> I have trouble programming the data eeprom of the 18F's (using my own
> programmer, not by a programming running on the PIC). Contrary to what
> p14/15 of the programming manual requires I can (only) get it to work
> when I replace the 'Hold SDATA low until write completes' with a real
> NOP (with clocking for the 16 'data' bits), followed by the wait. Any
> programmer-authors got care to comment?

Hi, Wouter.  I'm home right now and unfortunately my notes about programming
the 18F EEPROM are at the office.  However, I do have a copy of the source
code here, which is attached.  Take a look at the PICPRG_WRITE_18D routine.
It's in Pascal, but I don't think you need to know the language details to
follow the algorithm.  This routine does work.  Here is the salient snippet
with error checking and other stuff deleted to make the algorithm more
visible (see the attached file for the real thing):

 setsfr (pr, 16#A9, adr + ofs, stat); {set address to write to}
 setsfr (pr, 16#A8, dat[ofs] ! mr, stat); {write the data value to EEDATA}
 coreinst (pr, 16#84A6, stat);      {BSF     EECON1, WREN}
 setsfr (pr, 16#A7, 16#55, stat);   {write 55h to EECON2}
 setsfr (pr, 16#A7, 16#AA, stat);   {write AAh to EECON2}
 coreinst (pr, 16#82A6, stat);      {BSF     EECON1, WR ;start the write}
 coreinst (pr, 0, stat);            {execute NOP instruction}
 picprg_cmdw_send (pr, 4, 0, stat); {do 4 clock cycles into another NOP}
 picprg_cmdw_wait (pr, 0.005, stat); {force 5mS wait before next operation}
 picprg_cmdw_send (pr, 16, 0, stat); {do remaining cycles of NOP}
 coreinst (pr, 16#94A6, stat);      {BCF     EECON1, WREN}

There were various little errors and inconsitencies in every one of the
programming specifications for the chips I implemented, but I don't remember
off the top of my head exactly which issues applied to the 18F.  I do
remember that I had to take some educated guesses in a few places about how
the thing really worked.

I'll try to look up my notes when I get to the office.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.




part 2 22881 bytes content-type:application/octet-stream; (decode)

part 3 2 bytes
-

2003\01\04@173633 by Andy Kunz

flavicon
face
There was an errata about supplying ALL power pins, Vdd and AVdd, Vss and
AVss with power.

Andy

At 11:09 PM 1/4/03 +0100, you wrote:
{Quote hidden}

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\01\05@043723 by Wouter van Ooijen

face picon face
>   picprg_cmdw_send (pr, 16, 0, stat); {do remaining cycles of NOP}

Thanx, that was my error: I overlooked that the 16 data bits must still
be clocked in *after* the programming delay. For code and data I used a
different piece of code anywway because the clock must remain high, so
the problem appeared only for eeprom.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

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

2003\01\05@051532 by Rob Hamerling

flavicon
face
Wouter van Ooijen wrote:
> I have trouble programming the data eeprom of the 18F's (using my own
> programmer, not by a programming running on the PIC). Contrary to what
> p14/15 of the programming manual requires I can (only) get it to work
> when I replace the 'Hold SDATA low until write completes' with a real
> NOP (with clocking for the 16 'data' bits), followed by the wait. Any
> programmer-authors got care to comment?

The pages you mentioned made me think you used the 'preliminary'
DS39576A? Just yesterday I noticed there is a DS39576B which has
among others a slightly different EEPROM programming instruction
sequence (p16/17).

Rob.

--
Rob Hamerling, Vianen, NL phone +31-347-322822
homepage: http://www.robh.nl/

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

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