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 > > >> Hi Torsten, > > > > Glad you want to help me. Let's see if we can figure this out together. > > I have come to some conclusions: > > 1. According to the C-Control-pro manual, an assembler call cannot be interrupted. > > So there is no need anymore to disable the global interrupt flag. > > Hello Pepe, > > (1) > I do not believe, PeterS switches off the interrupt functions > before every assembler call. Certainly the callback functions > won't be execute anymore. But the interrupt functions are still > active. > > > 2. I think saving and restoring SREG is only needed in case of an interrupt routine. > > So we can leave out these instructions. > > (2) > I don't know. I never saw a 'cli' without > a saving from 'SREG'. > > > 3. The ATmega128 manual, p. 233, last line but three, says: "The first conversion > > must be started by writing a logical one to the ADSC bit in ADCSRA." > > So we need to set ADSC only once, before entering the loop. > > (3) > That's right, but only in free-running-mode. > > > 4. I increased the addresses of ADMUX, ADCSRA, ADCH, ADCL and SREG with > > 0x20 as should. The new addresses are out of range of the instructions in, out, cbi, > > sbi and cbis. This causes the compile errors I mentioned. These instructions will > > have to be replaced by combinations of others ("typically lds and sts combined with > > sbrs, sbrc, sbr, and cbr"). > > I could try to work this out (maybe Sunday) but I would appreciate your solution > > very much. > > (4) > I am using the definitions from the 'm128def.inc' file. > This file comes with the AVRStudio. So I can exchange > the assemblercode between the C-Control-IDE and the AVRStudio. > I have never a problem with this. The AVRStudio has > a very nice debugger. I would recommend very much > to try the AVRStudio. > > Try ADCapture-0.02 below. > > Gruß Torsten > > > > > Regards, > > Pepe