8 years, 6 months ago.

Using ADC blocks sending BLE analog values

I am trying to add a battery level measurement and sent it as BLE characteristic on my Redbear nano BLE. I started for the BLE_GATT_Example, it work's fine. Then I add a measuring battery voltage from here:

https://developer.mbed.org/users/MarceloSalazar/notebook/measuring-battery-voltage-with-nordic-nrf51x/

But when in int main(void) I add the my_analogin_init();

void my_analogin_init(void)
{
    NRF_ADC->ENABLE = ADC_ENABLE_ENABLE_Enabled;
    NRF_ADC->CONFIG = (ADC_CONFIG_RES_10bit << ADC_CONFIG_RES_Pos) |
                      (ADC_CONFIG_INPSEL_SupplyOneThirdPrescaling << ADC_CONFIG_INPSEL_Pos) |
                      (ADC_CONFIG_REFSEL_VBG << ADC_CONFIG_REFSEL_Pos) |
                      (ADC_CONFIG_PSEL_Disabled << ADC_CONFIG_PSEL_Pos) |
                      (ADC_CONFIG_EXTREFSEL_None << ADC_CONFIG_EXTREFSEL_Pos);
}

Then the BLE characteristics are no more sending the analog input values.

Should I do something special by using BLE and ADC in the same time ?

Thanks

Peter

Be the first to answer this question.