PIC to PIC , 16F867


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2007
    Posts
    2

    Smile PIC to PIC , 16F867

    Hi all,

    I'm trying to send data to another pic and read it off and LCD, but with no luck, i have tried all combos of serial commands...can somebody please point out the error, sorry its the 16F87

    TX:-

    DEFINE OSC 10

    include "modedefs.bas"

    output portA.0
    output PortA.1

    LED1 var PORTA.1 ' Set Data to PortA

    B0 var byte

    let b0 = 200

    seroutpin var porta.0

    loop:

    Serout2 seroutpin,3313,[$55,$55,$66,B0]

    High LED1 '
    Pause 200

    Low LED1
    Pause 200

    goto loop

    ************************************************** ******

    RX:-

    ******************LCD init

    define osc 4

    TRISA = %11111111

    output PortA.0

    LED1 var PORTA.0 ' Set Data to PortA

    input portA.1

    SerinPin var PortA.1

    B0 var Byte

    pause 1000 ' LCD startup

    Lcdout $fe, 1 ' Clear LCD screen
    pause 600
    Lcdout "hello world" '
    Pause 300 ' Wait .5 second
    b0 = 2


    Main:
    Serin2 serinpin,3313,[wait ($66),B0] ' preamble
    lcdout dec B0
    pause 300

    High LED1
    Pause 200
    Low LED1
    Pause 200
    goto main

    End

    does it make a diff is the both pics are working off differenct osc speeds?

    Thanks,
    DhesanR
    Last edited by DhesanR; - 11th January 2008 at 10:26. Reason: one of the comments was wrong

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default

    16F87x chips have ANALOG on PortA. ADC will need to be disabled.

    http://www.picbasic.co.uk/forum/showthread.php?t=561
    http://www.picbasic.co.uk/forum/showthread.php?t=562

    does it make a diff is the both pics are working off differenct osc speeds?
    It does not make a Difference.
    Dave
    Always wear safety glasses while programming.

  3. #3
    skimask's Avatar
    skimask Guest

    Default

    Quote Originally Posted by mackrackit View Post
    16F87x chips have ANALOG on PortA. ADC will need to be disabled.
    Says it's a PIC16F87...
    Same thing still applies though...

    Also, internal oscillators suck for serial comm's, for the most part. Not saying that they never work, but most of the time, there's problems.
    Use a crystal at both ends.

Similar Threads

  1. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 10:00
  2. Replies: 67
    Last Post: - 8th December 2009, 02:27
  3. HSERIN & Interupts (aka controlling PIC programs from a remote PC)
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 17th June 2009, 14:46
  4. pic to pic ir link versus wired link : help please anyone
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th May 2008, 21:01
  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 : 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