Show Posts
Pages: [1] 2
1  Using Arduino / Audio / Re: Arduino DDS Sinewave Generator on: September 07, 2011, 01:35:43 am
        Is it possible to have a three phase sine wave with this generator ?
        I would like to generate a 10 kHz to idealy 18 kHz three phase wave.
        Does miro-Hertz precision will pertain with this change ?

ten Khz is anyway a problem, the atmega is to slw for that. using a dedicated DDS chip would be a solution
maybe some manufactor has a 3 phase version.

2  Topics / Interactive Art / Theremin as a Capacitive Sensing Device on: July 08, 2011, 09:27:06 am

I've followed your tuto to build the theremin with the arduino.
I've bought all the component today.
And it just don't work. smiley-sad
I'm using a mac with the last version of arduino (0021) and a Arduino mega 1280.
I'm using a breadboard and a steel wire (about 1mm length)
I've check the schematic 10 times and everything seem to be alright.
It drives me crazy!

its a problem with the mega 1280

the frequency input is fixed to the t1 timer input on the mega 8/168/328
in the code:
int pinFreq = 5;

the mega 2560 and 1280 has this pin not mapped to the pin header
you can try to solder a thin cable directly to that pin or just use a arduino uno.

3  Using Arduino / Audio / Arduino Realtime Audio Processing on: June 20, 2011, 02:39:30 am

I have one question about the input circuitry. I would like to know how you adjust the 10k trimpot to set the DC offset to 127?

- run the loopback test sketch
- open the serial monitor window with 57600 baud
- after reset the actual value is shown "ADC offset=127"

this is the code section in setup()
  Serial.print("ADC offset=");     // trim to 127

4  Topics / Science and Measurement / Frequency Counter Library on: June 17, 2011, 02:05:18 am
i like to continue the thread from the old forum here

5  Using Arduino / Audio / Arduino DDS Sinewave Generator on: June 17, 2011, 01:27:09 am

has anyone tryed to run this code on a Mega 1280

since i have not such a board i cant check where the problem is.
my suspicion is the timer2 unit, please compare in both datasheets the register description of timer2.

6  Forum 2005-2010 (read only) / Development / Re: Frequency Counter Library on: December 08, 2010, 03:04:48 am
The gatetime in ms is responsible for the resolution
FreqCounter::start(100);   you get 10Hz
FreqCounter::start(1000);  you get 1Hz resolution

i also build a LC meter. its working very nice with the lib.

7  Forum 2005-2010 (read only) / Development / Re: Frequency Counter Library on: October 01, 2010, 09:35:24 am
i removed a glitch in the library which led to deviations in the measurement from time to time. also the atmeg328 is supported now.
get the library here :

8  Forum 2005-2010 (read only) / Development / Re: Frequency Counter Library on: June 23, 2010, 10:35:21 am
i dont know, its written for 168/328 . when i get my mega1280 i try it out
9  Forum 2005-2010 (read only) / Development / Re: Frequency Counter Library on: June 23, 2010, 04:03:45 am
I released a new frequency library which is based on a period measurement. The advantage is that it is faster and more accurate in audio and  sub audio range.

10  Forum 2005-2010 (read only) / Development / Re: Frequency Counter Library on: May 19, 2009, 04:53:10 am
It should be pin pd6(T1) it looks like it is not connected to the header.
11  Forum 2005-2010 (read only) / Development / Re: Frequency Counter Library on: February 06, 2009, 03:18:06 pm
Hi again,
there is still something what i observed and forgot to say. If you make a Serial.print and afterwards start the counter you get faulty values. This is because the Serial.print emptys the transmit buffer interrupt driven and slows down the timer2 process. To overcome this effect put a delay after the print to allow all characters to be send before you start the counter.
12  Forum 2005-2010 (read only) / Development / Re: Frequency Counter Library on: February 06, 2009, 03:04:58 pm
Hi Kyle,
so is it running smooth now after you made these changes ?
I would like to update the lib .
13  Forum 2005-2010 (read only) / Development / Re: Frequency Counter Library on: February 06, 2009, 03:36:34 am
Hi Kyle,
you are right, the overflow has to be checked twice in the interrupt. But how can be there glitches at 2 and 4 Mhz ? When i checked for glitches i was looking for the more suspicious  frequencies at multiple of 65636 Hz  but couldn't find any mayor deviations. maybe it has to do something with the timer1 input circuit. The signal is sampled with the system clock at 16 Mhz. When the duty cycle of the input signal  is too small, pulses are dropped.

To minimize any latencies      in the timer2 interrupt i would not put the code for  checkOverflow() in a function . All the push's,  pop's and stack operations in a function call are costing to much time in my opinion. In an other project based on the Bascom compiler i did the interrupt code for further optimisation  in inline assembler but doing this in c is rather difficult ( for me). Maybe there is someone in the Forum to show us how that works.

14  Forum 2005-2010 (read only) / Development / Frequency Counter Library on: January 07, 2009, 06:04:57 am
On the Arduino Playground :: Code Library and Tutorials ::  we published a Frequency Counter Library. Would be nice if somebody who is familiar with interrupthandling within libraries have a look over it.

15  Forum 2005-2010 (read only) / Development / Re: Arduino Realtime Audio Processing on: November 17, 2010, 04:42:06 am
Hi Brandon,
i just want to try to give some answers to your questions

1. 8/10 Bit ADC
at higher sampling rates the accuracy of the ADC decrease ( the datasheet says so but what resolution at what samplerate is not clear) but we can use 8 bit only anyway because int arithmetic and storing int sample values would be to slow and the space in ram is limited anyway

2. PORTB = PORTB | 1
  this is a faster substitution for digitalWrite(pin8 , Hi); it was just for debugging purposes , i connectet a scope to that pin to observe the timeing of the interrupt process.

3.  div32  
i did not use  the ADC interrupt here, the timer 2 controls the ADC speed. we have a PWM output on timer2 so sampling and DAC output is synchronized to PWM. div32 divides the 62 KHz interrupt by 2 div 16 again by two to sample channel 0 and 5 alternately so we have a effective sample rate of 15 KHz per channel.


Pages: [1] 2