//Sending letter "A" to HyperTerminal (or TeraTerminal) via Serial 1 (2nd COM port next slide Sw) on MDE 8051 Trainer //Tested by M. Mazidi //Modified from Example 10-20 in "The 8051 Microcontroller" textbook by Mazidis & McKinlay //Download the program by putting the slide SW on PROG //After the download is completed: //a) disconnect the power, //b) disconnect the serial cable from Serial 0 DB-9 and connect it to serial 1 DB-9 //c) Make sure to put a jumper on S2 (next to Power LED) to connect the TXD //d) Reconnect the power //put the slide SW on RUN and Reset the board and you will see letter 'A' will appear on screen //Notice the Serial 0 COM port is the one used to download the program to MDE 8051 Trainer //and Serial 1 (2nd cOM port used in this example) is next to the slide SW for PROG/RUN #include sfr SBUF1=0xC1; sfr SCON1=0xC0; sbit TI1=0xC1; void main(void) { TMOD=0x20; TH1=0xFD; //notice the baud rate is 9600 SCON1=0x50; TR1=1; while(1) { SBUF1='A'; while(TI1==0); TI1=0; } }