pic16f877a to pc

Discussion in 'Embedded Systems and Microcontrollers' started by cecece, Feb 26, 2011.

  1. cecece

    Thread Starter New Member

    Feb 26, 2011
    3
    0
    Hello. I am a newbie in this forum. I hope somebody can help me. Thx

    I use hi-tech c to write the program. As I see that the mickroC has some internal functions such as usart_data_ready, usart_read, usrt_write, these can be convenient for the user. So I hope to know that any "replacement" function in hi-tech c??

    if no, what can I do in the program for pic communication through serial port to pc??

    Thanks!
     
  2. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    In the Hi-Tech C install folder you will find a folder named samples. Inside here you will find some serial port examples. However small modifications to the sample may be required depending on which chip you use. Check the data sheet to see what is required in order to get the serial port working. You can use the MPLAB simulator to simulate data on the serial port.
    See also here
    http://forum.allaboutcircuits.com/showthread.php?t=44852
     
  3. cecece

    Thread Starter New Member

    Feb 26, 2011
    3
    0
    Thanks for your help.
    But I can't find that "samples" folder. Do u mean user manual? If no, can u give me the website link to me?
     
  4. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Huh do not have something like this:confused:
    C:\Program Files\HI-TECH Software\PICC\9.80\samples
     
  5. cecece

    Thread Starter New Member

    Feb 26, 2011
    3
    0
    oh, thank you so much. I got that file.
    But I see that there are "serial" file and "usart" file. If I need to communicate between pic and pc, which one is more suitable for my task?:(
     
  6. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Start with the example you can understand. And READ THE DATA SHEET! It is many small details that need to be correct. Before a serial datalink may work. Also the art of debugging is important. Using the MPLAB SIM that is a software simulator in MPLAB may help you a lot.
    se more here http://forum.allaboutcircuits.com/showthread.php?t=44852
    As a first step build a simple app that can take a single char from some terminal tool. Read it and echo it back to the terminal program.
     
Loading...