Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: acd52832_SAADC_Differential_input_2
Fork of acn_nrf52_saadc by
Revision 10:b763d9cfc063, committed 2017-10-04
- Comitter:
- jurica238814
- Date:
- Wed Oct 04 08:01:51 2017 +0000
- Parent:
- 9:a1eacc3f0cbb
- Commit message:
- Resolution and input range hardcoded.
Changed in this revision
| acd_nrf52_saadc.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/acd_nrf52_saadc.cpp Fri Sep 29 11:12:03 2017 +0000
+++ b/acd_nrf52_saadc.cpp Wed Oct 04 08:01:51 2017 +0000
@@ -16,11 +16,12 @@
// Do this for the first object only
NRF_SAADC->ENABLE = 1;
NRF_SAADC->RESULT.PTR =(uint32_t)data; // Pass pointer to results buffer
+ NRF_SAADC->RESOLUTION = 3;
calibrate();
}
if(channelCounter < 8){
NRF_SAADC->CH[channel].PSELP = analogIn + 1;
- NRF_SAADC->CH[channel].CONFIG = 0x00021500; // reset
+ NRF_SAADC->CH[channel].CONFIG = 0x00021000; // reset
channelCounter++;
NRF_SAADC->RESULT.MAXCNT = channelCounter;
}
@@ -31,12 +32,13 @@
// Do this for the first object only
NRF_SAADC->ENABLE = 1;
NRF_SAADC->RESULT.PTR =(uint32_t)data; // Pass pointer to results buffer
+ NRF_SAADC->RESOLUTION = 3;
calibrate();
}
if(channelCounter < 8){
NRF_SAADC->CH[channel].PSELP = pPin + 1;
NRF_SAADC->CH[channel].PSELN = nPin + 1;
- NRF_SAADC->CH[channel].CONFIG = 0x00121500; // differential input, Gain 1
+ NRF_SAADC->CH[channel].CONFIG = 0x00121200; // differential input, Gain 1
channelCounter++;
NRF_SAADC->RESULT.MAXCNT = channelCounter;
}
