Hello Readers:
I have started this blog to show you Embedded C programming for 8051 family microcontroller using KEIL compiler. The KISS philosophy is used to write this tutorial. What is KISS? Keep It Simple, Stupid!
7. Serial Port Interface
This section teaches you how to send data and receive data from personal computer through serial port.
This program sends three letters to PC through serial port. One can see this repeatedly sending character on Terminal program. To get Terminal Program in Windows click as follows:
Start Menu->All Programs -> Accessories -> Communications -> HyperTerminal
After typing the code, press F7 or click Project->Build Target for building the source code. If there are no typical errors file will build successively and shows zero errors and zero warnings.
Now enter into debug mode by pressing Ctrl+F5 or click Debug->Start/Stop Debug Session menu. Our program is sending characters ‘Y’, ‘E’, ‘S’ with carriage and line feed to UART #1 continuously. So we want to watch the UART #1 while running this program for receiving values. To get UART #1 tab click View->Serial Windows->UART #1 text.
Run the program by pressing F5 or clicking Debug->Run. You can see the Characters are arranged as ‘YES’ and printed each time on new line on UART #1 tab continuously. If you generate HEX file of this program, burn it into your target chip’s memory using suitable uploader and connecting chip to PC with the help of serial cable you can watch character ‘YES’ on PC’s Hyper Terminal. To stop running the program press red ‘x’ mark icon or click Debug->Stop.
...till next post bye-bye & take care.