Shop OBEX P1 Docs P2 Docs Learn Events
Terminal.getChar problem with debug message window — Parallax Forums

Terminal.getChar problem with debug message window

kjavelinkjavelin Posts: 4
edited 2007-04-11 14:13 in General Discussion
Terminal.getChar doesn't seem to work.· I did HelloWorld.java everything was fine.· I try Capitalize.java and it doesn't work.· That's the one that reads a character from debug message window and it's suppose to capitalize and print it back out.· I also get the same results when I try the TerminalTest.java sample code.· These programs print out their respective welcome message and wait (forever).· I type characters into the small single text area at the bottom of message window.· The characters I type are shown in the larger output area, but the program never seems to continue running.

I've tried several things and everything leads me to believe the program is getting stuck in Terminal.getChar().· If I step into that function with the debugger it seems to stay on a CPU.delay() statement.· Sometimes it eventually comes back with this error:

[noparse][[/noparse]Error IDE-0022] Error reading from the serial port (timeout).

I'm using WindowsXP with the drivers automatically downloaded of the web.· If tried several things including using the latest drivers from FTDI website.· I've played with the USB Serial Port driver advanced settings.· Selecting it to run on COM2 also, setting Latency Timer to 1 msec.· I've also tried this on Windows 2k with the same results.

I bet it something really simple.· Please help.· Thx

