Jump to content
IGNORED

ComLynx collision detection


karri

Recommended Posts

Reading comments in another thread I realized that when Lynx is sending only the send interrupt is active. After the message has been sent the receiver is allowed to interrupt again.

 

This may be a logical flaw that makes reliable communication impossible or at least very difficult.

 

Perhaps the sending should read the sent byte before it sends the next byte and if the byte was garbled the transmission would abort with a collision error.

 

Perhaps the sending code

@tx_irq:
        ldx     TxPtrOut    ; Has all bytes been sent?
        cpx     TxPtrIn
        beq     @allSent

        lda     TxBuffer,x  ; Send next byte
        sta     SERDAT
        inc     TxPtrOut

could be replaced by something like

        if (a byte was recently sent by me) {
              read the byte
              if (it was not equal) {
                   there was a collision
                   abort mission
              }
        }
        send a byte
        mark that a byte was sent by me

I also noticed that sending does not appear to start before Lynx receives a character. Obviously the Lynx PUT routine should generate a sending buffer empty interrupt to get the thing going.

 

Comments?

 

--

Karri

Edited by karri
Link to comment
Share on other sites

Makes sense. Besides, thanks for the sources. There is one very interesting and clever approach. When you stop sending a sequence of characters and switch the interrupts back to RX you also read the last byte. If the last byte is different from what you sent you had a collision while writing.

 

There can always be breaks because interference, bad connections...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...