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

Configuration UARTE with nrf52805 for ESB - Part 2


My previous ticket is closed. I would need, but still help with the configuration of the pins. I report my last post.

Hello,
I did some tests with the oscilloscope directly connected to pins 21 and 18 of the nrf52805.
The transmission on pin 18 by the Stm8l works perfectly. The problem I encounter now is that nrf52805 I have the pull up instruction on this pin

 nrf_gpio_cfg_input(PIN_RXD,GPIO_PIN_CNF_PULL_Pullup);

but nothing happens when oscilloscopes.
It could be that I get the pin definition wrong initially

 #define UARTE_BASE           0x40002000
  #define PORTA_UARTE          ((NRF_UARTE_Type *) UARTE_BASE )
  #define PIN_TXD            21
  #define PIN_RXD            18


or the pull up configuration of pin 18, set as input and pin 21 as output?

 nrf_gpio_cfg_input(PIN_RXD,GPIO_PIN_CNF_PULL_Pullup);
     nrf_gpio_cfg_output(PIN_TXD);
Parents
  • I need some help figuring out what's wrong with my code.

    With the oscilloscope test I see that my master (STM8l) communicates the value (in the test I used 0xF3) through UARTE on pin 18 of the nrf52805 (connected in slave mode), but if I read the value to which the buffer points is not the data that I send rather they are values that change randomly.

    nrf_uarte_baudrate_set(PORTA_UARTE, NRF_UARTE_BAUDRATE_115200);
    nrf_uarte_txrx_pins_set(PORTA_UARTE, PORTA_TXD, PORTA_RXD);
    nrf_uarte_configure(PORTA_UARTE, NRF_UARTE_PARITY_EXCLUDED, NRF_UARTE_HWFC_DISABLED);
                                             
    nrf_uarte_enable(PORTA_UARTE);
    nrf_uarte_rx_buffer_set(PORTA_UARTE,rx_buffer,1);
    
    if (nrf_uarte_event_check(PORTA_UARTE, NRF_UARTE_EVENT_RXSTARTED))
           {
            if (nrf_uarte_event_check(PORTA_UARTE, NRF_UARTE_EVENT_RXDRDY))
            {
                dato_uarte=*rx_buffer;
            }
            if (nrf_uarte_event_check(PORTA_UARTE, NRF_UARTE_EVENT_ENDRX))
            {
                nrf_uarte_task_trigger(PORTA_UARTE,NRF_UARTE_TASK_STOPRX); 
                nrf_uarte_task_trigger(PORTA_UARTE,NRF_UARTE_TASK_FLUSHRX);
                nrf_uarte_task_trigger(PORTA_UARTE,NRF_UARTE_TASK_STARTRX);   
                nrf_uarte_rx_buffer_set(PORTA_UARTE,rx_buffer,1);
            }
            nrf_uarte_task_trigger(PORTA_UARTE,NRF_UARTE_TASK_FLUSHRX);
           }    

Reply
  • I need some help figuring out what's wrong with my code.

    With the oscilloscope test I see that my master (STM8l) communicates the value (in the test I used 0xF3) through UARTE on pin 18 of the nrf52805 (connected in slave mode), but if I read the value to which the buffer points is not the data that I send rather they are values that change randomly.

    nrf_uarte_baudrate_set(PORTA_UARTE, NRF_UARTE_BAUDRATE_115200);
    nrf_uarte_txrx_pins_set(PORTA_UARTE, PORTA_TXD, PORTA_RXD);
    nrf_uarte_configure(PORTA_UARTE, NRF_UARTE_PARITY_EXCLUDED, NRF_UARTE_HWFC_DISABLED);
                                             
    nrf_uarte_enable(PORTA_UARTE);
    nrf_uarte_rx_buffer_set(PORTA_UARTE,rx_buffer,1);
    
    if (nrf_uarte_event_check(PORTA_UARTE, NRF_UARTE_EVENT_RXSTARTED))
           {
            if (nrf_uarte_event_check(PORTA_UARTE, NRF_UARTE_EVENT_RXDRDY))
            {
                dato_uarte=*rx_buffer;
            }
            if (nrf_uarte_event_check(PORTA_UARTE, NRF_UARTE_EVENT_ENDRX))
            {
                nrf_uarte_task_trigger(PORTA_UARTE,NRF_UARTE_TASK_STOPRX); 
                nrf_uarte_task_trigger(PORTA_UARTE,NRF_UARTE_TASK_FLUSHRX);
                nrf_uarte_task_trigger(PORTA_UARTE,NRF_UARTE_TASK_STARTRX);   
                nrf_uarte_rx_buffer_set(PORTA_UARTE,rx_buffer,1);
            }
            nrf_uarte_task_trigger(PORTA_UARTE,NRF_UARTE_TASK_FLUSHRX);
           }    

Children
No Data
Related