Show Posts
Pages: [1] 2 3 ... 6
1  Using Arduino / Audio / Re: arduino FHT on: April 11, 2014, 12:47:42 am
Thanks, and I'm also interested when I read 3 ADC will it have influence on sampling rate , I.e. 9,5 / 3 or just 9,5?
2  Using Arduino / Audio / Re: arduino FHT on: April 10, 2014, 10:03:46 am
OK, thank you for your response.
I'm interested in how to minimize 20khz reading freq to 2 or 3, and sampling rate also. I think that when I put delays between reading values it will only cause value update rate and not freq, or sampling rate.
3  Using Arduino / Audio / Re: arduino FHT on: April 09, 2014, 02:29:48 am
all right here is my experimental setup, where i've 3 resistors - VCC----<R1>--*--<R2>--**--<R3>----GND
R1 = R2 = R3 = 100ohm
where
* = adc0
** = adc1

void setup()
{
  Serial.begin(115200);
  ADCSRA = 0xe5;
  ADMUX = 0x40; // use adc0 - sends 681
  //ADMUX = 0x41; //sends -11072
  DIDR0 = 0x01; // turn off the digital input for adc0
}

void loop()
{
  while(!(ADCSRA & 0x10)); // wait for adc to be ready
  ADCSRA = 0xf5; // restart adc
  byte m = ADCL; // fetch adc data
  byte j = ADCH;
  int k = (j << smiley-cool | m; // form into an int
 
  Serial.println(k);
  delay(100);
}

here is my code which works fine in new named sketch and in old sketch where i worked i copy pasted this code uploaded on uno, but values are same for adc0 and adc1. something mysterious happens.
4  Using Arduino / Audio / Re: arduino FHT on: April 08, 2014, 04:12:36 pm
OK now I access directly to variable k, and results are same. If you have answer why don't you just tell me ?
5  Using Arduino / General Electronics / Re: autooscilating oscillator on: April 08, 2014, 12:07:31 pm
thank you very much i've purchased AD9850 and i'll try it out.
6  Using Arduino / General Electronics / autooscilating oscillator on: April 08, 2014, 10:48:51 am
I'm not sure if name is right but I'll try to write main idea of the device I want to make.

In my lab I have signal generator, which has such function. For example I can vary oscillator frequency from 100 to 800 khz in 1ms. And it works great.

I would like to make such generator, which will operate like described. My main point is that this device has to be compact and if it would be microcontroller based, I think that's would be great. And I thing max frequency to be less than 1 mhz.

Have you any suggestions ? Thanks in advance.
7  Using Arduino / Audio / Re: arduino FHT on: April 08, 2014, 10:24:02 am
I think that it works for adc0 because I tested out voltage divider and it gave me true value.

Can you tell me why it doesn't work? I would be very thankful
8  Using Arduino / Audio / Re: arduino FHT on: April 08, 2014, 05:55:38 am
i think my mistake is that i didn't convert values Accordingly?

but if it works for adc0 why now for adc1 ?
9  Using Arduino / Audio / Re: arduino FHT on: April 07, 2014, 10:59:35 am
0 is index, if I read k variable I have same results
10  Using Arduino / Audio / Re: arduino FHT on: April 07, 2014, 02:17:04 am
0x41 = 0b01000001; right? So I think that it will give me same result bit I'll try it out. I use open music's lab code. Thank you very Mich for your response. I'll write my results down.

Code:
void setup()
{
  Serial.begin(115200);
  TIMSK0 = 0;
  ADCSRA = 0xe5;
  ADMUX = 0x40; // use adc0
  //when i change DAMUX = 0x41; //use adc1
  //same results are coming as in adc0
  DIDR0 = 0x01;
}

void loop()
{
  while(index == 1)
  {
    T = micros();
    cli();
    while(!(ADCSRA & 0x10));
    ADCSRA = 0xf5;
    int k = ADCL;
    k = (ADCH<<8) + k;
    data[0] = k;
    sei();
11  Using Arduino / Audio / Re: arduino FHT on: April 06, 2014, 02:52:45 pm
when i assign ADMUX = 0b010000001; this means that i use ADC1 but, finally ADCL and ADCH register processing gives me ADC0 value. i cant understand why ?
12  Using Arduino / Audio / Re: arduino FHT on: April 06, 2014, 01:07:49 am
I've read the details, and as I understand I choose ADC channels using admux, and read them using arch and adcl bytes, but when I assign admux register to read second channel on atmega328 nothing valuable happens, and please if you can, just give me some example.
13  Using Arduino / Audio / Re: arduino FHT on: April 05, 2014, 03:28:42 pm
OK, thank you very much.
I'm bit confused, how can I read adc1 and 2, after I read adc0, I mean code?
14  Using Arduino / Audio / Re: arduino FHT on: April 04, 2014, 11:26:57 am
Yes, that's the question, can this library used as square wave analyzer @ <20 kHz?
15  Using Arduino / Audio / Re: arduino FHT on: April 04, 2014, 10:39:25 am

As I understand I need to read each analog pin (for ex. 0 to 2) independently process this data and then output ? I.e do the following routine for every analog input?
And if I want to lower sampling rate and frequency spectrum (from 18.5 to 4/5khz?)
and what about square wave input ?
Pages: [1] 2 3 ... 6