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

Invert Port at a NRF51822

Hello,

I already searched the forum, but I didn't find anything.

Is there a way to invert a port on a NRF51822?

I use this chip together with an XMega-Chip and they communicate via uart. At the XMega, the TX-Pin is inverted, because it is also used to communicate via a led, but the led should not light up all the time. At the xmega I am able to invert a port signal, for in- and output. Is there a configuration option for the nrf? I didn't find anything.

Thanks for your help.

Parents
  • Hi

    The UART pins can not be inverted on the nRF51. However, one solution is, as @JohnBrown suggest, to use GPIOTE and PPI. I made a simple example for you based on the uart example in SDK 9.0.0. It sets up a PPI channel connecting the UART TX pin and pin 24 (LED_4 on a nRF51 DK board). The state of pin 24 should be the inverted state of the TX pin. Extract the example to "your_SDK_9.0.0_folder\examples\peripheral" and it should compile out of the box.

    invert-uart-signal-ppi.zip

    A different solution might be to use the TXDRDY event of the UART. You could turn on the LED when starting a transmission and then turn it off when the event is triggered.

Reply
  • Hi

    The UART pins can not be inverted on the nRF51. However, one solution is, as @JohnBrown suggest, to use GPIOTE and PPI. I made a simple example for you based on the uart example in SDK 9.0.0. It sets up a PPI channel connecting the UART TX pin and pin 24 (LED_4 on a nRF51 DK board). The state of pin 24 should be the inverted state of the TX pin. Extract the example to "your_SDK_9.0.0_folder\examples\peripheral" and it should compile out of the box.

    invert-uart-signal-ppi.zip

    A different solution might be to use the TXDRDY event of the UART. You could turn on the LED when starting a transmission and then turn it off when the event is triggered.

Children
Related