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

nrf52840 pin usage

Hi,

       we are developing against the nRF52840 chip. We are interpreting the documentation as indicating that each pin can do all of GPIO, PWM, I2C and SPI. Are we reading this correctly? It is just that every other chip we have looked at, each pin only does one or two things and you have to choose pin connections based on the purpose.

Many thanks in advance

Paul

Parents
  • Yes. I'd explain it the other way around, for each instance of each function (SPI0, SPI1, I2C0 .. etc) there are registers in which you can select which of the pins are used for each of the input/outputs of that function and you can assign any GPIO to any function. Obviously you can only assign each GPIO to one function at most, any that are assigned ignore anything set in the GPIO registers for them (because the peripheral takes them over), all other pins which you haven't assigned are just GPIOs. 

    There's also a recommendation in the manual to avoid using some of the GPIOs located close to the radio for high frequency serial in order to ensure you don't get interference so better to use those pins for low frequency comms or as GPIOs (if you need them at all). 

    A few functions are fix, USB for instance, and the SWD interface pins are fixed and, common to many MCUs, analog is restricted to a number of pins, but outside that, anything module which needs input/output pins can use any numbered GPIO you like. 

    Kinda useful right? 

  • Thanks RK. A matter of checking out "Too good to be true..." Better to find out before we enshrine a possible misunderstanding in hardware....

    cheers Paul

Reply Children
No Data
Related