sending data - numbers between PICs


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2014
    Posts
    17

    Default sending data - numbers between PICs

    I must not be thinking about this right. I need to send an "R", either a "2" or "4", and then a 4 digit decimal number from one PIC to another using hserin and hserouthserin and serout2. Ideally I would like to be able to detect the R when the R##### characters come but first things first. Using a PIC16F688 at 8MHz at 1200 baud.

    This is what I send:
    hserout [ "R", "2", dec4 volts] 'where volts is a 4 digit decimal number

    This is how I am looking for it on the receiving PIC:
    hserin 800, rinse,[syncr, drip, dec4 volts]

    I then print it to a computer for display using:
    serout2 Txd, 813, ["got it_1", 9, syncr, 9, drip, 9, dec4 volts, 13]

    Nothing shows up as output, not even the "got it" text, as if it never gets to this point. I would like to be able to, depending on whether drip is a "2" or a "4", do different things. I think I've done this very thing on other projects so I'm mystified why this doesn't work.

    Thanks for any help.

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,580


    Did you find this post helpful? Yes | No

    Default Re: sending data - numbers between PICs

    Hi,
    Couple of random thoughts:
    Are you perhaps mixing up the baudrate on the two interfaces?
    Have you configured the pin used for the SEROUT2 correctly, no ADC, comparator or anything like that.
    Have you configured the terminal software on the PC for the correct baudrate that SEROUT2 uses?
    Are you using a level converter between the PIC and PC?
    Can you display a startup message, to the PC, using SEROUT2 to verify that THAT part works?
    Have you setup the USART for the correct baudrate on both the sending and the receiving PIC and what baudrate is that?

    /Henrik.

  3. #3
    Join Date
    Oct 2014
    Posts
    17


    Did you find this post helpful? Yes | No

    Default Re: sending data - numbers between PICs

    Thanks for your tips.

    I think the problem may have been in the computer terminal program. I tried a different baud rate - 2400 - and it all worked. I went back to the original 1200 baud and it still worked. Nothing happened in between other than the baud rate was set and reset.

    Tom

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,580


    Did you find this post helpful? Yes | No

    Default Re: sending data - numbers between PICs

    What's the physical connection between the PIC and PC?
    Some "virtual" serial ports, like Bluetooth module for example, don't really care what you set the baudrate to (on the PC).
    Anyway, if it works and you're happy with that then everything's fine.

    /Henrik.

Similar Threads

  1. Question about sending data serially
    By FromTheCockpit in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 1st August 2011, 02:21
  2. Ir problem sending data
    By Mus.me in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 6th December 2009, 06:27
  3. sending data to usart of a pic18f452
    By Safraz_51 in forum Serial
    Replies: 8
    Last Post: - 23rd February 2009, 17:06
  4. problem with sending data using RF module
    By rano_zen06 in forum mel PIC BASIC Pro
    Replies: 51
    Last Post: - 10th April 2008, 18:08
  5. Sending data over USB via VB
    By Tissy in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 12th September 2005, 02:00

Members who have read this thread : 0

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

Tags for this Thread

Posting Permissions

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