Pages: [1] 2 3   Go Down
Author Topic: Audio Delay  (Read 4261 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 82
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello there,
I try to make an audio delay with one teensy 1.0, a dac and an adc.

Now to test the circuit i just want that the Byte from pins B0-B7 on the teensy are given over to the PORT D (D0-D7)

To do this kind of byte bypass I tried the following code:
Code:
void setup() {
 DDRD = 0xff; // set PORTD to all outputs - digital pins 0 - 7
 DDRB = 0x00;
}

void loop() {
 PORTD = PINB; // play back sample   
}

Is there anything wrong with this code? It should just make PORTD the same as PORTB

-Flo
Logged

Global Moderator
Melbourne, Australia
Offline Offline
Brattain Member
*****
Karma: 511
Posts: 19367
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That looks OK to me. I tried that out and it worked.
Logged

http://www.gammon.com.au/electronics

Please post technical questions on the forum - not to me by personal message. Thanks a lot.

nr Bundaberg, Australia
Online Online
Tesla Member
***
Karma: 130
Posts: 8625
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You won't be getting much delay with < 2k of RAM though.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Global Moderator
Melbourne, Australia
Offline Offline
Brattain Member
*****
Karma: 511
Posts: 19367
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

He would be introducing about a 250 nS delay there, maybe less.
Logged

http://www.gammon.com.au/electronics

Please post technical questions on the forum - not to me by personal message. Thanks a lot.

nr Bundaberg, Australia
Online Online
Tesla Member
***
Karma: 130
Posts: 8625
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yep, we need to know what this is for because audio delay lines are normally in the seconds.

_____
Rob
« Last Edit: April 27, 2012, 07:00:46 am by Graynomad » Logged

Rob Gray aka the GRAYnomad www.robgray.com

Offline Offline
Jr. Member
**
Karma: 0
Posts: 82
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello,
thank you for your answers. Well i didnt think about the memory yet.
Is it possible to use an sd card or external memory on dip chips??
even if the sd card is slow in reading and writing i have the buffer of the internal memory ...

edit : i just looked in the datasheet of the at90usb162 from atmel. it has 16kb internal flash memory.

if I just handle 8 bit data with a sample speed of 48kHz this menas i would have 16/48 (about 330ms) seconds sampletime if i think the right way.
thats something to start with i think.

-Flo
« Last Edit: April 27, 2012, 05:46:09 am by Flub » Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 310
Posts: 26638
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
i just looked in the datasheet of the at90usb162 from atmel. it has 16kb internal flash memory.
And did the datasheet tell you what the programming speed and write/erase lifetime was?
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 82
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.atmel.com/devices/at90usb162.aspx?tab=parameters

thats all i know. i could not find anything concerning the memory speed.
the external memory thing should work if it is too slow or what is wrong with this idea?

btw: i just read that flash memory will die after about 10 000 times deleting a bit, does this mean arduinos and other micro controllers will die after being on for a while?
« Last Edit: April 27, 2012, 08:56:06 am by Flub » Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 310
Posts: 26638
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, for starters , the flash memory is program memory, and is only writable from the boot area (assuming the device supports self-programming), and secondly, it's only normally rated for 10 000 erase/write cycles.

Datasheet
« Last Edit: April 27, 2012, 08:55:42 am by AWOL » Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 82
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

well what opportunities do i have to record those samples than?
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Not a lot, I suspect. A Mega with a QuadRam shield perhaps?
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 82
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

isnt it possible to just use a slower memory type like sd cards (how fast is it actually?) and buffer the samples in the internal memory, so there is more time to save them on the external memory.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 310
Posts: 26638
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
so there is more time to save them on the external memory.
You have to read and store your input samples, and read and write out your output samples in under 21us average.
Do the arithmetic.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 82
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yeah but to do it i need to know how fast the sd write and read process it , this is what i cannot find
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 310
Posts: 26638
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A further little thought-experiment.
Assume you'll need double-buffered input and output of a minimum of one sector each.
That's 2048 bytes just for the buffers.

This buys you 21 * 512 = just under 11ms.
« Last Edit: April 27, 2012, 09:29:59 am by AWOL » Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Pages: [1] 2 3   Go Up
Jump to: