Shop OBEX P1 Docs P2 Docs Learn Events
Debug Window? — Parallax Forums

Debug Window?

Newbie question, how do I get debug statements to appear in the debug window? I am running Propeller Tool 2.5.2, debug mode is enabled (Control-D), and I have a simple program which just writes debug messages:

CON
_clkfreq = 160_000_000

pub main()
debug(message 'test 123') repeat pintoggle(56) waitms(250) debug(message 'Hello World!')

Running P2 Edge on McPhalen board.

When I go to run the code, a "DEBUG Output" window opens but nothing ever appears in it. The LED is flashing as expected.

Comments

  • Cluso99Cluso99 Posts: 18,069

    I haven't run debug, but I think you need a backtick ` preceding the debug statement.
    Also I think your syntax might be wrong too. Have a look at one of the example programs.

  • cgraceycgracey Posts: 14,151
    edited 2021-03-13 05:13

    Review the syntax in the Spin2 document. There is no 'message' keyword to be used.

    DEBUG ("Hello World")

    That should work.

  • I did initially try DEBUG("Hello World"). When that didn't work I went looking through the documentation and on the spin2 page there was a Hello World example:
    https://www.parallax.com/propeller-2/get-started/spin2/
    The code is basically from this screenshot:
    https://media.parallax.com/wp-content/uploads/2020/11/08143431/PTool-HelloBlinky-1024x569.png

    I figured that the `message was some sort of new syntax with Spin 2.

  • JRetSapDoogJRetSapDoog Posts: 954
    edited 2021-03-13 06:38

    Welcome to the forum, rcuprak. Thanks for asking a complete question with code and a list of your equipment. Just in case you don't have it, here's a link with the P2 Spin Manual. Some of the other P2 resources can be found off of Parallax's main site by hovering over "Propeller +" and then "Propeller 2" and then clicking on "Documentation." When you go to that P2 Spin manual, be aware that it's opened in the "suggesting" mode, but to avoid inadvertently making suggestions, you can change the mode to "viewing" with the little dropdown arrow towards the upper-right corner. Happy debugging.

  • mojorizingmojorizing Posts: 249
    edited 2021-03-13 19:53

    As per the referenced P2 spin documentation, you have to “instantiate” a graphical debug window. Then you have to feed the window. I have 2 TERM windows instantiated, “stuff” and “more_stuff”, with their respective start position, text size, and color. The “stuff” debug window opens with the usual “Hello World”, and the “more_stuff” window opens with the little-known phrase used only by retiring programmers, “Goodbye World”. The LED blinks as it should.

  • cgraceycgracey Posts: 14,151

    You can also send data straight to the main DEBUG window, where everything passes through, anyway.

  • @Cluso99 said:
    I haven't run debug, ...

    @Cluso99, Please try debug on your RetroBlade2. This is the board I'm using and I am NOT seeing the DEBUG outputs....

  • Cluso99Cluso99 Posts: 18,069

    Latest (from another thread I just read) seems that the CP2102 may be the problem as tests by others indicate the CP2102 cannot do 2M baud. IIRC Chip has a command to change the baud used - try 1MB but the tests showed that around 960_000 ?? was the max.
    This is not the thread - I quickly tried to find it. But here is a similar posting
    https://forums.parallax.com/discussion/comment/1519843/#Comment_1519843

    Sorry, I have not had time to test as yet. I am way deep in a work project, and another P2 project. I'll get to this as soon as I can.

Sign In or Register to comment.