Afec Sam7X Block Icon
  • SAM E70 - High-performance Cortex-M7 (up to 300 MHz) - SAM S70 - Secure Cortex-M7 with TrustZone - SAM V70/V71 - Automotive-qualified Cortex-M7

Supported Device Families

  • SAM E70
  • SAM S70
  • SAM V70
  • SAM V71

Key Features

FeatureDescription
Dual AFECAFEC0 and AFEC1 (12 channels each)
Resolution12-bit with up to 16-bit oversampling
Programmable Gain1x, 2x, 4x amplification per channel
Offset CompensationAutomatic offset cancellation
Temperature SensorIntegrated temperature measurement (AD11)
SpeedUp to 1 Msps per AFEC

AFEC Architecture

Dual AFEC Configuration

  • AFEC0: Channels AD0-AD11 (AD11 = Temperature sensor)
  • AFEC1: Channels AD0-AD11
  • Independent operation: Each AFEC can sample simultaneously
  • Pin mapping: ADx channels map to specific port pins (e.g., AD0 → PE5)

Analog Front-End Features

FeatureConfiguration
Single-ended/DifferentialConfigurable per channel
Gain1x, 2x, 4x (programmable per channel)
OffsetAutomatic offset correction
AveragingHardware averaging for noise reduction

Configuration Parameters

Channel Selection

  • AFEC0_ADx checkboxes: Enable individual channels on AFEC0
  • AFEC1_ADx checkboxes: Enable individual channels on AFEC1
  • Temperature sensor: AD11 on AFEC0 (special handling)

Per-Channel Settings

  • Gain: Select 1x, 2x, or 4x amplification
  • Differential mode: Enable differential measurement
  • Offset compensation: Enable automatic offset correction

Trigger Sources

  • Software trigger (manual conversion)
  • TC (Timer Counter) output
  • PWM events
  • External trigger pins

Pin Mapping

The block automatically displays pin assignments for enabled channels (e.g., “AD0 / PE5 / Pin[X]”).

Applications

  • Industrial automation: High-precision sensor measurements with programmable gain
  • Motor control: Current and voltage feedback with offset compensation
  • Power management: Multi-channel voltage/current monitoring
  • Automotive: Temperature-compensated analog measurements
  • Medical devices: Low-noise signal acquisition with averaging

Usage Example

            AFEC0: Enable AD0-AD5 (6 sensor channels), Gain=2x, Offset compensation ON
            AFEC0 AD11: Enable temperature sensor for thermal monitoring
            AFEC1: Enable AD0-AD3 (4 additional channels), Gain=1x
            Trigger: TC0 output at 10kHz
        
        Result: 10 precision analog measurements + temperature, all synchronized with hardware averaging.

Performance Features

Enhanced Accuracy

  • Programmable Gain: Amplify small signals (μV-mV range) without external op-amps
  • Offset Compensation: Eliminate DC offset errors automatically
  • Hardware Averaging: Reduce noise through multi-sample averaging
  • Differential Mode: Reject common-mode noise

Conversion Speed

  • Up to 1 Msps per AFEC (2 Msps total with AFEC0+AFEC1)
  • Configurable conversion time vs accuracy trade-off
  • DMA support for high-throughput applications

Troubleshooting

See Also

ADC Blocks Overview | [Block Reference](../