PIC to PIC TX RX and PIC to PC COM RX ..a little help please


Closed Thread
Results 1 to 40 of 68

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Yes, you need DEBUGIN and DEBUG defines.

    I am giving you this stuff from memory and evidently I have forgotton something. When I get back to the shop tonight I will test it and see what I am missing.

    Maybe someone will fill in my blanks
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    The send code
    Code:
        DEFINE DEBUG_MODE  1    ' Debug sending INVERTED serial data
        DEFINE DEBUG_REG PORTB  ' Debug Port = PortC
        DEFINE DEBUG_BIT 3      ' Debug.bit = PortC.4
        DEFINE DEBUG_BAUD 2400  ' Default baud rate = 2400
    
    DEBUG "9",DEC 3,$d,$a
    The receive code
    Code:
        DEFINE DEBUGIN_MODE  1    ' Debug sending INVERTED serial data
        DEFINE DEBUGIN_REG PORTB  ' Debug Port = PortC
        DEFINE DEBUGIN_BIT 4      ' Debug.bit = PortC.4
        DEFINE DEBUGIN_BAUD 2400  ' Default baud rate = 2400
    
    DEBUGIN [WAIT("9"),DEC NET]
    I just ran this in real life, it works.
    Sorry for giving it wrong before.
    Dave
    Always wear safety glasses while programming.

  3. #3


    Did you find this post helpful? Yes | No

    Default pssst Dave .....

    IT WORKS !!!
    WOOOOOOHOOOOOOOOOO you ROCK ! :-)

    Thank you thank you thank you :-)

    By the way that memory of yours was pretty damn close :-)
    Seems inverted mode was needed ?

    What are the $d and $a for in the line below by the way ?

    Code:
    DEBUG "9",DEC 3,$d,$a
    And now for HSERIN and OUT

    A few questions first ..

    1. With HSERIN and OUT , is it a necessity to use the onboard TX/RX pins , in my case PORTC. and PORTC.7 ?

    2. Is it pretty much a case of replacing the debug lines with HSERIN as you said in a n earlier posting ?

    Thanks again Dave

    Dennis

  4. #4
    Join Date
    Dec 2005
    Location
    Salt Lake City, Ut, USA
    Posts
    108


    Did you find this post helpful? Yes | No

    Default

    Hello Dennis,

    I don't know if Dave is online now, so I thought I'de jump in and answer your 2 questions real quick...As Dave has helped me immensely on the same serial in out topic...Thanks again Dave!

    1) The $d $a is a "Carriage Return - Line Feed" terminator
    2) Yep, the hardware ports have to be used for HSERIN/OUT.

    Hope I helped and didn't offend you Dave

    Enjoying this thread, and learning from it too!

    Chris

  5. #5


    Did you find this post helpful? Yes | No

    Default Hey Chris

    Thanks so much :-)

    I really appreciate it :-)

    I haven't tried it yet as I was awaiting Dave's instruction and possibly a code snippet.
    The reason for this is that I like to having a working reference first and then experiment.
    I have learned that by doing the wrong things first you battle even more and as the late nights roll by you find your concentration span dwindling more and more no matter how excited or motivated you are.
    Not only that, you also find it's so frustrating and de-motivating when things just don't work and you'd like to get on with the next step but you can't because something you have done incorrectly (something as small as a character in the wrong place) is holding you back.Even if someone just points you to a document or flames you for putting the code in the wrong place without the code tags. You learn from this ..logical baby steps count !

    It is so nice to have the chance to be involved with such a helpful community who share a common interest. I long for the day when I too have strong enough 'code eyes' and experience to also help others here :-)
    Thank you all !!

    Kind regards

    Dennis

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


    Did you find this post helpful? Yes | No

    Default

    Hope I helped and didn't offend you Dave
    This is a community effort, the more giving the better.
    And it is kinda hard to offend me anyways

    yup, the DEBUG and HSER syntax is pretty much the same. The DEFINES are different and like Chris said the hardware pins have to be used.

    Earlier in this thread I gave an example of using HSER with out DEFINES but for most cases I do use them. Start that way.

    If are are going to communicate with a PC and/or some other things an inverter setup is needed, RS232 chips are mostly used for this.

    There are some calculations needed for the DEFINES and I cheat by using this
    http://www.picbasic.co.uk/forum/showthread.php?t=4994

    I am not at my machine again and I learned my lesson about going from memory so no snippets from me at this time. Chris??? Do you have one to get him started???
    Dave
    Always wear safety glasses while programming.

  7. #7


    Did you find this post helpful? Yes | No

    Default fading memory is better than no memory !

    Dave ..

    Thanks again, but fading memory is better than no memory ( lol or is it ?)

    So even if it's wrong it will send me hurtling off in the HSER direction on a voyage of discovery and when I'm truly stumped I will ask for assistance then and only then !

    Kind regards

    Dennis

Similar Threads

  1. Direct PIC to PC without MAX232
    By acjacques in forum Serial
    Replies: 14
    Last Post: - 23rd October 2014, 21:32
  2. Serial VB 2005 pic 16f877a problems
    By Snap in forum mel PIC BASIC Pro
    Replies: 28
    Last Post: - 8th July 2013, 00:52
  3. PIC or xbee times out after Tx 504 bytes
    By archendekta in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 23rd November 2009, 08:45
  4. 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
  5. RX TX modules - intermitent communication
    By ruijc in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 11th June 2009, 00:13

Members who have read this thread : 2

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