View pins changing with ViewPort
The attached program uses a counter to toggle pins. With ViewPort, you can set a breakpoint and/or single step through the code to watch the counter increment in the loop. ViewPort also draws a diagram of the Propeller's pins in the Debug view. Here you'll see the pins being manipulated. In the screenshot you should see:
- the cog is paused on the breakpoint in line 33
- the value of ctr is "6". You can see this in the mouseover window that pops up when I hover over the "ctr" variable name. you can also see it in the "watch" pane on the bottom left.
- pins 1 and 2 are high- they are marked red in the bottom center Propeller diagram.
As you single step or run through the program, the ctr will be incremented each time through the repeat loop. When line 32 is highlighted, the "outa" instruction is just about to be run. This can be confusing- for example, if ctr is currently "5", but the outa instruction has NOT run yet, then the pin output will be that from the last outa instruction, so pin 2 will be high. Confusing, but correct.
[img]http://mydancebot.com/linked/debug pin toggle.png[/img]
Hanno
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Co-author of the official Propeller Guide- available at Amazon
Developer of ViewPort, the premier visual debugger for the Propeller (read the review here, thread here),
12Blocks, the block-based programming environment (thread here)
and PropScope, the multi-function USB oscilloscope/function generator/logic analyzer
- the cog is paused on the breakpoint in line 33
- the value of ctr is "6". You can see this in the mouseover window that pops up when I hover over the "ctr" variable name. you can also see it in the "watch" pane on the bottom left.
- pins 1 and 2 are high- they are marked red in the bottom center Propeller diagram.
As you single step or run through the program, the ctr will be incremented each time through the repeat loop. When line 32 is highlighted, the "outa" instruction is just about to be run. This can be confusing- for example, if ctr is currently "5", but the outa instruction has NOT run yet, then the pin output will be that from the last outa instruction, so pin 2 will be high. Confusing, but correct.
[img]http://mydancebot.com/linked/debug pin toggle.png[/img]
Hanno
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Co-author of the official Propeller Guide- available at Amazon
Developer of ViewPort, the premier visual debugger for the Propeller (read the review here, thread here),
12Blocks, the block-based programming environment (thread here)
and PropScope, the multi-function USB oscilloscope/function generator/logic analyzer
Comments
Here it is:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Co-author of the official Propeller Guide- available at Amazon
Developer of ViewPort, the premier visual debugger for the Propeller (read the review here, thread here),
12Blocks, the block-based programming environment (thread here)
and PropScope, the multi-function USB oscilloscope/function generator/logic analyzer