Shop OBEX P1 Docs P2 Docs Learn Events
Javelin and Xbee Series 2 — Parallax Forums

Javelin and Xbee Series 2

vic-solarvic-solar Posts: 7
edited 2008-02-07 20:42 in General Discussion
hello everyone:
for the pass 3 weeks I been trying to interface my javelin and some Xbee transcievers, I been using a code that I found in yahoo groups, created by Jon Keinath. the hardware is connected directly, TX from Xbee, to the TX PIN of the Javelin, and the RX connections is the same. when I run the test program the debug window tells me "Check RX pin" well I change the Pin configuration as well and I get the same answer..... is there anything that I'm missing?

thanks

victor

Comments

  • Jon KeinathJon Keinath Posts: 146
    edited 2008-02-02 03:30
    Here is the updated code that I had sent VIA e-mail so others can see what is being talked about.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Jon
    www.jonkeinath.com
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2008-02-02 07:46
    Hi Jon,
    Is this update for a new XBee firmware (series 2) ?
    The XBee.java I have has method
    · private static void waitOK()
    ··· {
    ··· t.mark();····································· //Clear timer for timeout chk
    ··· while (rx.receiveByte() != 'O' | t.timeout( 8000) ); // wait for 'O'
    ··· while (rx.receiveByte() != 'K' | t.timeout(16000) ); // wait for 'K'
    ··· if (!t.timeout(16000)) rx.receiveByte();············ // remove <CR>
    ··· if (t.timeout(16000)) System.out.println("waitOK TIMEOUT");
    ··· }
    Is that still valid for older XBees?

    regards peter
  • Jon KeinathJon Keinath Posts: 146
    edited 2008-02-02 15:36
    No, this update was to correct the previous code. The code you posted would get stuck waiting for data, and not properly tell you if it failed, it would just wait endlessly. So I rewrote the code to properly check for the OK return from the Xbee. I think what was happening is the javelin would not evaluate the while statement because it was waiting for a byte and would not check the timeout also, that and I think that was the wrong OR. I never had a problem with communication so I never debugged it until now. I was able to recreate the error by removing the rx line on my setup.

    victor,
    Are you using one of the appbees shown here? http://www.selmaware.com/appbee/ or some other level shifting item.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Jon
    www.jonkeinath.com
  • vic-solarvic-solar Posts: 7
    edited 2008-02-02 20:22
    No, I build everything in my own breadboard, and I created my own breakout board with one of those PCB kit from radio shack, I did go to selmaware.com and tried to model my design base on the components that they were using, that is why I ask if I need it a buffer or not.

    victor
  • vic-solarvic-solar Posts: 7
    edited 2008-02-04 02:35
    By the way Jon, I should had ask you this earlier, is the code made for the Xbee series 2, and if it is not, should I made changes to it?
    what is your advice on that one!!
  • Jon KeinathJon Keinath Posts: 146
    edited 2008-02-04 03:22
    I will look into it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Jon
    www.jonkeinath.com
  • vic-solarvic-solar Posts: 7
    edited 2008-02-07 20:42
    OK guy, I finally got it, all I had to do was to increase the timeout time in the waitOK function from (800) to (2000).
    and at the same I changed the settings inside the Xbee, from series 2 back to (zigbee AT).
Sign In or Register to comment.