after inserting the delay, i got a waveform of 3 byte frames as follows:
(UART sending from LSB to MSB)
1011010011 1111110000
1 100110101 0
(The part in bold resembles 0x59 that i assigned for ASCII 'Y')
the other 2 bytes seemed to get muddled up and I only sent 2 bytes out...
however, because i had to keep RC0 "HIGH" for this to happen so im guessing that
1. Im not getting 3 bytes but actually a consecutive repetition of the 2 bytes which results in:
2. the waveform getting muddled up..
referring to this part,
for(count=0;count<2;count++)
{
out=data[count];
while(!TXIF);
TXREG=out;
}
DelayMs(250);
at the point where the delay is executed , im assuming the line be held back to a 'HIGH IDLE' state before the next byte is transmitted?
therefore when observing the output on the scope, i have to take into consideration an additional couple of parts of the waveform where there will be a continuous stream of Logic 1's during the delay?
so i guess the best way to test UART transmissionis by using hyper terminal or to another PIC..
is my understanding of the matter correct?
2ndly,
if i were to use a PIC to receive, and i do not know the amount of bytes that are coming in, is the reception correctly implemented as follows?
while(!RXIF);
rcivdata[]=RCREG;
out=rcivdata;
if 2 bytes are received and i want to store and retrieve these 2 bytes ..how should i do it..
once again ,thank you so much for your help