Hi,
I use UARTE peripheral when i communicate wih PC.
This code works. Send 4 bytes.
bno_tx_buf[0]=0xAA;
bno_tx_buf[1]=0x01;
bno_tx_buf[2]=0x00;
bno_tx_buf[3]=0x01;
NRF_UARTE0->TXD.MAXCNT = 4 ;
NRF_UARTE0->TXD.PTR = (uint32_t)&bno_tx_buf[0];
NRF_UARTE0->TASKS_STARTTX = 1;
while (NRF_UARTE0->EVENTS_ENDTX == 0)
{
}
NRF_UARTE0->TASKS_STOPTX = 1;
while (NRF_UARTE0->EVENTS_TXSTOPPED == 0);
But, if i add a delay, send 2 bytes then 2 bytes. Only first 2 bytes sent. After that uart don't send any character.
NRF_UARTE0->TXD.MAXCNT = 2 ;
NRF_UARTE0->TXD.PTR = (uint32_t)&bno_tx_buf[0];
NRF_UARTE0->TASKS_STARTTX = 1;
while (NRF_UARTE0->EVENTS_ENDTX == 0)
{
}
NRF_UARTE0->TASKS_STOPTX = 1;
while (NRF_UARTE0->EVENTS_TXSTOPPED == 0);
//delay
NRF_UARTE0->TXD.MAXCNT = 2 ;
NRF_UARTE0->TASKS_STARTTX = 1;
while (NRF_UARTE0->EVENTS_ENDTX == 0)
{
}
NRF_UARTE0->TASKS_STOPTX = 1;
while (NRF_UARTE0->EVENTS_TXSTOPPED == 0);
Is there any configuration or initalization problem, that i do? I want to send buffer data continuously in loop, but uart doesn't work again except first tx.
Thanks
Berker