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: Pro-Bot128 (von PeterS - 3.01.2012 18:19)
Als Antwort auf Re: ADC in free running mode von PepeV - 3.01.2012 13:24

> > 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


    Antwort schreiben


Antworten:

Re: ADC in free running mode (von PepeV - 4.01.2012 16:10)
    Re: ADC in free running mode (von PeterS - 4.01.2012 18:34)
        Re: ADC in free running mode (von PepeV - 4.01.2012 22:12)
            Re: ADC in free running mode (von PeterS - 5.01.2012 11:12)
                Re: ADC in free running mode (von PeterS - 5.01.2012 11:19)
                    Re: ADC in free running mode (von PeterS - 5.01.2012 11:32)
                       Re: ADC in free running mode (von PepeV - 5.01.2012 16:09)
                          Re: ADC in free running mode (von PepeV - 7.01.2012 13:45)
                             Re: ADC in free running mode (von PeterS - 7.01.2012 16:27)
                                Re: ADC in free running mode (von PepeV - 13.01.2012 11:55)