1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-18 07:52:14 +01:00

[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
This commit is contained in:
Cristian Maglie 2013-09-26 01:16:27 +02:00
parent e745ed988f
commit f03093332b
2 changed files with 5 additions and 1 deletions

View File

@ -7,6 +7,10 @@ ARDUINO 1.5.5 BETA
* sam: Fixed SPI initialization (when using extended API and multiple CS) * sam: Fixed SPI initialization (when using extended API and multiple CS)
* avr: Fixed behavior of EthernetClient::flush() * avr: Fixed behavior of EthernetClient::flush()
[core]
* sam: Fixed wrong initialization for ADC timings (analogRead speed Arduino DUE improved by a factor x10)
(http://www.djerickson.com/arduino/)
ARDUINO 1.5.4 BETA 2013.09.10 ARDUINO 1.5.4 BETA 2013.09.10
[ide] [ide]

View File

@ -433,7 +433,7 @@ void init( void )
// Initialize Analog Controller // Initialize Analog Controller
pmc_enable_periph_clk(ID_ADC); pmc_enable_periph_clk(ID_ADC);
adc_init(ADC, SystemCoreClock, ADC_FREQ_MAX, ADC_STARTUP_FAST); adc_init(ADC, SystemCoreClock, ADC_FREQ_MAX, /*ADC_STARTUP_FAST*/ 3);
adc_configure_timing(ADC, 0, ADC_SETTLING_TIME_3, 1); adc_configure_timing(ADC, 0, ADC_SETTLING_TIME_3, 1);
adc_configure_trigger(ADC, ADC_TRIG_SW, 0); // Disable hardware trigger. adc_configure_trigger(ADC, ADC_TRIG_SW, 0); // Disable hardware trigger.
adc_disable_interrupt(ADC, 0xFFFFFFFF); // Disable all ADC interrupts. adc_disable_interrupt(ADC, 0xFFFFFFFF); // Disable all ADC interrupts.