Вы находитесь на странице: 1из 4

8/13/13

PIC to PIC Communication using USART - MikroC

electro Some
You Inspire..We Create..
Tutorials PIC Microcontroller

Home
MikroC

Projects

Tutorials

Contact Us

PIC to PIC Communication using USART

PIC to PIC Communication using USART


20
Posted By Ligo George 3 Jul 2012 | MikroC PIC Microcontroller Tutorials Tags: Microcontroller MikroC PIC Proteus USART
Pic Mikroc Serial Port Protocol

Search Here
Search

Subscribe to Our Mails


email address

Subscribe

Usb Parallel Connector


www.globalspec.com/electronics Search Thousands of Catalogs for Usb Parallel Connector

Most Viewed
Voltmeter and Ammeter using PIC Microcontroller - 23,846 views USB PIC Programmer : PICKit2 - 22,320 views Interfacing Stepper Motor with PIC Microcontroller - 21,533 views Interfacing DC Motor with PIC Microcontroller using L293D - 21,037 views Digital Clock using PIC Microcontroller and DS1307 RTC - 19,903 views

USART Universal Synchronous Asynchronous Receiver Transmitter


USART is the most commonly used serial I/O module. It is also known as Serial Communications Interface (SCI). USART can be easily configured as a full-duplex asynchronous communication system that can communicate with peripheral devices, such as personal computers and CRT terminals, or it can be configured as a half-duplex synchronous communication system that can communicate with peripheral devices, such as serial EEPROMs, A/D or D/A integrated circuits, etc. USART can be configured in the following modes. Synchronous Master Half Duplex Synchronous Slave Half Duplex Asynchronous Full Duplex We dont want to bother about configuring registers as MikroC Pro for PIC Microcontrollers have built-in library function to handle asynchronous communication.

Recent Posts
Using UART of PIC Microcontroller Hi Tech C Interfacing LCD with PIC Microcontroller Hi Tech C Getting Started with Scilab Beginners Tutorial Getting Started with Python Using ADC Module of PIC Microcontroller Hi Tech C

www.electrosome.com/pic-to-pic-communication-usart/2/

1/4

8/13/13

PIC to PIC Communication using USART - MikroC

Registers of USART
To use the USART of PIC 16F877A Microcontroller, the following registers must be configured. But when using MikroC we dont want to bother about it.

TXSTA : TRANSMIT STATUS AND CONTROL REGISTER


0
Like

0 CSRC : Clock Source Select

TXSTA Register PIC Microcontroller

Asynchronous Mode StumbleUpon Dont care. Submit Synchronous Mode 0 (clock generated internally) 1 Master Mode 0 Slave Mode (clock from external source) TX9 : 9-bit Transmit Enable 1 9-bit transmission 0 8-bit transmission TXEN : Transmit Enable 1 Transmit Enabled 0 Transmit Disabled SREN/CREN (in RCSTA register) overrides TXEN in Sync mode. SYNC : USART Mode Select 1 Synchronous Mode 0 Asynchronous Mode BRGH : High Baud Rate Select Asynchronous Mode 1 High speed 0 Low speed Synchronous Mode Not Used TRMT : Transmit Shift Register Status 1 Transmit Status Register empty 0 TSR full TX9D : 9th bit of Transmit Data or Parity bit

RCSTA : RECEIVE STATUS AND CONTROL REGISTER

RCSTA Register PIC Microcontroller

SPEN : Serial Port Enable

www.electrosome.com/pic-to-pic-communication-usart/2/

2/4

8/13/13

PIC to PIC Communication using USART - MikroC

Mikroc

Serial Port

Protocol

You Pic

1 Serial port is enabled 0 Serial port is disabled RX9 : 9-bit Receive Enable 1 Sets 9-bit reception 0 Sets 8-bit reception SREN : Single Receive Enable Asynchronous Mode Not Used. Synchronous Master Mode 1 Enables single receive 0 Disables single receive This bit will be cleared after reception. Synchronous Slave Mode Not Used. CREN : Continuous Receive Enable Asynchronous Mode 1 Enables continuous receive 0 Disables continuous receive Synchronous Mode 1 Enables continuous receive till enable bit CREN is cleared (Note : CREN overrides SREN) 0 Disables continuous receive ADDEN : Address Detect Enable Asynchronous 9-bit Mode 1 Enables address detection 0 Disables address detection FERR : Framing Error 1 Framing error 0 No framing error OERR : Overrun Error 1 Overrun error 0 No overrun error RX9D : 9th bit or Parity Bit of Received Data Now I am not writing about configuring these registers as MikroC Pro for PIC Microcontroller has built in function to handle Asynchronous Communication.
www.electrosome.com/pic-to-pic-communication-usart/2/ 3/4

8/13/13

PIC to PIC Communication using USART - MikroC

Related Posts

Using UART of PIC Microcontroller Hi Tech C

Expanding IO Ports Interfacing GLCD of PIC Microcontroller using MCP23S17 with PIC Microcontroller

Interfacing EEPROM with PIC Microcontroller

Interfacing Matrix Keypad with PIC Microcontroller using MikroC Library

Pages: 1 2 3

Disqus seems to be taking longer than usual. Reload?

2013 electro Some All Rights Reserved.

www.electrosome.com/pic-to-pic-communication-usart/2/

4/4

Оценить