Shop OBEX P1 Docs P2 Docs Learn Events
How to system.out.print/debug to computer? — Parallax Forums

How to system.out.print/debug to computer?

bulkheadbulkhead Posts: 405
edited 2007-07-29 01:46 in Propeller 1
I'm trying to debug some of my code and I want to add print statements, like the "System.out.print()" on the Javelin or DEBUG function with the BS2. Is there a built in function like that or must it be done manually? I'm looking at the BS2 functions object and it appears that it is done manually there, but are there other ways? Thanks.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I'm new to the propeller!

Post Edited (bulkhead) : 7/28/2007 8:27:38 PM GMT

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-28 20:37
    What do you want to use for the output?

    If you want to use a serial LCD, download the "Debug LCD" object from the Object Exchange
    If you want to use a TV monitor, you can use the tv_text object from the Propeller Tool library
    If you want to use a VGA monitor, you can use the vga_text object from the Propeller Tool library
    If you want to use a PC, download the "PC Debug Test & Blink LED Demo" object from the Object Exchange

    Include the appropriate object in an OBJ statement in your program and use it for the display. Most of these
    objects use the same names for their output routines with the possible exception of some using OUT() while
    others use TX(). These usually have routines for displaying single characters, zero-terminated strings, decimal
    numbers, hex numbers, and sometimes binary numbers. Check the source code and demo programs for
    examples.

    I've often used the Parallax 2.5" TV display and tv_text for debugging while the "real program" used a VGA display.
  • bulkheadbulkhead Posts: 405
    edited 2007-07-28 22:52
    Mike, thanks for all of the suggestions, I think the 4th one is what I want. I downloaded and ran the PC_Debug_Test but I could not figure out where the messages are supposed to appear. Is a window just supposed to pop up?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I'm new to the propeller!
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-07-28 22:55
    You need to use a terminal program like hyperterm or similar.

    Graham
  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-28 23:03
    You will need some kind of terminal program running on the PC. In some near future release of the Propeller Tool, there will be a debug window, but Hyperterm (that comes with Windows) will do. PCDebugTest is set up for 460KBaud, but you can change that to anything that works for you (like 19200 Baud). Look at PCDebug and PCDebugTest for descriptions and examples of use of the routines. Keep in mind that, when Hyperterm opens the serial port, the Propeller will get reset. That's normal.
  • APAP Posts: 24
    edited 2007-07-28 23:41
    For what you want I really like to use SimpleDebug.spin. The terminal I use is nothing more than a debugger window from the BS2 STAMP editor.
  • RinksCustomsRinksCustoms Posts: 531
    edited 2007-07-29 01:46
    http://forums.parallax.com/showthread.php?p=649540·<---- The prop terminal is what you seek and is very easy to use and configure.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    E3 = Thought

    http://folding.stanford.edu/·- Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.
Sign In or Register to comment.