Offline
Jr. Member
Karma: 0
Posts: 82
|
 |
« on: April 26, 2012, 06:33:17 am » |
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: 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
Shannon Member
Karma: 219
Posts: 13896
Lua rocks!
|
 |
« Reply #1 on: April 26, 2012, 03:56:52 pm » |
That looks OK to me. I tried that out and it worked.
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 72
Posts: 6837
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #2 on: April 26, 2012, 07:32:56 pm » |
You won't be getting much delay with < 2k of RAM though.
______ Rob
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 219
Posts: 13896
Lua rocks!
|
 |
« Reply #3 on: April 26, 2012, 07:58:14 pm » |
He would be introducing about a 250 nS delay there, maybe less.
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 72
Posts: 6837
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #4 on: April 26, 2012, 10:25:07 pm » |
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
|
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 82
|
 |
« Reply #5 on: April 27, 2012, 05:40:41 am » |
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
Brattain Member
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
|
 |
« Reply #6 on: April 27, 2012, 06:10:25 am » |
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.
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 82
|
 |
« Reply #7 on: April 27, 2012, 08:51:26 am » |
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
Brattain Member
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
|
 |
« Reply #8 on: April 27, 2012, 08:53:51 am » |
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.
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 82
|
 |
« Reply #9 on: April 27, 2012, 08:57:11 am » |
well what opportunities do i have to record those samples than?
|
|
|
|
|
Logged
|
|
|
|
|
Gosport, UK
Offline
Faraday Member
Karma: 19
Posts: 3117
|
 |
« Reply #10 on: April 27, 2012, 09:01:29 am » |
Not a lot, I suspect. A Mega with a QuadRam shield perhaps?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 82
|
 |
« Reply #11 on: April 27, 2012, 09:11:08 am » |
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
Brattain Member
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
|
 |
« Reply #12 on: April 27, 2012, 09:18:28 am » |
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.
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 82
|
 |
« Reply #13 on: April 27, 2012, 09:23:43 am » |
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
Brattain Member
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
|
 |
« Reply #14 on: April 27, 2012, 09:27:14 am » |
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.
|
|
|
|
|