2 PIC, serial communication


Results 1 to 7 of 7

Threaded View

  1. #1
    Join Date
    Sep 2009
    Posts
    2

    Default 2 PIC, serial communication

    hi,good day to everyone...
    I have a hard time throughout the process of learning serial communication, but gained nothing at last.
    I tried with 2 PIC where each of the PIC will control the LED that connected with it.
    There are 2 PIC in the drawing. Let the left PIC = A, right PIC = B.
    What i want to have is....A control the LED that connected with B, and B control the LED that connected with A.
    I started a bit of the coding but stuck somewhere in the middle. I don't know how to use HSERIN and HSEROUT even though I went through the manual.

    I know there should be 2 sets of similar coding which i can download it into PIC while doing the simulation in Proteus Isis. But at this moment, I can't even write my coding with HSERIN and HSEROUT.

    Attachment below shows the connection in Proteus. I only had problem with my coding.

    So any help.....I will be so grateful....Thanks in advance...

    Coding as below:

    Define osc 8
    define HSER_RCSTA 90H 'Enable serial port and continous receive
    DEFINE HSER_TXTSTA 24H 'Enable transmit
    DEFINE HSER_BAUD 9615
    DEFINE HSER_CLROERR 1 'Clear overflow automatically
    ADCON1 = 7


    TRISB.0 = 1 'switch
    TRISB.2 = 0 'LED
    TRISC.6 = 0 'set TX(portC.6) to out
    TRISC.7 = 1 'set RX(portC.7) to in

    led1 var portb.2

    Hserout [
    Attached Images Attached Images  

Similar Threads

  1. serial to PIC
    By kindows in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 14th July 2009, 13:58
  2. Automatic VB6 to pic serial connection
    By arniepj in forum Code Examples
    Replies: 13
    Last Post: - 10th January 2008, 07:57
  3. Serial Communication using 12F629
    By charudatt in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 14th March 2005, 04:24
  4. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14
  5. How many serial ports can 1 PIC handle?
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd March 2005, 04:34

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts