avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] [Bug #2958] Error in iom16.h


From: Joerg Wunsch
Subject: Re: [avr-libc-dev] [Bug #2958] Error in iom16.h
Date: Thu, 27 Mar 2003 17:01:04 +0100
User-agent: Mutt/1.2.5i

As address@hidden wrote:

> Original Submission: The byte number 5 of ADCSR is named ADATE in
> the file iom16.h at line 513 but it should be ADFR like in all the
> other io include file of the avr that support the adc.

Sorry, that's wrong.

First, the various <avr/ioXXX.h> files are supposed to be
bug-compatible with Atmel's datasheets, i. e. they are not supposed to
be consistent across various different AVR devices.  Unfortunately, it
seems that Atmel quite frequently changes names of some bits between
devices (sometimes even between various datasheet revisions).  When
looking closer, the new names often make sense since they reflect a
changed implementation of the underlying hardware, but of course, they
are a nuisance to the programmer for AVR-to-AVR compatibility.

A file like <compat/io.h> has been suggested here to provide something
like a »smallest common denominator« between various AVR devices to
ease porting software between different AVRs.  So far, this file has
not yet been created, and i only can vaguely remember a single
submission of stuff that ought to be included there.

Second, if you carefully read the datasheet of the ATmega16, you'll
notice that this device is quite different from all other AVRs: its
ADC does /not/ provide the free-running mode that can be found on
other AVRs, but instead offers the option to trigger starting a
conversion using an external event.  This is reflected by the renamed
bit, and seriously, it's even more secure that way: if someone wants
to program the ADFR bit but doesn't find it, /hopefully/ he'll go and
read the datasheet to eventually see that he cannot use free-running
mode on the ATmega16...
-- 
J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]