Before using this presentation , one have to familiar with Embedded system , Various serial port for communication channel,basic knowledge of Matlab , Arduino ..
This a great opportunity for the searcher to get information of this topic .80% of the information provided in this slide was taken from the sparkfun , a very well known website for hardware project and tutorials . One can get more helpful information through this website .
Now, if you are looking for straight forward guideline for Serial Communication , well you are in the right place to have .So , get this if you want to , it's completely open source ( editable ) .
Farewell.
2. Content
1. Serial Communication in Embedded System
2. Up and Running with Arduino for Serial Communication
3. Hardware implementation for serial communication
4. Connect :: Arduino &
a. .. with C++ b. .. with Python
c. .. with Java d. .. with Matlab
3. Serial Communication
1
Process of sending data one bit a time sequentially over a
Communication channel
Variation of Serial Communication
● Asynchronous SC
● Synchronous SC
● RS 232 --
● RS 485 --
● USB --
● Ethernet --
● CAN --
● SPI --
● I2C --
4. Serial Communication
A . Transmitter and Receiver - TX & RX
C. Serial Type :
a) Simplex b) Half-Duplex
c) Duplex
B. Communication in : Serial Interfaces
a) Synchronous Communication - Ex : SPI , I2C
b) Asynchronous Communication - Ex : UART
D. Bit time - Bit Rate 2
5. Rules of Serial
Serial Data Communication
● Baud rate -
a. How fast data transmitted
b. Expressed in bps
c . Baud rate ~ Speed of TX / RX
● Framing the Data :
* Data chunk
* Synchronization bits
* Parity bits
3
6. Wiring & Hardware
A serial bus consists of just two wires - one for sending
data and another for receiving
Serial Communication in Embedded System
Hardware Implementation
● Microcontroller and other low-level ICs communicate serially at TTL level
.TTL serial signal exits between microcontroller ‘s voltage supply range
usually 0v to 3.3v / 5v
● RS 232 , found on computer , is like TTL serial flipped on its head. RS 232
signals usually range between -13v and 13v.
4
7. TTL Serial Signal - Passes data serially
A packet of Information or Frame of Data
5
8. Up & Running : Serial Port of Arduino
#. Initialize with ‘ begin()’ function
#. Bit per second or bps should be 9600 [ default ]
○ void setup() {
○ serial.begin(9600) ; // Open serial ports ; set data rate to 9600 bps
○ }
○ void loop() { }
#. Both side of the serial connection need to be set to use the same speed
6
9. The UART
● Universal Asynchronous Receiver / Transmitter
● The interface between microcontroller and serial port
Advanced UARTs provide some amount of buffering of data so that the computer
and serial devices data streams remain coordinated.
● UARTs do exist as stand-alone ICs, but they’re more commonly found inside
microcontrollers.
● ATmega328 - has just a single UART , one can found in Arduino Uno
7
10. Common Pitfalls
1. TX - to - RX ; RX - to - TX
Connect both devices properly .
2. Baud Rate Mismatch
The two devices must speak with
the same speed otherwise data
either misinterpreted or completely
missed.
8
11. Arduino Serial Port
Connect( ) with Many ..
1. Arduino & Matlab
a. connect with serial port
b. read and write
c. send instruction by .m code
1. Arduino & C++
a. serial communication on
windows based system
1. Arduino & Python
a. install PySerial
1. Arduino & Java
a. arduino can communicate
with serial port via RXTX
java library .
9
12. Conclusion
Let’s make a short summary for serial communication process :
1. Serial protocols separated between Synchronous and Asynchronous
2. Asynchronous is perfect but need to put some extra effort
3. Asynchronous protocols widely used in Embedded system
4. Rules of Serial ..
5. Microcontroller and other ICs communicate at TTL level [ 0v to 3.3v / 5v ]
6. UART is an interface between microcontroller and serial port
7. UART controls computer interface to its attached serial device.
10
13. Q & A
Ask any question related to this topic . Out of the topic question won’t be
answered.
THANK YOU ALL