Issues sending and receiving data


Closed Thread
Results 1 to 20 of 20

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,696


    Did you find this post helpful? Yes | No

    Default Re: Issues sending and receiving data

    hard to see the red bits doing anything of value except to cause framing errors

    you could add the blue bits to prevent framing errors @ startup

    Code:
    COMMTX            VAR        PORTA.2    MESLED            VAR        PORTB.5        'MESSAGE LED
    
    
    
    
    PreAmble         CON     $A5    
    
    
    
    
    '*****************************************************************************
    INIT:
    
    
    
    
    PORTA=000000
    PORTB=000000
    PORTC=000000
    HIGH COMMTX
    pause 10
    GOTO START
    
    
    
    
    '*****************************************************************************
    START:
    
    
    
    
    HIGH INTLED
    HIGH COMMTX
    PAUSE 500
    LOW COMMTX
    LOW INTLED
    
    
    
    
    PAUSE 200
    
    
    
    
    HIGH MESLED
    
    
    
    
    debug PreAmble,$af,$c2,$b5,$ef,13,10
    
    
    
    
    PAUSE 500
    LOW MESLED
    
    
    
    
    PAUSE 4000
    
    
    
    
    GOTO START

    if you use a viable pin on the rx unit it for debug will work , its not a way i would recommend
    Last edited by richard; - 30th October 2024 at 07:52.
    Warning I'm not a teacher

  2. #2
    Join Date
    Jul 2024
    Posts
    28


    Did you find this post helpful? Yes | No

    Default Re: Issues sending and receiving data

    Greetings everyone,

    first of all, thank you so much for your help.
    Will try your suggestions tonight and give feedback.

    @Richard, just to explain...the red bits are there only to trigger the IOC on the receiver side so that it knows when it needs to start listening.
    The reason is because the receiver PIC will do a lot of tasks and will only stop to pay attention to the RX pin when the IOC is triggered.
    The IOC and RX pins are defined as the same pin to save an I/O pin on both sender and received PICs.


    Best regards
    Rui

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,171


    Did you find this post helpful? Yes | No

    Default Re: Issues sending and receiving data

    If you instist on using ISR for the USART receiver, why not use the USART Interrupt directly? It will not work otherwise as Richard noted.

    Test your circuit and logic of the communication first with no interrupts and then decide what to do next.

    Ioannis

  4. #4
    Join Date
    Jul 2024
    Posts
    28


    Did you find this post helpful? Yes | No

    Default Re: Issues sending and receiving data

    Greetings Ioannis,

    Yes, I know...

    the problem is that, although the TX PIC 16F1508 is equipped with a EUSART module, the receiver PIC 16F1503 is not
    The IOC was a workaround that i came up with to trigger the debugin command on the RX PIC.

    Best regards

  5. #5


    Did you find this post helpful? Yes | No

    Default Re: Issues sending and receiving data

    wow, no hardware usart is serious..... your 1503 has mssp interrupt..... if you can make all that work, you are very skilled indeed !

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,171


    Did you find this post helpful? Yes | No

    Default Re: Issues sending and receiving data

    Then you have to run a fast loop and make sure you won't miss any byte.

    Are you sure you cannot change that 1503?

    Ioannis

  7. #7
    Join Date
    Jul 2024
    Posts
    28


    Did you find this post helpful? Yes | No

    Default Re: Issues sending and receiving data

    Hi guys,

    sorry for the late reply...

    After some testing, I decided to change my 16F1503 receiver PIC to a 16F1508 which is equipped with an USART module. It's much easier to implement this way.

    Thank you all for the support!



Similar Threads

  1. SERIN2 Receiving Wrong Data
    By rsocor01 in forum mel PIC BASIC Pro
    Replies: 25
    Last Post: - 4th May 2024, 21:31
  2. how to display data receiving from xbee to LCD
    By NURULHAIZA in forum mel PIC BASIC
    Replies: 2
    Last Post: - 19th November 2010, 22:24
  3. Sending/receiving data using Linx modules
    By Goat 403 in forum Serial
    Replies: 3
    Last Post: - 21st May 2009, 14:57
  4. Receiving and Transmitting Serial data at the same time
    By BobP in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 12th April 2007, 23:00
  5. Receiving data from more than one serial Port
    By PICtron in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 15th March 2005, 11:20

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