read/write-serial port

I have several questions about reading from one of the serial ports (sorry it’s going to be tidious):

  1. After writing to the serial port (stop bit is sent)-when the read data register is full,i understand that-bit 7 of the status register goes up to ‘1’ value.so,when i execute serDgetc() this bit will turn to zero and after the next character enters the data register from the read FIFO the bit 7 goes back to ‘1’. is it correct?

2.I transmitted data using port C and recieved it with port D, i can read the data but i don’t see any change on bit 7 of the status register (of the Rx port) during execution,what configuration must i perform (control register?)
in order for bit 7 to act as predicted? or should’nt I expect it to be ‘1’ when i send data to the Rx port?

3.Continuing the previous question,when i set the control register of the port Rx to enable reciever input,disable interrupt,8 bit data,async mode
-0x00. I noticed that bit 7 of the status register (port C) change from 0 to 1 when writing from port D to port C,but i can’t read the data. serCgetc return fail. why is that?

thank you for your help.

The serial port routines are interrupt driven. The interrupts will read/write the data to the ports.

You will normally not see bit 7 set of the status register. As soon as it is set, the interrupt will read the byte and store it in the receive circular buffer.

serXgetc() does not read from the port, it reads from the memory buffer. Similarly, serXwritec() does not write to the serial port directly, it add bytes to the transmit bufffer. Interrupts transfer data between the memory buffers and the port itself.