Microcontroller PIC16F877 Video 37 How To Enable Serial Communication Using Mikro C Pro

preview_player
Показать описание
Introduction

Computer transfer data in two ways, parallel and serial. In parallel data transfers, often eight or more lines are used to transfer data to a device that is only a few feet away. To transfer to a device located many meters away, the serial method is used. In serial communication, the data is send one bit at a time.

Serial data communication uses two methods.

Synchronous method transfers a block of data at a time.
Asynchronous method transfers a single byte at a time.

There are special IC chips made by many manufactures for serial communication.
UART (universal asynchronous receiver transmitter)
USART (universal synchronous-asynchronous receiver transmitter)

Asynchronous serial data communication is widely used for character-oriented transmission.
Each character is placed in between start and stop bits, this is called framing.
Block-oriented data transfers use the synchronous method.
The start bit is always one bit, but the stop bit can be one or two bits.
The start bit is always a 0(low) and stop bit is always 1(high).

PIC16F877 Serial Communication
PIC16F877 comes with inbuilt USART which can be used for Synchronous/Asynchronous communication. USART is a two wire communication system in which the data flow serially. USART is also a full-duplex communication, means you can send and receive data at the same time which can be used to communicate with peripheral devices.

Registers used for Serial Communication
TXSTA (Transmit Status And Control Register)
RCSTA (Receive Status And Control Register)
SPBRG (USART Baud Rate Generator)

#microcontroller #clanguage #clanguageprogramming #electronicscreators #microcontroller_lab
Рекомендации по теме