Have you read http://www.microchip.com/download/lit/suppdoc/errata/80073d.pdf It would seem there are some errors in the data sheet regarding EEPROM read/write - concerning the banks the registers are in. Hope this helps. Regards, Kevin. > -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@mitvma.mit.edu] On Behalf Of Jinx > Sent: 07 February 2002 06:05 > To: PICLIST@mitvma.mit.edu > Subject: Re: [PIC]: 16F628 EEPROM write routine > > > > Are you sure your Vcc is rock-steady? Maybe add an > > elco + a 0.1u really near to the power/ground pins? > > I didn't have them before, but I do now. The PS is 4 x NiCd > btw, which does seem to be glitch free > > One tip I should mention - make sure you're accessing the > correct RAM when loading the eedata register. I puzzled about > an unchanging value for more than a few minutes before > realising, of course, that the F628 has RAM in each bank. In > my case, values are being stored in the bank0 RAM > > stee bsf portb,led > movf ppval,w ;get value from bank0 RAM > bsf status,rp0 > bcf status,rp1 ;now switch to bank 1 > movwf eedata > movf fsr,w ;store in EEPROM table > movwf eeadr > > The above snippet is part of the porting of this circuit and > routine from F84 to F628 > http://home.clear.net.nz/pages/joecolquitt/0pots.html I haven't used some 628 features yet, but assume that a similar sort of circuit could built around Vref and the comparators ? -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics ***************************************************************** This email has been checked by the altohiway e-Sweeper Service ***************************************************************** -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics