Discussion forum for the BasicX family of microcontroller chips.
|
All, I'm having some problems getting 2 BX-24's to talk to one another. I'm using serial com between the two utilizing COM3. I've included my code below for anyone to review, but I'm 98% certain my problem is not software related but hardware. Put simply, when I attach the probe of my logic analyzer to the RX line of the receiving BX, the receiving BX "sees" the incoming bytes. (i.e. StatusQueue(InQue) triggers the if-then decision to go get and print the byte in the queue). When the probe of my logic analyzer is not connected, the incoming byte is not removed from the queue and printed. I'm using the BX develoment board with a "null modem" cable (RX & TX reversed) connecting pins 5 & 6 of two BX's. Is there some kind of external circuity required to get this to work? It would seem as though one should just be able to connect the pins and it would work on its own....at least I think so. Thanks, Ande Boyer ======================== Code of Transmitting BX ======================= Option Explicit Public Sub Main() dim inque(1 to 10) as byte dim outque(1 to 10) as byte dim test_b as byte Call Putpin(5, bxInputTristate) Call Putpin(6, bxOutputHigh) Call OpenQueue(Inque, 10) Call OpenQueue(OutQue, 10) Call DefineCom3(5, 6, bx0000_1000) Call OpenCom(3, 19200, InQue, OutQue) Test_b = 97 do debug.print cstr(test_b) Call PutQueue(OutQue, Test_b, 1) call delay(0.01) loop End Sub ============================= Code of Receiving BX ============================= Option Explicit Public Sub Main() dim Inque(1 to 30) as byte dim OutQue(1 to 30) as byte dim DFU_InQue(1 to 10) as byte dim DFU_OutQue(1 to 11) as byte dim QueData as byte Call OpenQueue(InQue, 30) Call OpenQueue(OutQue, 30) Call putpin(5, bxInputTristate) Call putpin(6, bxOutputHigh) Call OpenQueue(DFU_InQue, 10) Call OpenQueue(DFU_OutQue, 11) Call DefineCom3(5, 6, bx0000_1000) Call OpenCom(3, 19200, DFU_InQue, DFU_OutQue) Call ClearQueue(DFU_InQue) do debug.print"in loop" if (StatusQueue(DFU_InQue)) then Call GetQueue(DFU_InQue, QueData, 1) Call ClearQueue(DFU_InQue) debug.print Cstr(QueData) end if loop End Sub |
|
|
|
Do you have a common ground between the two BX's ? If not run one and if that doesn't solve it try also tying both lines to that ground with a 100K resistor. -----Original Message----- From: Ande_3 [mailto:] Sent: Friday, September 26, 2003 11:52 AM To: Subject: [BasicX] Problem with Serial Com...Wiring? All, I'm having some problems getting 2 BX-24's to talk to one another. I'm using serial com between the two utilizing COM3. I've included my code below for anyone to review, but I'm 98% certain my problem is not software related but hardware. Put simply, when I attach the probe of my logic analyzer to the RX line of the receiving BX, the receiving BX "sees" the incoming bytes. (i.e. StatusQueue(InQue) triggers the if-then decision to go get and print the byte in the queue). When the probe of my logic analyzer is not connected, the incoming byte is not removed from the queue and printed. I'm using the BX develoment board with a "null modem" cable (RX & TX reversed) connecting pins 5 & 6 of two BX's. Is there some kind of external circuity required to get this to work? It would seem as though one should just be able to connect the pins and it would work on its own....at least I think so. Thanks, Ande Boyer ======================== Code of Transmitting BX ======================= Option Explicit Public Sub Main() dim inque(1 to 10) as byte dim outque(1 to 10) as byte dim test_b as byte Call Putpin(5, bxInputTristate) Call Putpin(6, bxOutputHigh) Call OpenQueue(Inque, 10) Call OpenQueue(OutQue, 10) Call DefineCom3(5, 6, bx0000_1000) Call OpenCom(3, 19200, InQue, OutQue) Test_b = 97 do debug.print cstr(test_b) Call PutQueue(OutQue, Test_b, 1) call delay(0.01) loop End Sub ============================= Code of Receiving BX ============================= Option Explicit Public Sub Main() dim Inque(1 to 30) as byte dim OutQue(1 to 30) as byte dim DFU_InQue(1 to 10) as byte dim DFU_OutQue(1 to 11) as byte dim QueData as byte Call OpenQueue(InQue, 30) Call OpenQueue(OutQue, 30) Call putpin(5, bxInputTristate) Call putpin(6, bxOutputHigh) Call OpenQueue(DFU_InQue, 10) Call OpenQueue(DFU_OutQue, 11) Call DefineCom3(5, 6, bx0000_1000) Call OpenCom(3, 19200, DFU_InQue, DFU_OutQue) Call ClearQueue(DFU_InQue) do debug.print"in loop" if (StatusQueue(DFU_InQue)) then Call GetQueue(DFU_InQue, QueData, 1) Call ClearQueue(DFU_InQue) debug.print Cstr(QueData) end if loop End Sub [Non-text portions of this message have been removed] |
|
|
|
I probably don't need to clarify this but on my previous email I said to use a 100K resistor to ground. You need to use one 100k from each line to the common ground. Harry -----Original Message----- From: Ande_3 [mailto:] Sent: Friday, September 26, 2003 11:52 AM To: Subject: [BasicX] Problem with Serial Com...Wiring? All, I'm having some problems getting 2 BX-24's to talk to one another. I'm using serial com between the two utilizing COM3. I've included my code below for anyone to review, but I'm 98% certain my problem is not software related but hardware. Put simply, when I attach the probe of my logic analyzer to the RX line of the receiving BX, the receiving BX "sees" the incoming bytes. (i.e. StatusQueue(InQue) triggers the if-then decision to go get and print the byte in the queue). When the probe of my logic analyzer is not connected, the incoming byte is not removed from the queue and printed. I'm using the BX develoment board with a "null modem" cable (RX & TX reversed) connecting pins 5 & 6 of two BX's. Is there some kind of external circuity required to get this to work? It would seem as though one should just be able to connect the pins and it would work on its own....at least I think so. Thanks, Ande Boyer ======================== Code of Transmitting BX ======================= Option Explicit Public Sub Main() dim inque(1 to 10) as byte dim outque(1 to 10) as byte dim test_b as byte Call Putpin(5, bxInputTristate) Call Putpin(6, bxOutputHigh) Call OpenQueue(Inque, 10) Call OpenQueue(OutQue, 10) Call DefineCom3(5, 6, bx0000_1000) Call OpenCom(3, 19200, InQue, OutQue) Test_b = 97 do debug.print cstr(test_b) Call PutQueue(OutQue, Test_b, 1) call delay(0.01) loop End Sub ============================= Code of Receiving BX ============================= Option Explicit Public Sub Main() dim Inque(1 to 30) as byte dim OutQue(1 to 30) as byte dim DFU_InQue(1 to 10) as byte dim DFU_OutQue(1 to 11) as byte dim QueData as byte Call OpenQueue(InQue, 30) Call OpenQueue(OutQue, 30) Call putpin(5, bxInputTristate) Call putpin(6, bxOutputHigh) Call OpenQueue(DFU_InQue, 10) Call OpenQueue(DFU_OutQue, 11) Call DefineCom3(5, 6, bx0000_1000) Call OpenCom(3, 19200, DFU_InQue, DFU_OutQue) Call ClearQueue(DFU_InQue) do debug.print"in loop" if (StatusQueue(DFU_InQue)) then Call GetQueue(DFU_InQue, QueData, 1) Call ClearQueue(DFU_InQue) debug.print Cstr(QueData) end if loop End Sub [Non-text portions of this message have been removed] |
|
Using a 100K resistor did the trick. (one on each line that is ;) Why does this work? According to my o-scope, when there is no data being passed on the lines, they are usually high (4v). Wouldn't this "pull down resistor" mess that up? Ande --- In , "Harry J. White" <hwhite@d...> wrote: > Do you have a common ground between the two BX's ? If not run one and if > that doesn't solve it try also tying both lines to that ground with a 100K > resistor. > -----Original Message----- > From: Ande_3 [mailto:boyerj@u...] > Sent: Friday, September 26, 2003 11:52 AM > To: > Subject: [BasicX] Problem with Serial Com...Wiring? > All, > > I'm having some problems getting 2 BX-24's to talk to one another. > > I'm using serial com between the two utilizing COM3. I've included > my code below for anyone to review, but I'm 98% certain my problem is > not software related but hardware. > > Put simply, when I attach the probe of my logic analyzer to the RX > line of the receiving BX, the receiving BX "sees" the incoming bytes. > (i.e. StatusQueue(InQue) triggers the if-then decision to go get and > print the byte in the queue). When the probe of my logic analyzer is > not connected, the incoming byte is not removed from the queue and > printed. > > I'm using the BX develoment board with a "null modem" cable (RX & TX > reversed) connecting pins 5 & 6 of two BX's. > > Is there some kind of external circuity required to get this to work? > It would seem as though one should just be able to connect the pins > and it would work on its own....at least I think so. > > Thanks, > Ande Boyer > > ======================== > Code of Transmitting BX > ======================= > Option Explicit > > Public Sub Main() > > dim inque(1 to 10) as byte > dim outque(1 to 10) as byte > dim test_b as byte > > Call Putpin(5, bxInputTristate) > Call Putpin(6, bxOutputHigh) > Call OpenQueue(Inque, 10) > Call OpenQueue(OutQue, 10) > > Call DefineCom3(5, 6, bx0000_1000) > Call OpenCom(3, 19200, InQue, OutQue) > > Test_b = 97 > > do > debug.print cstr(test_b) > Call PutQueue(OutQue, Test_b, 1) > call delay(0.01) > loop > > End Sub > > ============================= > Code of Receiving BX > ============================= > Option Explicit > > Public Sub Main() > > dim Inque(1 to 30) as byte > dim OutQue(1 to 30) as byte > dim DFU_InQue(1 to 10) as byte > dim DFU_OutQue(1 to 11) as byte > > dim QueData as byte > Call OpenQueue(InQue, 30) > Call OpenQueue(OutQue, 30) > > Call putpin(5, bxInputTristate) > Call putpin(6, bxOutputHigh) > Call OpenQueue(DFU_InQue, 10) > Call OpenQueue(DFU_OutQue, 11) > Call DefineCom3(5, 6, bx0000_1000) > Call OpenCom(3, 19200, DFU_InQue, DFU_OutQue) > > Call ClearQueue(DFU_InQue) > > do > debug.print"in loop" > > if (StatusQueue(DFU_InQue)) then > Call GetQueue(DFU_InQue, QueData, 1) > Call ClearQueue(DFU_InQue) > debug.print Cstr(QueData) > end if > loop > > End Sub > > > [Non-text portions of this message have been removed] |
|
No, because the output driver on the chip can output up to 10ma or .01 amps and a 100K resistor will only sink .00001 amps. What this does is stop any build up of charge on the communication line. Harry -----Original Message----- From: Ande_3 [mailto:] Sent: Friday, September 26, 2003 2:48 PM To: Subject: [BasicX] Re: Problem with Serial Com...Wiring? Using a 100K resistor did the trick. (one on each line that is ;) Why does this work? According to my o-scope, when there is no data being passed on the lines, they are usually high (4v). Wouldn't this "pull down resistor" mess that up? Ande --- In , "Harry J. White" <hwhite@d...> wrote: > Do you have a common ground between the two BX's ? If not run one and if > that doesn't solve it try also tying both lines to that ground with a 100K > resistor. > -----Original Message----- > From: Ande_3 [mailto:boyerj@u...] > Sent: Friday, September 26, 2003 11:52 AM > To: > Subject: [BasicX] Problem with Serial Com...Wiring? > All, > > I'm having some problems getting 2 BX-24's to talk to one another. > > I'm using serial com between the two utilizing COM3. I've included > my code below for anyone to review, but I'm 98% certain my problem is > not software related but hardware. > > Put simply, when I attach the probe of my logic analyzer to the RX > line of the receiving BX, the receiving BX "sees" the incoming bytes. > (i.e. StatusQueue(InQue) triggers the if-then decision to go get and > print the byte in the queue). When the probe of my logic analyzer is > not connected, the incoming byte is not removed from the queue and > printed. > > I'm using the BX develoment board with a "null modem" cable (RX & TX > reversed) connecting pins 5 & 6 of two BX's. > > Is there some kind of external circuity required to get this to work? > It would seem as though one should just be able to connect the pins > and it would work on its own....at least I think so. > > Thanks, > Ande Boyer > > ======================== > Code of Transmitting BX > ======================= > Option Explicit > > Public Sub Main() > > dim inque(1 to 10) as byte > dim outque(1 to 10) as byte > dim test_b as byte > > Call Putpin(5, bxInputTristate) > Call Putpin(6, bxOutputHigh) > Call OpenQueue(Inque, 10) > Call OpenQueue(OutQue, 10) > > Call DefineCom3(5, 6, bx0000_1000) > Call OpenCom(3, 19200, InQue, OutQue) > > Test_b = 97 > > do > debug.print cstr(test_b) > Call PutQueue(OutQue, Test_b, 1) > call delay(0.01) > loop > > End Sub > > ============================= > Code of Receiving BX > ============================= > Option Explicit > > Public Sub Main() > > dim Inque(1 to 30) as byte > dim OutQue(1 to 30) as byte > dim DFU_InQue(1 to 10) as byte > dim DFU_OutQue(1 to 11) as byte > > dim QueData as byte > Call OpenQueue(InQue, 30) > Call OpenQueue(OutQue, 30) > > Call putpin(5, bxInputTristate) > Call putpin(6, bxOutputHigh) > Call OpenQueue(DFU_InQue, 10) > Call OpenQueue(DFU_OutQue, 11) > Call DefineCom3(5, 6, bx0000_1000) > Call OpenCom(3, 19200, DFU_InQue, DFU_OutQue) > > Call ClearQueue(DFU_InQue) > > do > debug.print"in loop" > > if (StatusQueue(DFU_InQue)) then > Call GetQueue(DFU_InQue, QueData, 1) > Call ClearQueue(DFU_InQue) > debug.print Cstr(QueData) > end if > loop > > End Sub > > > [Non-text portions of this message have been removed] [Non-text portions of this message have been removed] |