PIC to PIC Communication using USART - MikroC.pdf

download PIC to PIC Communication using USART - MikroC.pdf

of 4

description

pic

Transcript of PIC to PIC Communication using USART - MikroC.pdf

  • 8/13/13 PIC to PIC Communication using USART - MikroC

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

    electro SomeYou Inspire..We Create..

    Tutorials PIC Microcontroller MikroC PIC to PIC Communication using USART

    PIC to PIC Communication using USART20

    Posted By Ligo George

    3 Jul 2012 | MikroC PIC Microcontroller Tutorials

    Tags: Microcontroller MikroC PIC Proteus USART

    USART Universal Synchronous AsynchronousReceiver TransmitterUSART 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.

    Pic Mikroc Serial Port Protocol

    Usb Parallel Connector

    www.globalspec.com/electronics

    Search Thousands of Catalogs for UsbParallel Connector

    Search Here

    Search

    Subscribe to Our Mails

    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

    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

    email address

    Subscribe

    Home Projects Tutorials Contact Us

  • 8/13/13 PIC to PIC Communication using USART - MikroC

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

    Registers of USARTTo 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

    TXSTA Register PIC Microcontroller

    CSRC : Clock Source Select

    Asynchronous Mode

    Dont care.

    Synchronous Mode

    1 Master Mode (clock generated internally)

    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

    0

    StumbleUponSubmit

    0

    0

    Like

  • 8/13/13 PIC to PIC Communication using USART - MikroC

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

    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.

    Mikroc Serial Port Protocol You Pic

  • 8/13/13 PIC to PIC Communication using USART - MikroC

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

    2013 electro Some All Rights Reserved.

    Disqus seems to be taking longer than usual. Reload?

    Related Posts

    Pages: 1 2 3

    Using UART of PIC

    Microcontroller

    Hi Tech C

    Expanding IO Ports

    of PIC

    Microcontroller

    using MCP23S17

    Interfacing GLCD

    with PIC

    Microcontroller

    Interfacing

    EEPROM with PIC

    Microcontroller

    Interfacing Matrix

    Keypad with PIC

    Microcontroller

    using MikroC

    Library