Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How can we be sure that software guy has not programmed too many EEPROM writes?

Status
Not open for further replies.
T

treez

Guest
Hello,
Please help explain why our software engineer has programmed our PIC16F18856 microcontroller to write to its EEPROM for 15 seconds continuously when it only needed 5ms to do this?

As you know, since it should only take 5ms to write to EEPROM (Pg 611 of datasheet says so), this means he has done 2999 EEPROM writes which he did not need to do. As such, we are concerned that every time he is writing a byte to EEPROM he is actually doing it 3000 times, instead of just once. –As you know, after so many EEPROM writes, a microcontroller EEPROM dies. It looks to me that he has been deliberately trying to kill our microcontroller in our lamp, and thus bring the lamp’s life to a premature end.

The lamp periodically stores ambient light readings into microcontroller EEPROM. (These light readings are obtained through the micro’s ADC after reading a SFH5711 light sensor). The readings are taken several times per day…..once every 15 minutes.

We are actually concerned because we only discovered that he was doing this 15 seconds worth of EEPROM writes when we realised that the microcontroller consumed over 5mA for the first 15 seconds after being switched ON. If we hadn’t have noticed this and challenged the software guy about this, it would never have come to be known what was actually going on. After being switched ON, the lamp should just take one light reading and store it to EEPROM.....this should take only 5ms, not 15 seconds. Another point is that the micro is fed by a linear regulator which feeds off rectified mains, so this heavy writing to EEPROM is overheating the linear regulator that supplies the micro.

For all we know, the lamp may, at some time in the future , embark on continuous EEPROM writes, which would kill the lamp……he has obviously no control over what he is doing with EEPROM writes…unless of course he is deliberately trying to destroy our company…what do you think?

PIC16F18856 datasheet
https://ww1.microchip.com/downloads/en/DeviceDoc/40001824B.pdf
 
Last edited by a moderator:

Difficult to explain a software routine without seeing it!
Is it possibly clearing all locations in the EEPROM by writing blank data to it? If that's the case, it should be rewritten to maintain a circular buffer with a stored address pointer and either a tail pointer or a data length variable to reduce stress.

Brian.
 
  • Like
Reactions: treez

    T

    Points: 2
    Helpful Answer Positive Rating
From the description of write operations in 10.4.3, it appears the write is self timed, so it should only apply the write voltage for the time needed to actually perform the write operation. Now the SW engineer should reduce the time they perform the erase-write cycle to improve the software performance, but it's doesn't seem to result in device failure like in the situation I dealt with. Are you sure they aren't polling the WR bit too slowly (or not using the interrupts).

Back in the old days the voltage to program was enabled separately from the write command and was enabled until disabled. There was a specification for duration of the programming voltage for the lifetime of the device. Once had a SW engineer single step their programming routine, killed the device the that first time they attempted to debug their code :-(.
 
  • Like
Reactions: treez

    T

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top