It sounds like the nRF51822 has 1 UART, or possibly several can be defined from GPIO. Which is it? Can I get 2?
It sounds like the nRF51822 has 1 UART, or possibly several can be defined from GPIO. Which is it? Can I get 2?
The nRF51822 has only 1 UART hardware peripheral. You can do the bit banging to have more but I don't think it's the case here. You can refer to the nRF51 Reference Manual for more information about the nRF51822.
Regarding the GPIO, the nRF51822 has the Pin Crossbar feature that you can chose and connect any GPIO pins as UART's (or SPI/TWI etc) pins. And you can change these pins in runtime. Which means, if you don't need 2 UARTs running concurrently, you can use 1 UART and switch between the pins to interface with 2 devices.
Looking at the nRF51822 SDK documentation if I'm following it correctly, I can define any GPIO pins to be a UART using the app_uart_init function. I don't need 2 concurrent UARTS, but am I right in assuming I can setup two seperate UARTS and then swap between them using this function?
Anyone have a code example?
Yes, as Hung said, you can do that. All digital peripherals can be connected to any pin, so as long as you don't need any of them concurrently, you can switch at will.
Yes, as Hung said, you can do that. All digital peripherals can be connected to any pin, so as long as you don't need any of them concurrently, you can switch at will.
Any code examples, or is my app_uart_init correct?