Kommentar: Einfügen von HTML im Kommentar: Link einfügen: <a href="LINKURL" target="_blank">LINKTITEL</a> Bild einfügen: <img src="BILDURL"> Text formatieren: <b>fetter Text</b> <i>kursiver Text</i> <u>unterstrichener Text</u> Kombinationen sind auch möglich z.B.: <b><i>fetter & kursiver Text</i></b> C Quellcode formatieren: <code>Quellcode</code> BASIC Quellcode formatieren: <basic>Quellcode</basic> (Innerhalb eines Quellcodeabschnitts ist kein html möglich.) Wichtig: Bitte mache Zeilenumbrüche, bevor Du am rechten Rand des Eingabefeldes ankommst ! -> I > > > > 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