0
\$\begingroup\$

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.

\$\endgroup\$
1
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ Thank you for detailed answer. How to use internal DMA? Do I need to modify my hardware to include DMA controller? Please advise. \$\endgroup\$ – Electroholic Jul 30 '15 at 13:18
  • \$\begingroup\$ Well I don't know what mcu you are going to use put many of the more popular ones include one or two Dma controllers. You can even search and filter for them on their website. \$\endgroup\$ – Some Hardware Guy Jul 30 '15 at 14:00
  • \$\begingroup\$ I am using LPC2138, my question is, Is there any hardware interfacing involved for DMA interface. Flash IC is on SPI interface, so do I need to assign it to DMA interface /pins? \$\endgroup\$ – Electroholic Jul 30 '15 at 14:20
  • \$\begingroup\$ I don't see a DMA controller in that part, just for an example look at this part microchip.com/pagehandler/en-us/family/32bit/… See how it has an 8 channel DMA inside? In that case the DMA channel accesses SPI using the memory address of the SPI controllers in and out registers. \$\endgroup\$ – Some Hardware Guy Jul 30 '15 at 14:50
  • \$\begingroup\$ Can we connect 2 flash on same SPI interface with separate CE (Chip Enable). Is this possible? I don't have other spi free, hence can connect it with same SPI for both requirements. \$\endgroup\$ – Electroholic Jul 30 '15 at 16:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.