Serial Communication of Microcontrollers with Computer
In different projects, an engineer have to deal with Serial communication between micro controller to micro controller, computer to micro controller, any other module to micro- controller etc.
Most of the time during building projects, you have to communicate with computer to display your results.
If you are working on Arduino then you can communicate with a computer easily. But during working on micro controllers you must learn basics of communication and other stuff.
To Study the basics of serial communication through Atmel AVR Micro controllers like ATmega8 or ATmega 16/32 click the link below:
Hardware for Serial Communication:
Old computers in which still serial ports are available use RS- 232 interface for serial communication. We will not discuss this old technology here. Nowadays “USB to TTL converters” are present to communicate with the devices like micro-controllers, raspberry pi etc.
This simple device can perform serial communication so easily and perfectly with the ability of giving outputs of 5V and 3.3V. So, you can energize the micro-controller through this converter as well. Only attach the Rx pin of micro-controller with the TXD pin of converter and vice versa and that’s it. Your hardware part for communication is ready.
Note: If you are not energizing your micro-controller with this converter then you must attach its ground pin with the micro-controller for reference voltage.
Software for Serial Communication:
here are many softwares available for serial communication like hyper terminal, putty ,docklight etc. Arduino users can use the “Serial Monitor” present inside the Arduino Software. From the above software, use of PUTTY software is very easy and it is open source as well. So, We will discuss only this software here.
Note: If you are using any other micro-controller still you can use that “serial terminal” present inside the Arduino software. You just have to set the proper COM port.
How to Use Putty
When you will plug in the “USB to Serial” converter, it will automatically install it. Now you have to check that on which port the converter is present. For check this go to properties of computer and select device manager.
After entering into device manager click on the “Ports (COM & LPT)” and check the COM number present after the USB –SERIAL CH340. In my case converter is present on COM7. The Name of the USB-TTL converter can be change in your case.
Now, open "putty" software and click on the serial option and set the COM number. Here in the speed box we set the baud rate which is 9600 in my case.
That's it. Now you can easily send or receive the serial data through your computer.
Additional Notes: If you want to change your COM port number for serial communication with computer like COM1 or COM2 then follow the steps stated.
Goto "device manager", right click on the "USB-Serial" and select properties. A new dialog box will be open on which select the "port setting" and then click on "Advanced".
The final dialog box will be open from where you can easily change your COM port numbers which are available for you.
If you want to know more then stay tuned with us and don't forget to comment below and contact us at facebook page.