This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

which pins can be set to analog input pins with 51422

HI,ALL

with ' nRF51_Series_Reference_manual v3.0.pdf ' , i want to know which pins can i used for adc purpose.

in the sample code.

void adc_config(void)

{

const nrf_adc_config_t nrf_adc_config = NRF_ADC_CONFIG_DEFAULT; 

// Initialize and configure ADC
nrf_adc_configure( (nrf_adc_config_t *)&nrf_adc_config);              

nrf_adc_input_select(NRF_ADC_CONFIG_INPUT_2);                          NRF_ADC_CONFIG_INPUT_2 = 4UL

nrf_adc_int_enable(ADC_INTENSET_END_Enabled << ADC_INTENSET_END_Pos);  

NVIC_SetPriority(ADC_IRQn, NRF_APP_PRIORITY_HIGH);                    

NVIC_EnableIRQ(ADC_IRQn);                                              

}

the reference vol is 1.2v , and the value print in uart is '171' , what is the meaning of the 171,and which pin is NRF_ADC_CONFIG_INPUT_2.

thank you very much!!!!

Parents
  • For the pin assignments look at the 51822 or 51422 product specification which has the pinouts for the various chips and tells you what the ADC pins are shared with.

    For the meaning of '171' read the description of the 'RESULT' register for the ADC which tells you it's basically 1.2v * 171 / max-value-of-ADC which depends on the resolution you set

  • thank you very much. And in the nRF51422_PS_v3.0.pdf , there are only a few lines to describe the ADC: "

    4.14 Analog to Digital Converter (ADC) The 10 bit incremental Analog to Digital Converter (ADC) enables sampling of up to 8 external signals through a front-end multiplexer. The ADC has configurable input and reference prescaling, and sample resolution (8, 9, and 10 bit). Note: The ADC module uses the same analog inputs as the LPCOMP module (AIN0 - AIN7 and AREF0 - AREF1). Only one of the modules can be enabled at the same time. "

    Am i get the right document?

    And thanks again.

Reply
  • thank you very much. And in the nRF51422_PS_v3.0.pdf , there are only a few lines to describe the ADC: "

    4.14 Analog to Digital Converter (ADC) The 10 bit incremental Analog to Digital Converter (ADC) enables sampling of up to 8 external signals through a front-end multiplexer. The ADC has configurable input and reference prescaling, and sample resolution (8, 9, and 10 bit). Note: The ADC module uses the same analog inputs as the LPCOMP module (AIN0 - AIN7 and AREF0 - AREF1). Only one of the modules can be enabled at the same time. "

    Am i get the right document?

    And thanks again.

Children
No Data
Related