Why are you setting TI to 0 when it is 0 ? I set TI=0 at first time because I be carefule about serial interface,when you send lastest bit of data by Serial interface The TI always automate set(TI=1),if you want to use Serial interface again you must reset TI Why is dat a float ? SBUF is an unsigned char. If you are trying to send "0", why are you writing 0x30 to the output buffer ? I write 0x30 because 0x03=30H is ASCII code of "0" and redefine "unsigned dat"