m05e00 with automatic trigger should now work

This commit is contained in:
hugo LAMY
2025-03-14 22:18:30 +01:00
committed by hugogogo
parent 4c36e4e775
commit 2fd1d7d931
2 changed files with 13 additions and 8 deletions

View File

@@ -17,7 +17,7 @@ void adc_init(uint8_t prescaler_value) {
ADCSRA |= (1 << ADIE); // 24.9.2 : enable ADC Interrupt
ADCSRA |= ADC_PRESCALE_SET(prescaler_value); // Table 24-5 : prescaler ADC
ADCSRB = ADC_TRIGGER_TIMER_1_OVERFLOW; // Table 24-6 : ADC Auto Trigger Source
ADCSRB = ADC_TRIGGER_TIMER_1_COMPARE_B; // Table 24-6 : ADC Auto Trigger Source
ADMUX = (ADMUX & 0b11110000) | (adc_channel & 0b1111); // Table 24-4 : Select ADC channel 0, (Table 14-6 : alternate function for RV1 on PC0 -> ADC0)
}