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 > > > Hello Pepe, > > > > > > you can use the DirAcc_Write() to bring the chip to ADC free running mode. Use the > > > necessary intializations that are described in the datasheet. > > > > > > Regards, > > > > > > Peter > > > > Hi Peter, > > > > Could you please help me a little bit further as I am not familiar with this kind of programming. > > > > The datasheet says: > > Free Running mode is selected by writing the ADFR bit in ADCSRA to one. The first conversion > > must be started by writing a logical one to the ADSC bit in ADCSRA. > > > > Now in the Register Summary there are given 2 adresses for ADCSRA: $06 ($26). Which one > > should I use? > > > > The bits to write are: > > • Bit 5 – ADFR: ADC Free Running Select > > • Bit 6 – ADSC: ADC Start Conversion > > > > If I want to set bit 5 and leave the other bits unchanged, what should I do? My guess is: > > 1. Read the register value > > 2. OR this value with 0b00100000 > > 3. Write the result to the register > > Is this correct? > > > > Regards, > > Pepe > > Sorry Pepe, > > I have not programmed "free running" for an ATMega, only for an ATTiny some years ago. > When I have time to read the datasheet, I will tell you. > > > 1. Read the register value > > 2. OR this value with 0b00100000 > > 3. Write the result to the register > > If you have chosen the right bit, these steps are correct. > > Regards, > > Peter