HI, all,
I am trying to transfer my previous project from nrf51822 to nrf52840, and at very the beginning ,I can not make the UART/UARTE of nrf52840 work.
0, I have programmed example hex file into 52840 to check the chip is OK and UART is OK, I can get data transmission from 52840 normally.
1, I tried to use nrf_uart.h to build the driver functions for UART, since our previous project use it . However , when I watch the memory of the UART registers, I found that the function triggering STARTTX nrf_uart_task_trigger(NRF_UART0, NRF_UART_TASK_STARTTX) have no effect on the register TASKS_STARTTX which is located at 0x40002008, so data transmission did not happen. I have found when I operated other registers ,such as ENABLE, BAUDRATE and PSEL.TXD, data on the memory changed as expected.
2, I took reference from this link https://github.com/andenore/NordicSnippets/blob/master/examples/uart/main.c#L20 , trying to operate UARTE by setting register directly, still STARTTX can not be set.
I have read about the STARTTX in PS and searched in devzone, and I have not found any restriction on setting that register, so I don`t know why that happened.
my code snap about UART is below, and I am using SDK16.0 ,the IDE is IAR8.22. the pin definition of my board is compatible with PCA10040 .
Any help and advice is appreciated!