help about connecting 2 PICs


Closed Thread
Results 1 to 2 of 2
  1. #1
    micro's Avatar
    micro Guest

    Default help about connecting 2 PICs

    i want to conect 2 PICs by using USART port
    the transmitter one is pic16F84 and the reciever one is
    pic16f877

    for TX the codes are

    INCLUDE "modedefs.bas"
    trisb = %00000000
    main:
    serout portb.1,T9600, [8] ; send the number 8
    goto main



    for RX the codes are
    b var byte

    start :

    hserin [b] ; recieve number 8 on the RX port

    serout 1,2,[254,1]
    pause 2
    serout 1,2,[#b] ; view the number 8 on a serial LCD
    pause 100
    goto start

    the problem is in the RX side i don't recieve the correct number
    so what is wrong with codes ??

    i used 2 pic16f877 ad i used HSEROUT and HSERIN and there is no
    problem but i wanted to use different PICs this time
    but i got wrong result

  2. #2
    micro's Avatar
    micro Guest


    Did you find this post helpful? Yes | No

    Default

    i use now 2 pic16f84 to connect them serially by using the command
    serout and serin, but there is something i would to ask about it

    in the transmitter the codes is

    trisb=0
    serout 1,2,[%11111111]


    in the reciever

    trisa = 1
    trisb= 0
    b var word
    serin porta.1,2,b
    portb = b


    i got the 1's bits in the other side but when i increase number of bits
    in the transmitter about 10 bits i note some shifts in bits,
    then 8 bits blocks transmitted one time
    so if i want to transmit more bits should i arrange them in 8 bit blocks
    and transmit them as 8 bits at a time and in the other side i rearrange them again ???

Similar Threads

  1. connect 2 PICs
    By drama in forum mel PIC BASIC
    Replies: 1
    Last Post: - 4th October 2007, 16:55
  2. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  3. xport + connecting 2 networks
    By rf_xport in forum General
    Replies: 0
    Last Post: - 12th July 2006, 06:26
  4. Transceivers with 2 different PICs.
    By Eng4444 in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 7th June 2006, 09:31
  5. 2 PIC's 1LCD
    By puma in forum General
    Replies: 2
    Last Post: - 3rd August 2004, 17:58

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