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

PCA20020 custom based board gpio's

Hello,

I'm trying to make custom board based on Thingy 52.

First problem that I get I want to change gpio's order according to my needs.

I can't not find where in the project for Thingy 52 based on  SDK 13 I can find the gpio's definition.

Second problem is that I want to use external 32.768kHz external Xtal to generate clock.

The current definition is setting up two external pins P0.00 and P0.01 as outputs and not give me chance to generate LFSRC clock, this problem is probably due to the system off state but I you give me sense how to change gpio's, I think I will solve this problem because system off state is exactly defining gpio;s 0.00 and gpios 0.01 as outputs with disconnected floating pins. So far i generate only HFSRC with internal RC oscillator.  

Thank you.

  • 1. Typically there is a boards.h file where you can include the board file, in your case likely it's pca20020.h. I suggest to create a custom_board.h file instead and define BOARD_CUSTOM instead of BOARD_PCA20020.

    2. Looking at the hardware file for the nRF52 thingy I can see there is already an 32kHz crystal so not sure if I understand your question: https://www.nordicsemi.com/Software-and-Tools/Prototyping-platforms/Nordic-Thingy-52/Download#infotabs 

  • Try looking for stuff like this:

    // <0=> RC 
    // <1=> XTAL 
    // <2=> Synth 
    // <131073=> External Low Swing 
    // <196609=> External Full Swing 
    #ifndef CLOCK_CONFIG_LF_SRC
    #define CLOCK_CONFIG_LF_SRC 0
    #endif

    There is also an nrfx equivalent. In any case you will need CLOCK_CONFIG_LF_SRC to be 1 in order to enable the crystal instead of the port pins as io

  • Hi Kenneth,

    Thank you very much for your reply.

    1. Yes of course that I need custom board file with the definitions for the led's, button's. Now my question is I'm trying to understand Nordic Thingy 52 project so I can reuse the open source design in my custom based Thingy 52 project.

    I need to know gpio's order but in "system on state", in project Thingy 52 Product manual is written "some of the gpio's pins are used internally by nrf52832, but some of them are available on gpio's headers", but I'm still in "system off state" and it's not applicable to use for example gpio's p0.00 and p0.01 pin's as Xtal clock connections since in pca20020.h file we have output direction on "system off state" checked with debugger. For the crystal of the 32.768kHz that is already there in the design of Thingy 52, yes in my case is also there Xtal attached and the problem is probably due to the "system off state of the gpio's p0.00 and p0.01".

    2. I can not run LF_CLK from 32.768kHz, exactly, that's why I need "system on state of gpio's" so I can create my custom board file in according to my needs, or if you can find me relation between gpio's and board file configuration but in "system on state". I can notice that when I set Keil for development with Thingy 52, he download NRF SDK 13 components including boards, etc. So, I really want to know if he uses some of the boards definitions available there in boards directory of NRF 13 SDK since we know that there are definitions of the boards in boards.h file and we can choose right board based design.

    I was using previously pca10040 board ble_blinky examples, but there the definitions of gpio's and buttons where there in custom_board.h definition file that was created by me on basis of pca10040.h , but where is that file in the Thingy 52 based project?

    Thank you.

  • Thank you very much, yes that is set, and the crystal is also there connected. Issue is from "system off state" on that gpio's p0.00 and p0.01.

Related