Serial comm using pic16f877a....

Discussion in 'Programmer's Corner' started by RRITESH KAKKAR, Apr 11, 2013.

  1. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    Hi,

    I have readied the datasheet for serial communication but it is going over my head, so i need your help for building a serial comm to PC just for now i want to control single led with PC...



    thanks
     
  2. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    Do you have a device that allows you to connect the PIC to the computer, like a USB to TTL converter, Bus Pirate, Bluetooth module, RS-232 to TTL, or anything of the ilk?
     
  3. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    I have nothing you suggest me!!
     
  4. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
  5. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    OK, buying from ebay will take week and i want to complete my project in few days...
    so, can we go with MAX232 or anything else like Bluetooth device??
     
  6. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    The Bluetooth device requires a TTL UART interface, not just any Bluetooth module will work...I've used these little guys for simple projects...

    The MAX232 will allow a computer's serial port to be connected to the PIC.

    Here're some resources to look at:
    ehow

    Another Source

    The datasheet(see page 17)
     
  7. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
  8. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
  9. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    Not. clear what are you saying
    i want to make serial comm from all pc using this device!
     
  10. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    That module seems to use the same chipset add the one I mentioned. As such, it should work.

    I understand what you want to do, that is the topic of the thread and had been discussed up to now...
     
  11. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    What to add here is this device incomplete!
     
  12. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
  13. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    Hi,

    can't we make USB to uC communication without buying USB TTL one?
     
  14. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
  15. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    The signals are entirely incompatible. It is possible to connect directly, but that involves complex software that you are in no position to be trying to implement.
     
  16. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
  17. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    So, what to do now for comm it to UC via PC??
     
  18. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    1.) buy the module suggested

    2.) plug the module in to the PIC. Rx of module to TX of PIC and TX if module to Rx of PIC

    3.) write program that will use the PIC's UART module to send data, with the correct configuration (baud rate, stop bits, parity, etc.) to be compatible with the USB to TTL module.

    4.) use a terminal program (i.e. hyperterminal or TeraTerm) to connect to the virtual COM port that is created for the USB to TTL-again, with the same configuration add both the PIC and USB to TTL module are using and watch the data stream.
     
  19. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    What is X in this??
    (Asynchronous) Baud Rate = FOSC/(64(X+1))
     
  20. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    If you would but look 10mm below the table in the datasheet (which you neglect to mention) you would see that immediately below the table, it says X is the value in SPBRG(0-255), the baud rate generator.
     
Loading...