Shop OBEX P1 Docs P2 Docs Learn Events
debug + propeller — Parallax Forums

debug + propeller

nvale55@gmail.comnvale55@gmail.com Posts: 15
edited 2011-12-01 20:55 in Propeller 1
Hi,

I would just like to know if it is possible to debug a propeller chiplike like you do a bs2 chip? if so how?

Comments

  • ratronicratronic Posts: 1,451
    edited 2011-12-01 19:38
    nvale most people use the parallax serial terminal that comes with the propeller tool and also a parallax serial terminal.spin program to use in your program to display number's and string's. Include it in your program like this
    Con                                                                     
                                                                            
      _CLKMODE = XTAL1 + PLL16X                                             
      _XINFREQ = 5_000_000                                                  
                                                                            
    Var                                                                     
                                                                            
                                                                            
    Obj                                                                     
                                                                            
      pst : "parallax serial terminal"                                        
                                                                            
    Pub main                                                         
                                                                            
      pst.startrxtx(31, 30, 0, 115200) 'start serial terminal                   
      waitcnt(clkfreq*3+cnt)       'wait 3 seconds for time to open terminal        
    

    Then within the rest of your code you would print a string like this
    pst.str(string("This is a string"))
    

    or a number
    a := 12
    pst.dec(a)
    

    Edit: spelling and starting of object parallax serial terminal
  • JonnyMacJonnyMac Posts: 9,198
    edited 2011-12-01 19:57
    One of the tricks I used in many of my programs is to start a secondary Spin cog that prints variables I'm interest in to PST -- in the "background" and unattended.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-12-01 20:37
    I would often use the TV_TEXT object calling it debug in the OBJ declaration. In the first few lines of the main method, I'd initialize the TV_TEXT object, then I could insert a debug.str(string("Here I am",13,10)) or something similar wherever I needed to know what the program was doing. I could display variable values with debug.hex(value,8) or something like that.
  • 10Sector10Sector Posts: 3
    edited 2011-12-01 20:42
    Hi,

    I would just like to know if it is possible to debug a propeller chiplike like you do a bs2 chip? if so how?

    Not sure on how the bs2 debugs, but I've been trying viewport, and it allows some pretty cool debugging features. Including, IO display, Variable display, Pause, Step code, plus alot of other stuff I haven't even looked at.
  • HannoHanno Posts: 1,130
    edited 2011-12-01 20:55
    Debugging to many people involves the ability to set breakpoints, step one line at a time through code, watch variables, change variables...
    ViewPort does all this and more...
    ViewPort also includes an integrated terminal with absolute and relative positioning so you can build text interfaces. You can also graph variable values in real time and watch IO states change at up to 80 million samples/second. ViewPort supports PropBasic, Spin and C.
    Hanno
Sign In or Register to comment.