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

c51: read & transmit more than 1 byte at a time

I am trying to interface flash to 8051,
when i try to read and transmit 2 bytes to PC, it displays only one byte to the terminal
have used this same code

main(){
TMOD = 0x20;
TH1 = -3;               // 9600 baud
SCON = 0x50;
TR1 = 1;
TI = 1;

Fn1();
TI = 1;
Fn2();
}

Fn1(){
// read Operations ...
ce = 0;
// ...
SBUF = read1;
while(TI){
}
TI = 0;
ce = 1;
}

Fn2(){
// read operations...
ce = 0;
// ...
TI = 1;
SBUF = read2;
while(TI){
}
TI = 0;
ce = 1;
}

Kindly help.