9 years, 10 months ago.

Pins P0.26 and P0.27 disabled by default.

Is there any way to enabled those chips to act as GPIO instead of external clock oscillator? I don't have external oscillator connected to those pins and still I can't drive them.

In the mkit documentation there is information:

Quote:

If P0.26 and P0.27 are needed as normal I/Os the 32.768 kHz crystal can be disconnected and the GPIO routed to the P6 connector.

Do I have to make some change into register at the initialisation of my program to use them?

[EDIT] My program is as follows:

simple gpio test

#include "mbed.h"

DigitalOut outputs[] = {(P0_0), (P0_1), (P0_2),(P0_3),(P0_4),(P0_5),(P0_6),(P0_7),(P0_8),(P0_9),(P0_10),
(P0_11),(P0_12),(P0_13),(P0_14),(P0_15),(P0_16),(P0_17),(P0_18),(P0_19),(P0_20),
(P0_21),(P0_22),(P0_23),(P0_24),(P0_25),(P0_26),(P0_27),(P0_28),(P0_29),(P0_30)};
//Test that all pins are working.
int main() {
    while(1) {
        for (int i =0;i<=30;i++){
            outputs[i]=1;
            wait(0.01*i);
            outputs[i]=0;            
        }
    }
}

Only those two pins are not triggering output. If you want to test it, it is here http://developer.mbed.org/teams/Icarus-Sensors/code/Pinout-Test/

And one more thing I have found. In system_nrf51822.c there is code to initialise external 32khz clock define as follows:

./targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/system_nrf51822.c

    // Start the external 32khz crystal oscillator.

#ifdef TARGET_HRM1017
    NRF_CLOCK->LFCLKSRC             = (CLOCK_LFCLKSRC_SRC_RC << CLOCK_LFCLKSRC_SRC_Pos);
#else
    NRF_CLOCK->LFCLKSRC             = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos);
#endif
    NRF_CLOCK->EVENTS_LFCLKSTARTED  = 0;
    NRF_CLOCK->TASKS_LFCLKSTART     = 1;

maybe that is somehow the problem for those pins to be used as gpios that they are already define to be used for clock?

Question relating to:

The nRF51 Development Kit is a single-board development kit for Bluetooth Smart, ANT and 2.4GHz proprietary applications using the nRF51 Series SoC. This kit supports both development for both nRF51822 …

1 Answer

9 years, 10 months ago.

Have you tried using those pins as GPIO using DigitalIn/DigitalOut? It should just work.

Accepted Answer

Yes, I've updated my question with the program I am using and for some strange reason it is not working. I didn't try to use it as DigitalIn yet.

posted by Marek Smigielski 30 Jan 2015

It turn out that it was a problem on our board.

posted by Marek Smigielski 25 Feb 2015