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

nRF52832's pin function limit

I want to use ADC / PWM / I2S / UART / SPI / I2C / ‎at a time. So, Can I use all GPIO pin assign any function? If I can't use some function at a time, I want to know the limit. For example I2S and SPI.

  • Hi

    The analog module (including ADC) is connected to a fixed set of pins, marked AIN0..AIN7 in this pinout diagram. All the digital modules you mention though, can be assigned to any GPIO pin you like.

    However, you are not able to use all the UART, SPI, and TWI modules at the same time because some of them share resources (registers). Hence you need to make sure that the UART, SPI, and TWI base addresses to the modules that you chose to use do not overlap. How many serial modules you can use concurrently and how you can combine them depend on this. You cannot e.g. use TWI0 and SPI0 concurrently since they both have base address at 0x40003000, but you can use TWI0 and SPI1 instead since SPI1 has base address at 0x40004000.

    The I2S and SPI does not share any registers.

  • Thank you for your answer. I understood very well. nRF52832 has 2 sets of UART, SPI, and TWI.

    I can use below. ・UART UART0 0x40002000 (use)

    ・I2C TWIM0 0x40003000 (use) TWIM1 0x40004000 (nouse)

    ・SPI SPIM0 0x40003000 (nouse) SPIM1 0x40004000 (use) or SPIM2 0x40023000 (use)

  • It has only one UART module. If I understand you list correctly you are correct. You can use UART0, TWIM0, SPIM1, and SPIM2 concurrently.

    If you really need e.g. two UARTs, but don't have to run them concurrently, you can reconfigure the UART module with associated pins at run-time and that way have several non-concurrent UART busses.

Related