This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

PDC of DBGU doesn't stop transmitting then buffer is empty

Hi

I use AT91SAM7X. I have function which configures USART with PDC (115200, 1 stop, no parity, normal mode, 8-bit data) and everytging works fine. When I use it to configure DBGU it doesn't transmit or receive if don't execute this:
pUSART->US_CR = AT91C_US_RXEN | AT91C_US_TXEN;
For regular USART I don't need this line and it works.

Second problem is... When DBGU TCR reaches zero it should stop transmitting. Rgular USART stops, DBGU constantly repeats last char in buffer when it reaches zero in TCR. But often TCR is not decremented or it stops decrementing somewhwre inside of the buffer and repeats char from the place where it stopped decrementing TCR.

Any idea for that?

init:

        AT91F_PIO_CfgPeriph( AT91C_BASE_PIOA, IO, 0 );
        pUSART->US_IDR = 0xFFFFFFFF;
        AT91F_PDC_Open((AT91PS_PDC) &(pUSART->US_RPR));
        pUSART->US_CR = AT91C_US_RSTRX | AT91C_US_RSTTX | AT91C_US_RXDIS | AT91C_US_TXDIS ;
        AT91F_US_SetBaudrate( pUSART, BOARD_MCK, serial_speed[speed] * serial_multip );
        pUSART->US_MR = no_parity;
        pUSART->US_CR = AT91C_US_RXEN | AT91C_US_TXEN;

usage:

        pUSART->US_RPR = reinterpret_cast<unsigned int>(buff);
        pUSART->US_RCR = buff_size;
        AT91F_US_EnableIt( pUSART, AT91C_US_ENDRX );
        pUSART->US_PTCR = AT91C_PDC_RXTEN;

and

        pUSART->US_RPR = reinterpret_cast<unsigned int>(buff);
        pUSART->US_RCR = buff_size;
        pUSART->US_IER = AT91C_US_ENDRX;
        pUSART->US_PTCR = AT91C_PDC_RXTEN;

Receiver and transmitter aren't active in the same time.

0