PIC 2 PIC communication


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Posts
    34


    Did you find this post helpful? Yes | No

    Smile Pic 2 Pic

    Hi smeet
    What chip are you using? I believe you are doing an a/d conversion and try to send the conversion.
    How many bites are you trying to send at a time? you can put your bites in an array var. and then send it, if you let me have your Email then I can send you a sample or two and do you realy need to use the UART?
    Here is a 20 bite array sample:
    First define the array as folow:
    L1 VAR BYTE[20]
    SerOut PORTA.6,N1200,["A",L1[0],L1[1],L1[2],L1[3],L1[4],L1[5],L1[6],L1[7],L1[8],L1[9],L1[10],L1[11],L1[12],L1[13],L1[14],L1[15],L1[16],L1[17],L1[18],L1[19]]
    SerIn PORTA.5,N1200,3000,label,["A"],L1[0],L1[1],L1[2],L1[3],L1[4],L1[5],L1[6],L1[7],L1[8],L1[9],L1[10],L1[11],L1[12],L1[13],L1[14],L1[15],L1[16],L1[17],L1[18],L1[19]
    Last edited by ChrisMicro; - 27th April 2006 at 00:59.

  2. #2
    smeet's Avatar
    smeet Guest


    Did you find this post helpful? Yes | No

    Default Re:

    Hi ,

    i am using PIC 16F877A... Ill attach my code hre... Im basically trying to send my A/d bits using a 418 Mhz transmitter... If I do not use HEROUt it really slows down my code as I am not using interrupts... I have not used interrupts bfore and need to get this code working in a day.. I d really appreciate your help... Im attaching my transmission and reception code here... Im trying Manchester encoding here and then transmit those 16 bits... I understand that I can send only 8 bits at a time so do u suggest I serout 2 array byte and serin two at the other end... I noticed you have added N1200 instead of T1200... CAn i use T1200..

    My email is [email protected]

    Part of the Code for serout :

    A: Pause 5
    If ADCON0.2 = 1 Then A

    B0 = ADRESH>>4
    B0=B0<<4
    ADRESH = 0
    ' PORTD=B0

    ADCON0 = %00111001
    Pause 5
    ADCON0.2 = 1

    B: pause 5
    if ADCON0.2 = 1 Then B

    B1 = ADRESH >> 4

    ByteIn = B0+B1

    PORTD = ByteIn

    GOSUB Encode

    'hserout [B2]
    hserout ["A",Manch] // I guess I went wrong here... Can I split Manch as 2 bytes c0 and c1 and use Hserout
    'serout2 PORTB.6,N1200,["A",B2]
    PAUSE 5

    GOTO Main

    Encode:
    for Index = 0 to 7
    if ByteIn.0[Index] = 0 then
    Manch.0[Index*2] = 0
    Manch.0[Index*2+1] = 1
    else
    Manch.0[Index*2] = 1
    Manch.0[Index*2+1] = 0
    endif
    next Index
    For Index = 0 to 7
    Manch.0[(Index*2)] = ~ByteIn.0[Index]
    Manch.0[(Index*2)+1] = ByteIn.0[Index]
    'Next Index
    'Return

  3. #3
    smeet's Avatar
    smeet Guest


    Did you find this post helpful? Yes | No

    Default Re:

    I have shown Next Index and Return as commented.. They are not commented though...

Similar Threads

  1. communication of pic 18f4520 and cell phone
    By Alisha in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th February 2010, 11:47
  2. Replies: 11
    Last Post: - 12th July 2008, 02:36
  3. pic to pic communication pic2pic
    By aftab in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th October 2007, 17:16
  4. USB communication with pic
    By Shamir in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 14th August 2006, 23:43
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14

Members who have read this thread : 0

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