Hi MCU is recieving the data from other MCU& i am unable to store the data using SBUF..so pls help me.. only the last byte is receiving again & again...
thanks
here my source code
p = 0; for(i1=0;i1<448;i1++) ser_buf[i1]=SBUF;
for(i2=0;i2<8;i2++) { for(i1=0;i1<48;i1++) prt_buf[i1] = 0; for(i1 = 0;i1<48;i1++) prt_buf[i1] =ser_buf[p++];
print_graph();
}
Note that for code that sends data from one processor to another processor, without handshake, you must make sure that the transmitting side is never sending data faster than what the receiver is fast enough to pick up.
So if you have a tight transmit loop, it may send too fast. It all depends on what baudrate you have, i.e. how much delay the sending UART introduces between transmitted character. Have you made sure that the receiver can always (!) pick up data at the maximum speed the baudrate allows data to be transmitted?
"It all depends on what baudrate you have"
yes. a very good way to make sure that you receive fast enough is the the recieve baud rate faster than the transmit baud rate.
"yes. a very good way to make sure that you receive fast enough is the the recieve baud rate faster than the transmit baud rate."
Not at all - the receiver should try to match the baudrate of the transmitter as much as possible, since the A in UART stands for "asynchronous". So the receiver counts time to figure out where to sample the data signal to extract the individual bits. It obviously must counts time in the same way that the transmitter did, or it will greatly fail to separate the individual bits in a transmitted character.
It's just that the baudrate controls how long time it takes for a UART to perform a transfer of a full character - so the fastest possible time from reception of one character until the next character may be available to pick up from the data register of the receiving UART (if the transmitter manages to start the next transmission instantly when the previous character was sent).
and when you nuts enable the fifo [firs in first out] and use the interrupt.
"... you nuts enable the fifo ..."
Pray tell you nut, precisely what 8051 FIFO is that?
it was the suggestion. may be. www.8052.com/.../100570
it was the suggestion. may be. www.8052.com/.../100570 :
The LPC932 has a double buffer instead of the standard single byte UART
the shortest FIFO I ever heard of
Erik