[sdiy] destroying flash memory cell on a PIC

Tom Wiltshire tom at electricdruid.net
Thu Mar 18 12:37:32 CET 2021


Yeah, I’ve had this problem too.

I spent some time trying to work out why my write-to-EEPROM routine wasn’t working because when I checked the result I got rubbish. I couldn’t find the problem with the write routine because it wasn’t there. It was a problem with the code that set up the pointer that fetched the data, so it was reading rubbish and writing the rubbish accurately to the EEPROM!


> On 17 Mar 2021, at 21:56, Jay Schwichtenberg <jschwich53 at comcast.net> wrote:
> 
> Another thing came to mind.
> 
> After the E/W cycle did you verify the memory that was written to FLASH?
> 
> Maybe the memory written (I assume RAM) got corrupted between setup and when it was written.
> 
> Jay S.
> 
> On 3/17/2021 11:50 AM, Jay Schwichtenberg wrote:
>> I've used some PIC16s, PIC18s, PIC24s and PIC32s without any problems.
>> 
>> Looking at the datasheet there is 10K min E/W speced so shouldn't have a problem.
>> 
>> Did you look for an Errata sheet for the chip and see if there are any issues noted (always do this if you get weird behavior)?
>> 
>> I've worn out ARM FLASH before but it took a while.
>> 
>> Jay S.
>> 
>> On 3/17/2021 3:55 AM, Roman Sowa wrote:
>>> Hi,
>>> I was recently playing with PIC18 self-write and encountered strange problem. I can't be sure if it was because of my multiple write attempts (not that many of them) or it is extremely bad luck, but the microcontroller in question (PIC18F46K22) shows stange fault. About 20 of flash memory bytes are showing 00 even if that range was not programmed. It is FF after bulk erase, but after programming even several kilobytes below, they read as 00.
>>> There's a pattern - they are all on 10-bit boundary, so it's address 400, 800, C00 and so on till FC00. To look even more strange, it's not all, but randomly few bytes fitting that pattern work OK.
>>> It happens either if I program it as self-write, or if using ICD3.
>>> 
>>> Have anyone ever encountered this problem?
>>> 
>>> After thousands of PICs used so far I have never encountered flash error. OTOH, I have never used self-write before, but despite looking like obvious coincidence I can't see a reason why self-write would damage a memory cell, or address decoder. Chip errata does not mention anything about memory precautions.
>>> 
>>> Maybe I'm doing this too fast? The 64-byte page write is initiated just a couple of us after page erase is finished. This shouldn't be a problem but maybe worth trying to put 2-3ms delay.
>>> Thanks for your help!
>>> 
>>> Roman
>>> _______________________________________________
>>> Synth-diy mailing list
>>> Synth-diy at synth-diy.org
>>> http://synth-diy.org/mailman/listinfo/synth-diy
>>> Selling or trading? Use marketplace at synth-diy.org
>> _______________________________________________
>> Synth-diy mailing list
>> Synth-diy at synth-diy.org
>> http://synth-diy.org/mailman/listinfo/synth-diy
>> Selling or trading? Use marketplace at synth-diy.org
> _______________________________________________
> Synth-diy mailing list
> Synth-diy at synth-diy.org
> http://synth-diy.org/mailman/listinfo/synth-diy
> Selling or trading? Use marketplace at synth-diy.org





More information about the Synth-diy mailing list