Zur Übersicht - INFO - Neueste 50 Beiträge - Neuer Beitrag - Suchen - Zum C-Control-I-Forum - Zum C-Control-II-Forum

Re: ADC in Free Running Mode Kategorie: Programmierung C (von PepeV - 5.02.2013 13:27)
Als Antwort auf Re: ADC in Free Running Mode von Torsten - 4.02.2013 19:38
Ich nutze:
C-Control Pro Mega128, Pro-Bot128
> > > The CC-pro manual states 'An Assembler call cannot be interrupted by Multithreading
> > > or an Bytecode Interruptroutine'.
>
>  Hello Pepe,
>
> but the cpu can do that. The so-called 'Bytecode Interruptroutinen'
> are not real Interruptroutinen. The real interrupt-functions are
> fixed functions. We unfortunately can not change these functions.
> Presumable, in these functions will be only a byte-variable
> increased. The bytecodeinterpreter checks occasionally this
> variables and calls your callbackfunction. That is the reason for
> your actual problem.
>

Hi Torsten,

Are you sure about the above? I would think that the bytecode interpreter
stores the address of an interrupt routine in the address of the corresponding
Interrupt Vector. Then an interrupt makes the Program Counter jump to
the corresponding Interrupt Vector which then directs the PC to the address
of the interrupt routine. So I would say a 'bytecode interrupt routine' is a real
interruptroutine.

Anyway, it is my experience that ADCaptureRunFree is not interrupted, whether
it begins with cli or sei.

About the frequency detection: I think counting ramps as you do in your demo
is not discriminating enough for noises like a closing door or someone speaking.
The FFT routine I have works perfectly. With it I can make the robot respond to
the 15 tones of a plastic flute. But even 50 or 100 tones would be no problem.
I only would like to have it consume less time so that the robot has time to do
other tasks than listening too. Now it takes more than 300 ms for 128 data points.

I have tried to rewrite the FFT routine with integers but failed. I achieved a little
speeding up by replacing the sin and cos functions with a look up table. But as
these functions are called relatively seldom, the improvement is only 10 or 20 ms.
So this route is a dead end.

The problem I am left with, is that the FFT routine needs its data in an array of
float. What I do now is copy the array of word that I get from ADCaptureRunFree
to an array of float. But this costs precious RAM memory. Could you help me
adapt the ADCaptureRunFree to store its values in an array of float?

Regards,
Pepe


    Antwort schreiben


Antworten:

Re: ADC in Free Running Mode (von Torsten - 6.02.2013 21:43)
    Re: ADC in Free Running Mode (von PepeV - 8.02.2013 17:43)
        Re: ADC in Free Running Mode (von Torsten - 9.02.2013 10:18)
            Re: ADC in Free Running Mode (von PepeV - 9.02.2013 14:57)
                Re: ADC in Free Running Mode (von PepeV - 11.02.2013 18:29)
                    Re: ADC in Free Running Mode (von Torsten - 11.02.2013 21:07)
                       Re: ADC in Free Running Mode (von PepeV - 12.02.2013 19:54)