ATmega328p
Hardware definitions
Loading...
Searching...
No Matches
ADC.h File Reference

ADC channels, references, timing, and electrical characteristics. More...

#include <stdint.h>
#include "Package.h"
Include dependency graph for ADC.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  atmega328p
 Device-specific definitions for the ATmega328P.
namespace  atmega328p::adc
 Analog-to-digital converter definitions.

Enumerations

enum class  atmega328p::adc::Channel : uint8_t {
  atmega328p::adc::ADC0 = 0 , atmega328p::adc::ADC1 = 1 , atmega328p::adc::ADC2 = 2 , atmega328p::adc::ADC3 = 3 ,
  atmega328p::adc::ADC4 = 4 , atmega328p::adc::ADC5 = 5 , atmega328p::adc::ADC6 = 6 , atmega328p::adc::ADC7 = 7
}
 External ADC input channels. More...
enum class  atmega328p::adc::InputPin : uint8_t {
  atmega328p::adc::ADC0 = 0x10 , atmega328p::adc::ADC1 = 0x11 , atmega328p::adc::ADC2 = 0x12 , atmega328p::adc::ADC3 = 0x13 ,
  atmega328p::adc::ADC4 = 0x14 , atmega328p::adc::ADC5 = 0x15 , atmega328p::adc::ADC6 = 0xFF , atmega328p::adc::ADC7 = 0xFF
}
 Logical pin associated with each external ADC channel. More...
enum class  atmega328p::adc::InternalInput : uint8_t { atmega328p::adc::TemperatureSensor = 8 , atmega328p::adc::Bandgap = 14 , atmega328p::adc::Ground = 15 }
 Internal ADC multiplexer inputs. More...
enum class  atmega328p::adc::Reference : uint8_t { atmega328p::adc::AREF = 0 , atmega328p::adc::AVCC = 1 , atmega328p::adc::Reserved = 2 , atmega328p::adc::Internal1V1 = 3 }
 ADC voltage-reference selections. More...
enum class  atmega328p::adc::TriggerSource : uint8_t {
  atmega328p::adc::FreeRunning = 0 , atmega328p::adc::AnalogComparator = 1 , atmega328p::adc::ExternalInterrupt0 = 2 , atmega328p::adc::Timer0CompareMatchA = 3 ,
  atmega328p::adc::Timer0Overflow = 4 , atmega328p::adc::Timer1CompareMatchB = 5 , atmega328p::adc::Timer1Overflow = 6 , atmega328p::adc::Timer1CaptureEvent = 7
}
 Automatic conversion trigger sources. More...
enum class  atmega328p::adc::Prescaler : uint16_t {
  atmega328p::adc::Divide2 = 2 , atmega328p::adc::Divide4 = 4 , atmega328p::adc::Divide8 = 8 , atmega328p::adc::Divide16 = 16 ,
  atmega328p::adc::Divide32 = 32 , atmega328p::adc::Divide64 = 64 , atmega328p::adc::Divide128 = 128
}
 ADC clock prescaler values. More...
enum  : uint32_t {
  atmega328p::adc::resolution_bits = 10 , atmega328p::adc::max_result = 1023 , atmega328p::adc::max_external_channel_count = 8 , atmega328p::adc::external_channel_count = package::selected::adc_channel_count ,
  atmega328p::adc::normal_conversion_cycles = 13 , atmega328p::adc::first_conversion_cycles = 25 , atmega328p::adc::internal_reference_nominal_mv = 1100 , atmega328p::adc::recommended_clock_min_hz = 50000 ,
  atmega328p::adc::recommended_clock_max_hz = 200000 , atmega328p::adc::electrical_clock_max_hz = 1000000 , atmega328p::adc::recommended_source_impedance_max_ohms = 10000 , atmega328p::adc::normal_conversion_time_min_us_at_1mhz = 13 ,
  atmega328p::adc::normal_conversion_time_max_us_at_50khz = 260 , atmega328p::adc::first_conversion_time_min_us_at_1mhz = 25 , atmega328p::adc::first_conversion_time_max_us_at_50khz = 500 , atmega328p::adc::max_sample_rate_at_max_resolution_sps = 15000
}
enum  : uint8_t {
  atmega328p::adc::has_internal_temperature_sensor = 1 , atmega328p::adc::has_internal_bandgap_input = 1 , atmega328p::adc::has_ground_input = 1 , atmega328p::adc::input_pin_range_starts_at_gnd = 1 ,
  atmega328p::adc::input_pin_range_ends_at_vcc = 1 , atmega328p::adc::conversion_range_starts_at_gnd = 1 , atmega328p::adc::conversion_range_ends_at_vref = 1 , atmega328p::adc::temperature_sensor_calibrated_accuracy_c = 10 ,
  atmega328p::adc::temperature_sensor_requires_calibration = 1 , atmega328p::adc::temperature_sensor_gain_signature_address = 0x03 , atmega328p::adc::temperature_sensor_offset_signature_address = 0x02
}
enum  : uint16_t {
  atmega328p::adc::automotive_temperature_code_minus_40c = 0x010D , atmega328p::adc::automotive_temperature_code_25c = 0x0160 , atmega328p::adc::automotive_temperature_code_125c = 0x01E0 , atmega328p::adc::automotive_accuracy_test_vcc_mv = 4000 ,
  atmega328p::adc::automotive_accuracy_test_vref_mv = 4000
}

Variables

static constexpr float atmega328p::adc::family_absolute_accuracy_lsb = 2.0f
static constexpr float atmega328p::adc::family_inl_lsb = 0.5f
static constexpr float atmega328p::adc::automotive_typical_absolute_accuracy_lsb_at_200khz = 2.2f
static constexpr float atmega328p::adc::automotive_max_absolute_accuracy_lsb_at_200khz = 3.5f
static constexpr float atmega328p::adc::automotive_typical_inl_lsb_at_200khz = 0.6f
static constexpr float atmega328p::adc::automotive_max_inl_lsb_at_200khz = 1.5f
static constexpr float atmega328p::adc::automotive_typical_dnl_lsb_at_200khz = 0.3f
static constexpr float atmega328p::adc::automotive_max_dnl_lsb_at_200khz = 0.7f
static constexpr float atmega328p::adc::automotive_max_gain_error_lsb = 3.5f
static constexpr float atmega328p::adc::automotive_max_offset_error_lsb = 3.5f

Detailed Description

ADC channels, references, timing, and electrical characteristics.