Flash IC memory mapping for two application

flashmemory

I am referring biomedical instrument where I need to save result of a reaction in a flash IC ( SST25VF020 2 MBit serial flash ). In the same application, I am using Voice Guide Assistant where I need to save voice in memory to play it while operating instrument.

My query is, can we use single flash IC ( for eg. SST25VF020 or so ) for storing result and voice at the same time? Is there any issue while implementing it in hardware/software? Is this logically possible?

(I can increase memory size of IC by choosing higher size chip, it's not an issue)

Thank you.

Best Answer

You should be able to do this just storing your data in different memory locations. You might want to look at write protecting the sectors with audio.

The only downside to consider is erase times you can erase the whole chip with a chip erase command in 70ms, but if you are using a section for audio you have to erase sector by blocks which takes 25ms per 32KB. Maybe not an issue for you but it's something I've had to consider recording audio to spi flash.

Last word of advice, playing back audio clips is a real time thing. You have to run your spi interface fast enough to meet the output sample rate of your DAC/i2s codec, pwm or whatever your output is. Also you don't want to be interrupting the mcu in the middle of it.

A lot of people, me included, use an internal DMA engine to accomplish this instead of involving the CPU. Last audio record and playback project I used one of the pic32 parts with i2s interface this way and it worked pretty well.