We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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; } }
A 'program' like the above is totally worthless, it does not specify processor ('51 will NOT do) and clock. Let alone publishing uncommented 'code'
Erk