Skip to content

Commit f030933

Browse files
committed
[sam] Fixed initialization of ADC timings (improves analogRead speed by a factor x10)
Discussion: http://www.djerickson.com/arduino/ http://forum.arduino.cc/index.php?topic=156849 http://forum.arduino.cc/index.php?topic=187693 Fixes #1418
1 parent e745ed9 commit f030933

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

build/shared/revisions.txt

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ ARDUINO 1.5.5 BETA
77
* sam: Fixed SPI initialization (when using extended API and multiple CS)
88
* avr: Fixed behavior of EthernetClient::flush()
99

10+
[core]
11+
* sam: Fixed wrong initialization for ADC timings (analogRead speed Arduino DUE improved by a factor x10)
12+
(http://www.djerickson.com/arduino/)
13+
1014
ARDUINO 1.5.4 BETA 2013.09.10
1115

1216
[ide]

hardware/arduino/sam/variants/arduino_due_x/variant.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ void init( void )
433433

434434
// Initialize Analog Controller
435435
pmc_enable_periph_clk(ID_ADC);
436-
adc_init(ADC, SystemCoreClock, ADC_FREQ_MAX, ADC_STARTUP_FAST);
436+
adc_init(ADC, SystemCoreClock, ADC_FREQ_MAX, /*ADC_STARTUP_FAST*/ 3);
437437
adc_configure_timing(ADC, 0, ADC_SETTLING_TIME_3, 1);
438438
adc_configure_trigger(ADC, ADC_TRIG_SW, 0); // Disable hardware trigger.
439439
adc_disable_interrupt(ADC, 0xFFFFFFFF); // Disable all ADC interrupts.

0 commit comments

Comments
 (0)