Go Down

Topic: Arduino uno audio delay project (Read 11572 times) previous topic - next topic

CrossRoads

Dual port RAM not really needed, Arduino can only read or only write at 1 time.
So read ADC, write to RAM, at later time read from RAM and write to DAC.
If you had parallel address/data, then data could be present on ADC output and used as RAM data input while Arduino provided address lines.  Then same for reading the RAM - Arduino provides the address while data from RAM was latched directly in to the DAC.
Serially, things will be slower of course. For best results use SPI capable parts.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

UnoDueTre


Dual port RAM not really needed, Arduino can only read or only write at 1 time.


True, but makes it much easier if one wants to have a  ring buffer where the sampled audio from the ADC is fed to one port of the RAM and it's available at the other port for playback so would minimize code overhead especially if the OP was using parallel ADC and DAC.

CrossRoads

Agreed. Took a look at Dual port SRAM tho - ridicuoulsy expensive, even for small chips
http://www.digikey.com/product-search/en/integrated-circuits-ics/memory/2556980/page/3?k=dual%20port%20ram&stock=1&ColumnSort=1000011
Large parallel SRAM much cheaper - couple of x8 chips, couple of shift registers loaded via SPI, or maybe counters that are incremented to hold the address, kind of a roll  your own dual-port SRAM at much less cost.
http://www.digikey.com/product-detail/en/SN74HC590ADR/296-17132-1-ND/664654
One pair to hold the write address, one pair to hold the read address.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

UnoDueTre

#18
Dec 19, 2013, 10:14 pm Last Edit: Dec 19, 2013, 10:31 pm by UnoDueTre Reason: 1
Wow, they are like 30 bucks each on average.
I used some dual port RAM several years back and expected them to be around the 5 or 10 buck mark by now.

I like the idea of rolling your own.

EDIT:

Found some as low as 4 bucks at Future Electronics

http://www.futureelectronics.com/en/Search.aspx?dsNav=Ntk:PlainTextSearch|dual+port|3|,Ny:True,Nea:True,N:749

Here is one at 12 bucks which is 8K X 8 which would give the OP about 1 sec worth of sampling (as he original asked for) at a rate of 8KHz.
http://www.futureelectronics.com/en/technologies/semiconductors/memory/dual-ports/Pages/7016166-CY7C144E-55JXC.aspx?IM=0

UnoDueTre

Although once we get to the $12 mark, it's probably easier to just get one of these:

http://ruggedcircuits.com/html/megaram.html

Grumpy_Mike


i think one of these would be a good ram for this project, but i dont really know... im gonna have to do research on them and on ram chips... i heavent really used them before. maybe you could introduce me or give some links to where i could read about them?

https://www1.elfa.se/data1/wwwroot/assets/datasheets/fm24c64b_eng_ds.pdf
https://www1.elfa.se/data1/wwwroot/assets/datasheets/zsLyontek_SRAM-LY6264_EN.pdf

Neither of those is suitable.
The fm24c64b has an I2C interface which is too slow for your application and the other is a parallel interface which will gobble up too many pins. Look for something like the fm24c64b but with an SPI interface. That goes for the other two components as well, the A/D and D/A although you could probably get away with the internal A/D.

UnoDueTre

Have a look at the MCP3201 and MCP4921.

Kitax


Have a look at the MCP3201 and MCP4921.


tnx... i eaven have these at my local supplier :)

only now i will have to learn how it works all over again, but i kind of like doing that ^^

Kitax

#23
Dec 20, 2013, 09:39 pm Last Edit: Dec 20, 2013, 09:41 pm by Kitax Reason: 1

Although once we get to the $12 mark, it's probably easier to just get one of these:

http://ruggedcircuits.com/html/megaram.html


i mentioned earlier that i need this for a school project... i have to make the device starting from the etching of the board to soldering all the elements and testing it... so that one would be awesome for me to play around with, but not this time :)

also i dont really know if i can use smd for it, thats why id prefer DIP...

Kitax


Wow, they are like 30 bucks each on average.
I used some dual port RAM several years back and expected them to be around the 5 or 10 buck mark by now.

I like the idea of rolling your own.

EDIT:

Found some as low as 4 bucks at Future Electronics

http://www.futureelectronics.com/en/Search.aspx?dsNav=Ntk:PlainTextSearch|dual+port|3|,Ny:True,Nea:True,N:749

Here is one at 12 bucks which is 8K X 8 which would give the OP about 1 sec worth of sampling (as he original asked for) at a rate of 8KHz.
http://www.futureelectronics.com/en/technologies/semiconductors/memory/dual-ports/Pages/7016166-CY7C144E-55JXC.aspx?IM=0


can you please explain exactly how to calculate that?

Grumpy_Mike

Quote
can you please explain exactly how to calculate that?

8K of memory at a sample rate of 8K per second gives a time of 1 second. Kindergarten maths.

say you had 16K of memory and filled it at 8K per second how long would it take you? ( 2 seconds ).
In fact for what you want it is more like a quarter of a second for the effect you are after.

Kitax


Quote
can you please explain exactly how to calculate that?

8K of memory at a sample rate of 8K per second gives a time of 1 second. Kindergarten maths.

say you had 16K of memory and filled it at 8K per second how long would it take you? ( 2 seconds ).
In fact for what you want it is more like a quarter of a second for the effect you are after.


oh ok i see... its all in the datasheet... if you know where to look at ^^

UnoDueTre

The memory size and organization (8, 16 bits) is in the datasheet, the rest as Grumpy Mike wrote is just maths.

If the memory size is 8Kbytes and you are sampling at 8KHz (taking 8K readings per second) then the memory will be full in just over one second.
Remember that 8KHz is 8000 whilst 8Kbytes is 8192 bytes, so 8192/8000 = 1.024 seconds.

elac

Ever think of using a dedicated delay chip with an UNO?
Such as one of these: V3207, V3208D or V3205SD
Or the more expensive Panasonic MN3200 series like the MN3205
It's all about the skills

Grumpy_Mike

But those BBD devices are very small, only at most 4K of samples. That is only quarter of a second delay at any decent sample rate.
If you have ever tried using them you will find that it is very difficult to get the shift noise out of the system.

Go Up