diff --git a/pic/MDR/MDR.c b/pic/MDR/MDR.c index d362e2c..3124ec9 100644 --- a/pic/MDR/MDR.c +++ b/pic/MDR/MDR.c @@ -233,6 +233,7 @@ void save_code() void clear_memory(void) { uint16_t address; + uint16_t wait; /* go through memory */ for (address=0; address<0x7FFF; address++) { if ((address%0x40)==0) { /* select page */ @@ -253,6 +254,9 @@ void clear_memory(void) send_byte(0x00); /* clear byte */ if ((address%0x40)==0x3f) { /* end of page */ send_stop(); /* finish transaction */ + for (wait=0; wait<1024; wait++) { /* wait for eeprom to be writen */ + wait; + } } } }