cancel
Showing results for 
Search instead for 
Did you mean: 

EEPROM Write Timing Problem

herangligergo
Associate
Posted on April 16, 2013 at 14:18

Hi,

I found a problem while writing to the EEPROM. The uC type is STM8af6289. This part of the program is the folowing:

initializing part:

void FLASH_Config(void)

{

    FLASH_SetProgrammingTime(FLASH_PROGRAMTIME_STANDARD);

    FLASH_Unlock(FLASH_MEMTYPE_DATA);

    while (FLASH_GetFlagStatus(FLASH_FLAG_DUL) == RESET);

}

main part program:

int main()

{

    FLASH_Config();

    while(1)

    {

        if(FLASH_GetFlagStatus(FLASH_FLAG_EOP)==RESET)

            {

            *(PointerAttr uint8_t*) (uint16_t)0x4001 = 0x55;

                

            }

        

        GPIO_WriteReverse(LED2_GPIO_PORT, LED2_GPIO_PINS);

    }

}

As it says, I should see on the oscilloscope a signal with 1-2 us timing. But I can see a square wave signal having about 50% duty cicle and the timing is about 10 ms.

Do anyone have an idea what should I do? Thank you for your help.

 

Gergo

#eeprom-rww
1 REPLY 1
elijah
Associate II
Posted on April 27, 2013 at 12:02

Never tried af series, but...

Possibly your CPU runs at low CPU frequency (something like 128 kHz internal oscillator) and all the timings are much longer than expected