i want to make an audio delay tool, and i have never worked with ad and da converters. i learned quite a bit from PCF8591 datasheet, but i still have many questions.
my idea is to take two PCF8591 chips, one to do the a to d and other one from d to a conversion and a ram memory to store the digital audio signal for a short time... i'm thinking from 0 to 1 sec.
here comes in the arduino uno. i need it to drive both chips, and i heaven't done research on RAM chips, but i'm guessing that too
so i was wondering what frequency do i need to run those chips to achieve listenable audio signal, and is the 4 MHz frequency (from attiny) enough?
has anyone done this before?
how do i calculate the max delay i can get? (im guessing it would have to be the amount of memory i have devided by the frequency times the amount of bytes i send)
o i was wondering what frequency do i need to run those chips to achieve listenable audio signal, and is the 4 MHz frequency (from attiny) enough?
4MHz is overkill for audio (Typical bandwidth of audio is 20kHz)
However, assuming you plan on using the Tiny's own ADC to sample the audio, you won't be able to achieve much better than telephony quality (3kHz bandwidth)
4MHz is overkill for audio (Typical bandwidth of audio is 20kHz)
However, assuming you plan on using the Tiny's own ADC to sample the audio, you won't be able to achieve much better than telephony quality (3kHz bandwidth)
Kitax:
does that mean that i can get the 20kHZ frequency?
No, see attached below (from PCF8591).
Plus, where are you going to store the samples?
The Arduinos don't have much RAM.
EDIT:
Since the max sample rate is 11KHz, it means your max input frequency is just over 5KHz, couple this with the 8 bit resolution and it will sound pretty dreadful.
well i want it to delay human voice, so the 5 kHz max frequency isnt bad i guess.
as for the 8-bit sound, i think i just need to make it understandable, so i think that will work as well
i am going to use a RAM chip because i know that arduino doesnt have much RAM
(have you ever tried to talk while hearing your voice with a delay? it is really hard, and that is what i am trying to make, headphones that delays your voice and plays it back, so i guess the 8-bit sound would do just fine)
well i have to make a school project, and im considering this one
i heavent actually looked into ram yet, but i will. i think, that the one attiny 2313 can drive all 3 of the chips, but if it cant i guess i can just get another one, i guess...
18 IO pins:
reset
serial in for debug
serial out for debug
xtal 1 need to use external crystal for 16 or 20MHz operation
xtal 2
leaves 13 pins
SCK, MISO, MOSI - needed for high speed transfers to ADC, DAC, SRAM
ADC chip select
DAC chip select
SRAM chip select
down to 7 pins
So IO wise you would seem to be okay.
However, look at these numbers for 2313:
– 2K Bytes of In-System Self Programmable Flash
– 128 Bytes In-System Programmable EEPROM
– 128 Bytes Internal SRAM
I think you will really struggle to get your code working with that few resources.
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?
Admittedly I haven't looked in detail at the chips you provided links for, but one thing to keep in mind, whenever you use a chip that may be a bit more specialized, always first check availability and price before committing any time or effort to a design that uses the part.
UnoDueTre:
Admittedly I haven't looked in detail at the chips you provided links for, but one thing to keep in mind, whenever you use a chip that may be a bit more specialized, always first check availability and price before committing any time or effort to a design that uses the part.
already did it... i chose these chips because they are available for a reasonable price, and i picked 2 different ones of which i think at least one would work for me, and this time i guess it will be
That would be a good RAM for Storing data.
Your code will not execute from that RAM tho - only from the internal SRAM, the 128 bytes in a '2313 that are used for registers and stuff.
CrossRoads:
That would be a good RAM for Storing data.
Your code will not execute from that RAM tho - only from the internal SRAM, the 128 bytes in a '2313 that are used for registers and stuff.
i know that... preveously i said about storing the 8 bit audio i converted to play it a bit later (a few microseconds or so, preferably up to second, but i know it is quite a bit of data and i dont know exactly how much delay i can get from it) the whole point of the conversion is to get that delay. i just wanted to play around with DAC and ADC and data storage to get better knowlage of how they work.
user named UnoDueTre, posted a picture of exactly what i wanted to make from the beginning
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.
CrossRoads:
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.