#define UART_INSTANCE 0
#define UART_TX_PIN 6
#define UART_RX_PIN 7
#define LED 12
void setup() {
// Initialize Serial communication for debugging
Serial.begin(9600);
// Configure UART pins
pinMode(UART_TX_PIN, OUTPUT);
pinMode(UART_RX_PIN, INPUT);
pinMode(LED, OUTPUT);
// Set up UART communication
NRF_UART0->PSEL.TXD = UART_TX_PIN;
NRF_UART0->PSEL.RXD = UART_RX_PIN;
NRF_UART0->BAUDRATE = UART_BAUDRATE_BAUDRATE_Baud9600;
NRF_UART0->ENABLE = UART_ENABLE_ENABLE_Enabled;
NRF_UART0->TASKS_STARTTX = 1;
NRF_UART0->TASKS_STARTRX = 1;
// Print UART successful message
Serial.println(“UART configuration successful.”);
}
i tried this code to configure uart for my nrf52840 sense but the ttl i used is cp2102 and it is not showing any o/p on serial monitor.