Looking for Basic Pic-to-Pic Serial Example


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Here is a simple hardware sample to receive and send serially.
    It will echo from a terminal program.
    If I remember correctly mister E posted this a long time ago.
    Works well for testing a setup.
    Code:
    DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
    DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 0
    DEFINE HSER_SPBRG 129 ' 2400 Baud @ 20MHz, 0.17%
    DEFINE HSER_CLROERR 1 ' Clear overflow automatically
    DEFINE HSER_EVEN    1
    DEFINE HSER_BITS    7
    
    RCIF   VAR PIR1.5
    SERIALDATA  VAR BYTE
    
    PAUSE 100
    
    MAIN:
    IF RCIF THEN
        HSERIN  [SERIALDATA]
        HSEROUT [SERIALDATA]
        ENDIF
    GOTO MAIN
    Hello mackrackit,

    With this code can test the operation of a port rs232 with a pic?, I can say that pic would be used and the configuration of the pins is very interesting!.

    Thank you

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Leonardo View Post
    Hello mackrackit,

    With this code can test the operation of a port rs232 with a pic?, I can say that pic would be used and the configuration of the pins is very interesting!.

    Thank you
    You will need a level converter (max232) between the PIC and PC.
    Also the code was to show how to setup for different bits and so forth.
    Sorry if it confused things.
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. PIC to PIC "wired" serial one-way communication - SERIN2/SEROUT2
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 14th April 2008, 21:02
  2. Automatic VB6 to pic serial connection
    By arniepj in forum Code Examples
    Replies: 13
    Last Post: - 10th January 2008, 08:57
  3. Serial Com Pic to Pic
    By uludere72 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 31st May 2005, 11:06
  4. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th March 2005, 00:14
  5. Serial communication PIC to PIC help.
    By Rubicon in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 24th January 2005, 16:45

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