Hi jeremyzhou,
Thanks your answer and helpfull shairing. Actually, I sent some data with uart3_D register, but when i want to send using FIFO buffer, it doesnt succeed. my code is following. TCFIFO [TXCOUNT] doesnt count truely, it only count one time but i am sending 8 dataword, so it should be able to count 8. Where is the my fault. Is there any ideas about this.
unsgined int i, error=0;
void main(){
Uart_INIT(); // no -parity, 8-bit ,4800-baud, transmitter disable, receiver disable
UART3->PFIFO.TXFE = 1;
UART3->PFIFO.RXFE = 1;
UART3->C2.TE = 0;
UART3->C2.RE = 0;
/* Loop to fill the entire TxFIFO */
for(i=0;i<9;i++){
/* Write data into the FIFO */
UART3->D.RT = i;
}
/* Test to make sure TCFIFO is 8 (FIFO full) */
if ( UART3->TCFIFO.TXCOUNT != 8) { error++; }
/* Flush the TxFIFO */
UART3->CUART->FIFO.TXFLUSH = 1;
/* Test to make sure TCFIFO is 0 now (FIFO flushed) */
if ( UART3->TCFIFO.TXCOUNT != 0){ error++; }
/* Loop to fill the entire TxFIFO with a new data set */
for( i=0x11; i < 0x19; i++){
/* Write data into the FIFO */
UART3->UART->D.RT = i;
}
/* Set the Rx watermark to 8 so that we can detect when the transmit is complete */
UART3->RWFIFO.RXWATER = 8;
/* Now re-enable the transmitter. This should cause all 8 bytes to transmit
UART3->C2.TE = 1;
}
Thanks for your interest,
Ramazan