This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ADC on nrf51 pin 26 & 27

Hello, I'm using an PTR5188 development board for my project which breaks out PIN 26 & 27 for ADC only. I'm using mbed as my development platform and haven't been able to read my sensors output on either of these two pins. I've done a minor modification to the mbed analog api to cover the additional pins but I'm wondering if p26&27 need to be initialised in a different way than the "other" p1-p6 nrf analog inputs. static const PinMap PinMap_ADC[] = { {p1, ADC0_0, 4}, {p2, ADC0_0, 8}, {p3, ADC0_0, 16}, {p4, ADC0_0, 32}, {p5, ADC0_0, 64}, {p6, ADC0_0, 128}, {p27, ADC0_0, 256}, {NC, NC, 0} }; developer.mbed.org/.../

Thanks, Jens

Parents
  • I know nothing about mbed, but maybe try that:

    static const PinMap PinMap_ADC[] = {
    {p1, ADC0_0, 4},
    {p2, ADC0_0, 8},
    {p3, ADC0_0, 16},
    {p4, ADC0_0, 32},
    {p5, ADC0_0, 64},
    {p6, ADC0_0, 128},
    {p27, ADC0_0, 2},
    {NC, NC, 0} };
    

    and probably for p26 it will be {p26, ADC0_0, 1} I assume the last value is the value that will be written in ADC CONFIG.PSEL register, that selects input of the ADC.

Reply
  • I know nothing about mbed, but maybe try that:

    static const PinMap PinMap_ADC[] = {
    {p1, ADC0_0, 4},
    {p2, ADC0_0, 8},
    {p3, ADC0_0, 16},
    {p4, ADC0_0, 32},
    {p5, ADC0_0, 64},
    {p6, ADC0_0, 128},
    {p27, ADC0_0, 2},
    {NC, NC, 0} };
    

    and probably for p26 it will be {p26, ADC0_0, 1} I assume the last value is the value that will be written in ADC CONFIG.PSEL register, that selects input of the ADC.

Children
No Data
Related