Connect with us

PIC16F873/7A UART Receiving problem

Discussion in 'Microcontrollers, Programming and IoT' started by anroop, Feb 24, 2014.

Scroll to continue with content
  1. anroop

    anroop

    65
    0
    Dec 11, 2013
    I have used PIC16F873A/7A series to receive a byte from PC and compare it with predefined string and produce result such as making an output high if they are same.
    My problem is with receiving data. i am not able to find out if the data is received. i have tried by waiting for the pic to produce RCIF flag as HIGH (when uart receives 1 byte of data) and then storing the byte in RCREG to a Unsigned temporary variable. I am using Mikro C pro. please help me with this if you have info.

    The config I did for UART Rx. enable are:
    * port c as output and port c 6th & 7th pin were made high
    * spen was enabled
    *cren was enbled
    *sync=0 (asynchronous communication)
    * high baud rate 9600
    * 8 bit reception
     
  2. kpatz

    kpatz

    329
    88
    Feb 24, 2014
    When you say "pins were made high", did you set TRISC 6 & 7 high, which makes the pins input? Both TRISC 6 and TRISC 7 need to be high for the UART to work.

    Setting PORTC values on these pins won't have any effect on the UART.

    If you're using the other PORTC pins as outputs, set TRISC = 0xC0;
     
  3. anroop

    anroop

    65
    0
    Dec 11, 2013
    thanks Kpatz. It was my mistake in reding the Datasheet. Successfully received and responeded to the input.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-