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 Torsten - 4.02.2013 19:38)
Als Antwort auf Re: ADC in Free Running Mode von PepeV - 2.02.2013 15:31
Ich nutze:
C-Control Pro Mega128
> > > Hi Torsten,
> > >
> > > Im am afraid the other running modes you programmed do not work so well
> > > as the free running mode.
> > > - ADCaptureRun runs 15% slower than ADCaptureRunFree and shows some
> > > glitches.
> > > - ADCaptureRunQuiet shows strange behaviour.
> > > See attached figures. What do you think?
> > >
> > > What might work is an 'ADCaptureRunFreeQuiet'.
> > >
> > > Regards,
> > > Pepe
> >
> > Hi Torsten,
> >
> > The ATmega128 manual (p. 237) says ADC Noise Reduction mode is only possible
> > in single conversion mode. So don't bother to try an 'ADCaptureRunFreeQuiet'.
> >
> > I now understand the reason for the $20 offset in SRAM addresses that is sometimes
> > needed. Instructions in and out work on I/O registers and start counting from $00 (PINF).
> > lnstructions ld and st reach all SRAM menory, including the working registers R0...R31.
> > For these instructions R0 has address $00 and therefore the first I/O register has
> > address $20. In CC-pro DirAcc_Read and DirAcc_Write also start counting from R0 so
> > here I/O addresses also need an offset of $20.
> >
> > 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.

>>This agrees with my observation that it does not
> > matter wether ADCaptureRunFree begins with cli or sei.
> > This also means that ADCaptureRun has no purpose since it cannot be interrupted.
> >
> > But I have a new challenge. My FFT routine needs its data in an array of float rather
> > than in an array of word. Would it be possible to adapt ADCaptureRunFree to store
> > its values in an array of float? I have searched internet for suitable chunks of byte code
> > but I could not find any. Do you know a good source?
> >
> > Regards,
> > Pepe
>
> Having browsed through the 'Beginners Introduction to theAssembly Language of
> ATMEL-AVR-Microprocessors' I now think that it might be better and faster to
> rewrite the FFT routine to work with integers than having ADCaptureRunFree
> to produce floats. What do you think? Here's the FFT routine I use.
>
> Pepe

I hope the author of this function understands also what he wrote.
I wish you a lot of fun during debugging. In this function many
divisions will calculated out. 'PI' also in not an integer value.
I think with integer values the function becomes very inaccurate.
I would recommend you for the first attempts a simple possibility.
Just count the ramps or the waves. When you, however, would be
insisting of a mathematical solution then we can go on with
some Cordic. But don't say, I have not warned you!
For the beginning I have collected some documents to read.

 GruÃ? Torsten
FSKDemodulation.zip




    Antwort schreiben


Antworten:

Re: ADC in Free Running Mode (von PepeV - 5.02.2013 13:27)
    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)