cancel
Showing results for 
Search instead for 
Did you mean: 

STM8S105 Flash Read/Write Access Speed (sanity check for slow access)

jimb
Associate II
Posted on December 10, 2009 at 12:59

STM8S105 Flash Read/Write Access Speed (sanity check for slow access)

3 REPLIES 3
jimb
Associate II
Posted on May 17, 2011 at 15:06

Operation: 1 byte write takes 3.6ms - see code sequence below

FLASH_Unlock(FLASH_MEMTYPE_DATA);

FLASH_EraseByte(flash_address);

FLASH_ProgramByte(flash_address, value);

FLASH_Lock(FLASH_MEMTYPE_DATA);

return(value);

Operation: 1 byte read takes 3 ms - see code sequence below

FLASH_Unlock(FLASH_MEMTYPE_DATA);

value = FLASH_ReadByte(flash_address);

FLASH_Lock(FLASH_MEMTYPE_DATA);

return(value);

Setup of clk

HSI is 16Mhz

Fcpu is 4Mhz

Question

1) Should the unlock/erase/write/lock cycle take approximately 3.6ms

2) Should the unlock/read/lock cycle take approximately 3.0ms - seems very long

3) To read the data memory flash do I need to unlock the flash

jimb
Associate II
Posted on May 17, 2011 at 15:06

All,

Re: Answer to my question

1) Reading flash does not require the unlock

2) Reading flash is fast -0 microseconds as expected

3) The STM8S has the RWW ability so to write one byte is very fast if you only write one byte and move to other code functions

4) In the STM8S to write two bytes you move from micro seconds to milliseconds

mozra27
Associate II
Posted on May 17, 2011 at 15:06

Hi

tprog: Standard programming time(including erase) for byte/word/block (1 byte/4 bytes/128 bytes) = 6.6 ms

Regards

mozra