Comments

  • SingularitySingularity Posts: 5
    edited 2005-01-24 04:17
    Are you typing the characters in the small text area at the very bottom of the debug window? if Not try that and hitting enter. Typing in the normal display area seems to not get trapped as input bye the IDE. Probably not your problem but worth a try. I find myself typing in the message window from time to time to the same ill effect.

    Post Edited (Singularity) : 1/24/2005 4:20:58 AM GMT
  • kjavelinkjavelin Posts: 4
    edited 2005-01-24 05:27
    Thanks for the reply.· Yes, I'm typing in the one line text field at the bottom of the message window.· Anymore ideas?· Can't believe I'm the only one that has this problem.· Thnx in advanced.
  • SingularitySingularity Posts: 5
    edited 2005-01-24 21:03
    Next dumb idea. Are you using the Javelin board or a Basic stamp board ?

    We have found that although most things work well on these other boards (non Javelin boards) Serial is not one of them.

    The Javelin board has a serial driver (SIPEX i believe) that buffers the serial I/O from the javelin to the serial programming port.

    We have used at least 5 different USB serial adapters and found that even the FTDI unit will sometimes
    have trouble communicating with the Javelin on a basic stamp super carrier board . The identification button would sometimes return a $5F instead of the $50 identifying that a Javelin was found on that port. Oddly enough, we have circumvented the problem by using conventional com ports on Desktop machines or docking stations on laptops. This has happened with at least 4 Javelins and 5 Basic stamp carrier boards that they where attached to.

    If you can run the identify dialog under the project in your menu bar 10 times in a row then you probably don't have this problem.

    Hope this is of some help.
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-01-24 21:26
    The serial driver chip SIPEX is not connected to the javelin

    programming port. It is there to be used with the 16 I/O pins

    via jumper wires.

    regards peter
  • SingularitySingularity Posts: 5
    edited 2005-01-24 21:31
    thanks for the correction peter my mistake
  • kjavelinkjavelin Posts: 4
    edited 2005-01-25 03:54
    Thanks for the information.

    I am using the Board of Education USB Revision B.· Currently I only have the USB cable plugged into the board.· I do not have anything wired to the IO pins.· Maybe·that's my problem?· From my readings I'm given the·impression that debugging is done over the USB cable and I should still be able to use Terminal.getChar().· Also, I ran Identify 10 times and it consistently detects the Javelin on·COM5, Version = $50 and loopback, echo and "got status" all equal Yes.·
  • JavaPaulJavaPaul Posts: 9
    edited 2006-02-12 22:32
    I am experiencing a similar problem. My test program containing "char c = Terminal.getChar();" never accepts input from the debug command line. I am using a Parallax Professional Development Board connected to my Windows XP desktop via a USB port. Using the Identify command in the IDE shows the Javelin at COM4, version $50, Loopback YES, Echo YES, Got Status YES. There is no problem downloading, executing, or seeing output on the debug monitor.

    On the desktop, COM4 is working properly. Advanced Settings under Device Manager show Com4, 4096 byte transmit and receive transfer sizes, 1ms Latency Timer, Miscellaneous Options set to default.

    Here is another piece of information that may be related. With the Debugger active, I can set breakpoints in the IDE. But after hitting the Run button, the IDE outputs "[noparse][[/noparse]Error IDE-0010] Error communicating over the serial port [noparse][[/noparse]corrupt packet $00)." The programs continues to run, but never stops at the breakpoints.

    Any thoughts or suggestions?

    Thanks in advance for your help.

    Paul
  • edited 2006-10-20 09:44
    I am experiencing a similar problem as JavaPaul, under a slightly different configuration : Javelin STAMP, the Board of Education USB from Parallax. I run the Javelin IDE version 2.0.3 under Windows XP.

    The command Project => Identify shows the Javelin at COM2, version $50, Loopback Yes, Echo Yes, Got Status Yes. I have successfully downloaded, executed programs that output text to the debug window.

    I have encountered two problems, though :
    - I am not able to execute programs using the Terminal.getChar() method. The Javelin never gets the characters I enter in lower text box from the Debug Window.
    - I am not able to debug my programsI can set breakpoints but when I start the debugger I get "[noparse][[/noparse]Error IDE-0010] Error communicating over the serial port (corrupt packet $00)". The program starts, but it never stops at breakpoints. The "Step Over" command also gets this error and runs the program until the end.

    Is there anybody that could answer these questions ?

    Thanks in advance for your help

    Andrei
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-10-20 09:52
    It was mentioned in another thread that the usb port on the board
    is the cause for not receiving characters from Terminal.getChar().
    If that board also has a serial port for programming and you do also
    have a serial port on your pc (or a usb2ser cable), you can use a straight serial cable
    to program the javelin and use Terminal.getchar().
    I have not heard of any fix for this problem.

    regards peter
  • edited 2006-10-20 10:43
    Peter, thanks for your answer.

    Peter Verkaik said...
    If that board also has a serial port for programming and you do also
    have a serial port on your pc (or a usb2ser cable), you can use a straight serial cable
    to program the javelin and use Terminal.getchar().
    I have not heard of any fix for this problem.

    My board doesn't have a serial port. So, should I understand that with my USB board I can't debug programs and I can't use Terminal.getChar() ?


    That would be very annoying, because I have already bought 10 boards. There is no warning on the Parallax's website regarding this problem.

    Andrei
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-10-20 10:59
    You can't use the builtin debugger but that doesn't mean you cannot debug.
    I never use the builtin debugger but use print commands to see what is
    going wrong. That·works for me.
    If neccessary I use my JideWinTerminal program to log debug info (my print commands)
    to the pc hardisk so I can review sessions later on.

    You could try this also to see if Terminal.getChar() does work
    when you send text from JideWinTerminal to the javelin.
    To use it, program your javelin, then close the Javelin IDE.
    Then start JideWinTerminal, select the correct comport and click start.

    You·can download JideWinTerminal from here:
    http://tech.groups.yahoo.com/group/JavelinCode/files/JideTerm/

    I know parallax is working on the issue, but I have not heard of a fix yet.

    regards peter
  • edited 2006-10-20 11:10
    Thank you very much Peter.

    I will check this out and try it.

    Best regards,

    Andrei
  • Captain Taquitos!Captain Taquitos! Posts: 12
    edited 2007-04-05 15:05
    Is there any word on a fix for this yet, or is this accepted as the solution?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    mr. pibb + redvines = crazy delicious
  • Robot FreakRobot Freak Posts: 168
    edited 2007-04-07 12:11
    I also can't use Terminal.getChar() but why would I use that?
    Maybe to calibrate my sensors...
    Yeah, that would be nice [noparse]:D[/noparse]

    I agree with Andrei Marculescu. Parallax has no list with known bugs.
    That would be great, because you would know what situations to avoid.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-04-07 21:14
    Robot Freak,

    I will see about adding a note to the Javelin pages about the terminal commands with USB. The other issues are a different story though. While we’re able to identify the issue on specific machines we are unable to duplicate it ourselves. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-04-11 14:13
    Here is a special adapted version of my JideWinTerminal program.
    It automatically sends the character '0' after a datarequest from the javelin.
    If you download the attached java program to the javelin, then exit the IDE
    and start the JideDiag program, you should get repeated output of

    Receive:
    0x11
    Transmit:
    0x12 0x30
    Receive:
    0x05 0x03 0x3D 0x7E
    0x05 0x03 0x30 0x7E
    0x05 0x03 0x78 0x7E
    0x05 0x03 0x33 0x7E
    0x05 0x03 0x30 0x7E
    0x05 0x03 0x0A 0x7E

    If you do not see the 0x11, then the Jide program never receives it and thus
    will never send data to the javelin.
    If you do see the 0x11, then the javelin apparently does not receive the responses
    from the Jide.
    I like to hear what people get that apparently can not use Terminal.getChar().
    This may help in·finding out what is going on, because they can program the
    javelin, and that too uses· bidirectional 28800 baud, just as Terminal.getChar().

    regards peter
Sign In or Register to comment.