Implementing USART using PIC16F877A + MPLAB X

Implementing USART using PIC16F877A + MPLAB X - welcome to our blog Techno Live, now we will discuss information about the Implementing USART using PIC16F877A + MPLAB X, our admins on this blog has been around to collect information you are looking for so that we usakan to display complete information for you, and in this blog, you can also search for other information, ok please continue reading may be easily understood:

This is about : Implementing USART using PIC16F877A + MPLAB X
And this article : Implementing USART using PIC16F877A + MPLAB X

You can also see our article on:


    Implementing USART using PIC16F877A + MPLAB X


    The Universal Synchronous Asynchronous Receiver Transmitter (USART) module is one of the two serial I/O modules in PIC16F877A. (USART is also known as a Serial Communications Interface or SCI.) The USART can be configured as a full duplex asynchronous system that can communicate with peripheral devices such as CRT terminals and personal computers, or it can be configured as a half duplex synchronous system that can communicate with peripheral devices such as A/D or D/A integrated circuits, serial EEPROMs etc.

    5 Registers are used for USART in PIC16F877A and they are 

    • TXSTA - Transmit status and control Register
    • RCSTA - Receiver status and control Register
    • TXREG -USART Transmit Data Register 
    • RCREG - USART Receive Data Register
    • SPBRG - Baud Rate Generator Register
    Steps to follow when setting up an Asynchronous Transmission
    1.Initialize the SPBRG register for the appropriate baud rate. If a high speed baud rate is desired,
    set bit BRGH .
    2. Enable the asynchronous serial port by clearing bit SYNC and setting bit SPEN.
    3. If interrupts are desired, then set enable bit RCIE.
    4. If 9-bit reception is desired, then set bit RX9.
    5. Enable the reception by setting bit CREN.
    6.Flag bit RCIF will be set when reception is complete and an interrupt will be generated if enable bit RCIE is set.
    7. Read the RCSTA register to get the ninth bit (if enabled) and determine if any error occurred during reception.
    8. Read the 8-bit received data by reading the RCREG register.
    9. If any error occurred, clear the error by clearing enable bit CREN.
    10. If using interrupts, ensure that GIE and PEIE (bits 7 and 6) of the INTCON register are set.

    To start programming in MPLAB X follow the steps as in the :  Blinking a LED using MPLAB X , PIC16F877A

    up to 9th step same as in  Blinking a LED using MPLAB X , PIC16F877A

    The main program have a change according to the steps for Asynchronous Transmission
    #########################################################################


    /* Asynchronous Transmission in  PIC16F877A
     * File:   main.c
     * Author: ebin
     *
     * Created on 10 September, 2012, 11:39 AM
     */

    #include <htc.h>

    #if defined(WDTE_OFF)
    __CONFIG(WDTE_OFF & LVP_OFF);
    #elif defined (WDTDIS)
    __CONFIG(WDTDIS & LVPDIS);
    #endif
    int main(void)
    {
        TRISC6 = 0;
        TRISC7 = 1;
        SPBRG = 25 ;
        BRGH =1 ;
        SPEN =1 ;
        SYNC = 0 ;
        CREN =1 ;
        TXEN =1;
        

        while (1)
        {
            TXREG ='A';
            while(TXIF == 0);
            TXIF=0;
        }
     return 0;
    }


    ##############################################################################


    Articles Implementing USART using PIC16F877A + MPLAB X finished we discussed

    A few of our information about the Implementing USART using PIC16F877A + MPLAB X, I hope you can exploit carefully

    No've You've finished reading an article on Implementing USART using PIC16F877A + MPLAB X and many articles about modern home in our blog this, please read it. and url link of this article is https://liveeconcerts.blogspot.com/2012/09/implementing-usart-using-pic16f877a.html Hopefully discussion articles on provide more knowledge about the world of tech gadgets.

    Tag :

    Related Posts :

    • iCall iNote MiniROM install:- Unpack FlashTools in the ROM , and Click on Flash_tool.exe- Select a the MT6735M_Android_scatter.txt in ROM- Wait file to be a… Read More...
    • iCall iNote6                                      &n… Read More...
    • iCall iNote5 ROM install:- Unpack FlashTools in the ROM , and Click on Flash_tool.exe- Select a the MT6735M_Android_scatter.txt in ROM- Wait file to be a… Read More...
    • iCall iP168ROM install:- Unpack FlashTools in the ROM , and Click on Flash_tool.exe- Select a the MT6735M_Android_scatter.txt in ROM- Wait file to be a… Read More...
    • iCall iNote3ROM install:- Unpack FlashTools in the ROM , and Click on Flash_tool.exe- Select a the MT6735M_Android_scatter.txt in ROM- Wait file to be a… Read More...

    0 Response to "Implementing USART using PIC16F877A + MPLAB X"

    Post a Comment