hi
i want to send a serial data using 89C2051, i got a code from net but its not working
i checked it on Proteus 7 Professional.
how can i send any data or Receive it?
#include "reg51.h" #include "stdio.h" unsigned char a=0; void serial_send(); void main () { TMOD = 0x20; SCON = 0x50; TH1 = 0xFD; TL1 = 0xFD; TR1 = 1; P1 = 255; a = 255; while(1) { if (P1 != a) { a = P1; serial_send(); } } } void serial_send() { while(!TI); { TI = 0; SBUF = a; } }
Did it occur to you dear Qazi that your user manual/exaples etc. know? Or the person gave this code snippet? I would not bet my life on it, though...