Everything I read says that the ATmega328 can provide 40mA per pin. However when I've measured the actual current provided by one pin it was showing 80mA. It was the same on every pin I tested. Anyone else noticed this? Or is it just unique to this specific one?
You must distinguish between "guaranteed operating conditions" and "absolute maximum ratings". Also between current from an eg a logic high output pin at a usefully high voltage and short circuit current from a pin.
At 80 mA you are exposing the IC to conditions that exceeds the manufacturer's guarantees for product survival and the manufacturer explicitly advises that such practices may cause permanent damage to the IC.
Operating and Absolute-maximum figures
Manufacturers publish data that tells you what conditions they guarantee a device will meet in practice when operating normally. They also publish absolute maximum ratings for a device, beyond which damage to the device may occur.
On pages 519 and 520 are tables that specify the voltage and current output conditions which Atmel guarantees. Not that as current increases the voltage drops due to increased voltage drop across the internal circuitry. They do not specify what current you can get when you load a high output pin down to almost 0 Volts - but you can be sure it would be more than the maximum guaranteed figure and that it would probably risk damaging the IC.
The most important specification with respect to your question is on page 317 of the ATmega328 datasheet
29.1 Absolute Maximum Ratings*
DC Current per I/O Pin ................................................ 40.0mA
- NOTICE Stresses beyond those listed under “Absolute Maximum Ratings” may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or other conditions beyond those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability.
"Absolute Maximum Ratings" are in all reputable data sheets and mean just what they say. They are the absolute maximum at which the device is guaranteed by the manufacturer not to suffer permanent damage at. Usually the guaranteed operating conditions are lower than the absolute maximum ratings.
You say that "you have tried this on every pin. Note the manufacturer's comment
- Exposure to absolute maximum rating conditions for extended periods may affect device reliability.
Here "extended periods" is at the manufacturer's and Murphy's discretion.
Chances are you have not damaged the IC. But if you operate it at above maximum values you may. And if you operate it at above maximum operating values you may get misoperation in practice. "Proper" designs must always observe operating limits set by the manufacturer.
Most datasheets have an Absolute Maximum Ratings (AMR) section, not all manufacturers state their significance as clearly as Atmel does:
Stresses beyond those listed under “Absolute Maximum Ratings” may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or other conditions beyond those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability.
This is exactly what AMR is about, and it's often interpreted wrongly by starting engineers. I often have to repeat (also here on SE): You're not supposed to operate a device under these conditions, like the last sentence of the notice says. One up for Atmel.
Sometimes you can exceed the AMR for a few seconds without apparent damage, and then you're lucky. Exceeding maximum currents is likely to create hot spots in the die, which may cause errors only noticeable later on, but it may also have immediate and drastic effects, like burning of the bonding wire.
For instance a multi-channel current driver may specify a maximum current per channel of 500mA, and that's the number everyone has read, but at the same time say maximum ground current is 1A, and that may be overlooked. In this case it means that you can't drive all 8 outputs at 200mA simultaneously, even if they're all way below the maximum of 500mA. While die bonding wire for the ground pin may be thicker, maximum ground current is usually defined in function of this wire's capability.