Shop OBEX P1 Docs P2 Docs Learn Events
No debugger? — Parallax Forums

No debugger?

inakiinaki Posts: 262
edited 2006-06-06 12:11 in Propeller 1
I have read somewhere that the Propeller has no debugger.

Does it have at least the DEBUG output as in BasicStamp ?





▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-03-06 20:56
    Not specifically, but that said there are existing objects to output data via serial (like PBASIC's debug) or a TV or VGA monitor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • FORDFORD Posts: 221
    edited 2006-03-07 04:18
    In that case I guess the first thing we should do is have a serial lcd and get a grip on some serial code as soon as it is available.

    I would bet money that Chip has put some debugging suggestions at least in the official documentation.
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2006-03-07 05:00
    Debugging is not that hard.· Right now there is a FullDuplex library installed, and I think a more robust one is coming.· For example, the following code will send back the value of X at 9600 Baud for me to monitor in the BASIC Stamp's DEBUG Window while I work on my BS2 library.

    '' Put a buzzer on A4 and an RC circuit with photo resistor + cap (like in WAM) on A8 
    CON
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
    OBJ
       num : "numbers"                           ' For debugging
       com : "FullDuplex"                       ' For debugging
       BS2 : "BS2_Functions"                    ' Create BS2 Object
    CON
      Buzzer = 4
      RC = 8
    
    PUB Start  | x
      BS2.Start
      com.start(31,30,9600)         ' initialize serial comms (rx, tx, baud)
      Repeat
        dira[noparse][[/noparse]Buzzer]~~
        dira[noparse][[/noparse]RC]~~
        outa[noparse][[/noparse]RC]:=1
        bs2.PAUSE(10)    
        x := BS2.RCTime(RC,1)
        com.str(num.toStr(x,10))     ' send to DEBUG, 10 = DEC
        BS2.freqout(buzzer,100,x)
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel
    Perform an Employer's Survey of Electronic Technologies Graduates· - Click here!
    Personal Links with plenty of BASIC Stamp info
    and SelmaWare Solutions - StampPlot - Graphical Data Acquisition and Control

    Post Edited (Martin Hebel) : 3/7/2006 6:06:07 PM GMT
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2006-03-07 07:51
    You may also use a modified version of Dave's sample 04 (see http://forums.parallax.com/showthread.php?p=574524) to display various information on a video screen.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-03-07 17:52
    I piggy-backed on Marty's idea with some code (numbers to text)·that Chip had written for another demo to create a very simple Debug object for use in my own testing.

    ''*******************************
    ''*  Simple Debug Object        *
    ''*    (C) 2006 Parallax, Inc.  *
    ''*******************************
    
    OBJ
      uart  : "FullDuplex"
    
    
    
    PUB start(baud) : okay
    
    
    '' Starts uart object (at baud specified) in a cog
    '' -- uses Propeller programming connection
    '' -- returns false if no cog available
    
    
      okay := uart.start(31, 30, baud)
    
    
    
    PUB startx(rxpin, txpin, baud) : okay
    
    
    '' Starts uart object (at baud specified) in a cog
    '' -- uses specified rx and tx pins
    '' -- returns false if no cog available
    
    
      okay := uart.start(rxpin, txpin, baud) 
    
    
    
    PUB stop
    
    
    '' Stops uart -- frees a cog
    
    
      uart.stop
    
    
      
    PUB putc(txbyte)
    
    
    '' Send a byte to the terminal
    
    
      uart.tx(txbyte)
      
      
    PUB str(stringPtr) | i
    
    
    '' Print a zero-terminated string
    
    
      repeat i from 0 to strsize(stringPtr) - 1
        putc(byte[noparse][[/noparse]stringPtr][noparse][[/noparse]i])
    
    
    
    PUB dec(value) | i, z
    
    
    '' Print a signed decimal number
    
    
      if value < 0
        -value
        putc("-")
    
    
      i := 1_000_000_000
      z~
    
    
      repeat 10
        if value => i
          putc(value / i + "0")
          value //= i
          z~~
        elseif z or i == 1
          putc("0")
        i /= 10
    
    
    
    PUB hex(value, digits)
    
    
    '' Print a hexadecimal number
    
    
      value <<= (8 - digits) << 2
      repeat digits
        putc(lookupz((value <-= 4) & $F : "0".."9", "A".."F"))
    
    
    
    PUB bin(value, digits)
    
    
    '' Print a binary number
    
    
      value <<= 32 - digits
      repeat digits
        putc((value <-= 1) & 1 + "0")
    
        
    PUB getc : rxbyte
    
    
    '' Get a character
    '' -- will block until something in uart buffer
    
    
      rxbyte := uart.rx
      
      
    


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • FORDFORD Posts: 221
    edited 2006-03-07 23:58
    Thanks John, any chance of some comments to explain some of the symbols in that, remember, some of us don't have any documentation yet.



    Cheers, Chris
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-03-08 00:43
    There's only a couple mysteries -- perhaps this will help:

    z~··· clear z to 0 (false)
    z~~·· set z to -1 (true)
    <-··· bitwise rotate left

    Many of the operators are combined with assignment as in other languages:

    x //= 5 is the same as x = x // 5

    In truth, I did nothing but assemble the code; the routines were created by Chip.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • John AbshierJohn Abshier Posts: 1,116
    edited 2006-03-08 01:28
    is

    elseif z or i == 1

    interperted as elseif z or (i == 1)

    or as elseif (z or i) == 1

    I almost always use () since I don't trust my memory on how this particular language does it.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-03-08 05:31
    It is interpreted as

    · elseif z or (i == 1)

    because the == operator has higher precedence than or.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Tom WalkerTom Walker Posts: 509
    edited 2006-03-08 16:12
    Jon,
    Under "normal" circumstances, precedence would, indeed, make the order clear, but with our experience with the Stamp's interpretation...[noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Truly Understand the Fundamentals and the Path will be so much easier...
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-03-08 17:22
    The nice thing about spin is that 9 times out of 10 the order of precedence you want an expression to have is the exact order of precedence that occurs. I think I've only needed to use parenthesis once or twice.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10

    Post Edited (Paul Baker) : 3/8/2006 6:48:48 PM GMT
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-03-09 05:32
    This is not a BASIC Stamp... tongue.gif
    Tom Walker said...
    Jon,
    Under "normal" circumstances, precedence would, indeed, make the order clear, but with our experience with the Stamp's interpretation...[noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Dave ScanlanDave Scanlan Posts: 160
    edited 2006-03-13 17:18
    [b]DEBUGGING USING THE VIDEO DISPLAY[/b]
    

    SEE THE THREAD: SPIN CODE EXAMPLES FOR THE BEGINNER (EXAMPLE 09)
    

    [code]
    You may also use a modified version of Dave's sample 04 (see http://forums.parallax.com/showthread.php?p=574524) to display various information on a video screen.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2006-03-13 20:26
    Dave,

    yes, I absolutely agree - a video monitor together with some code like your EXAMPLE 09 is the most valuable debugging tool for the Propeller (much more informative than blinking LEDs). Thank you for posting this example.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
  • Dave ScanlanDave Scanlan Posts: 160
    edited 2006-03-13 22:06
    Gunther,

    I think Parallax needs to get ready to sell lots of monitors.· Thanks for the support.

    Dave
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-03-14 01:27
    We found a small one that we will be offering with other convenient components for Propeller development.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • FORDFORD Posts: 221
    edited 2006-03-14 03:34
    Hello Jon,

    What do the display specs need to be to run directly from a Propeller ?

    Thanks,
    Chris
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-03-14 03:42
    NTSC or PAL, RCA plug for direct connection, but the propeller can broadcast on channel 3 easily for a connectionless interface.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-03-14 03:55
    And while I haven't yet tried it myself, you can configure the bits to S-Video output instead of composite -- as many TVs and monitors have S-Video this will probably provide the nicest display.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • DJDJ Posts: 1
    edited 2006-03-14 04:28
    When is it comming out?
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-03-14 04:44
    As has been stated in several threads, we will provide a release date when everything is ready to ship.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2006-03-16 22:57
    Hi All,

    After using Jon Williams' debug object for awhile, I found that I needed something simpler yet: just a self-contained object that twiddled an output pin directly -- no inputs -- and provided an inverted signal that would drive my PC's RxD pin without additional circuitry. Here's the result:

    [i][b]''*******************************[/b][/i]
    [i][b]''*     Simple Debug Object     *[/b][/i]
    [i][b]''*   (C) 2006 Parallax, Inc.   *[/b][/i]
    [i][b]''*  Modified by Phil Pilgrim   *[/b][/i]
    [i][b]''*******************************[/b][/i]
    
    [i][b]'' This debug object, originally posted by Jon Williams, has been modified to[/b][/i]
    [i][b]'' provide output only, and without involving FullDuplex, which uses another cog.[/b][/i]
    [i][b]'' Output is provided inverted, so the 3.3V signal level can drive the PC's RxD[/b][/i]
    [i][b]'' pin directly. (Note: Not all PC serial ports will work with a 0 to 3.3V signal.)[/b][/i]
    
    
    [b]VAR[/b]
    
      [b]long[/b]  BaudClock
      [b]long[/b]  TxMask
      
    [b]PUB[/b] start(txpin, baud)
    
    [i][b]'' Initializes the baud delay factor, and the pin direction and level.[/b][/i]
    
      BaudClock := clkfreq / baud
      TxMask := 1 << txpin
      [b]outa[/b] &= !Txmask
      [b]dira[/b] |= TxMask
    
    [b]PUB[/b] stop
    
    [i][b]'' Changes the pin back to an input.[/b][/i]
    
      [b]dira[/b] &= !TxMask
    
    [b]PUB[/b] str(stringPtr) | i
    
    [i][b]'' Print a zero-terminated string[/b][/i]
    
      [b]repeat[/b] i [b]from[/b] 0 to [b]strsize[/b](stringPtr) - 1
        putc([b]byte[/b][noparse][[/noparse]stringPtr][noparse][[/noparse]i])
    
    [b]PUB[/b] dec(value) | i, z
    
    [i][b]'' Print a signed decimal number[/b][/i]
    
      [b]if[/b] value < 0
        -value
        putc("-")
    
      i := 1_000_000_000
      z~
    
      [b]repeat[/b] 10
        [b]if[/b] value => i
          putc(value / i + "0")
          value //= i
          z~~
        [b]elseif[/b] z [b]or[/b] i == 1
          putc("0")
        i /= 10
    
    [b]PUB[/b] hex(value, digits)
    
    [i][b]'' Print a hexadecimal number[/b][/i]
    
      value <<= (8 - digits) << 2
      [b]repeat[/b] digits
        putc([b]lookupz[/b]((value <-= 4) & $F : "0".."9", "A".."F"))
    
    [b]PUB[/b] bin(value, digits)
    
    [i][b]'' Print a binary number[/b][/i]
    
      value <<= 32 - digits
      [b]repeat[/b] digits
        putc((value <-= 1) & 1 + "0")
        
    [b]PUB[/b] putc(txbyte) | time
    
    [i][b]'' Send a byte to the pin (inverted).[/b][/i]
    
      txbyte := !((txbyte | $300) << 1)
      time := [b]cnt[/b]
      [b]repeat[/b] 11
        [b]waitcnt[/b](time += BaudClock)
        [b]outa[/b] := [b]outa[/b] & !TxMask | (txbyte & 1 > 0) & TxMask
        txbyte >>= 1
     
    
    



    My PC works fine with the Propeller's 0 and 3.3V signal levels (in lieu of -10 and +10), but this may not work for everyone.

    -Phil

    Post Edited (Phil Pilgrim) : 3/18/2006 5:15:39 AM GMT
  • mike101videomike101video Posts: 43
    edited 2006-06-03 19:20
    Hi All,
    Just started to get my Propeller chips up and running ( Been using javelin and BS2's for a while.)

    I used the PC_Debug example ( From N&V) running at 460,800bps and it works fine. Running at 9600bps, the output stops with a corrupt character in hyperterminal. Any-one experienced any issues running at a lower speed?

    Any help much appreciated,

    Mike

    PS - I really want to get this running as I am (still) putting together and Videocamera remote controller. 2 cogs will be Sony LANC to controll video cameras, 1 cog for PWM for the Pan/Tilt controller, and I will still have cogs left over for user interface, debug, etc. This is the answer to my dreams. ( LANC is serial at 9600bps - with some twists, which is why I am trying things out at a lower speed.)
  • Oliver H. BaileyOliver H. Bailey Posts: 107
    edited 2006-06-06 12:11
    Hello Everyone,
    I'm using the I2C object with the Matrix Orbital LK202-25 which Parallax sells (although I don't know if the Parallax version has the I2C Interface). This allows me to extend the interface the EEProm is connected too and have debug output without using any additional pins. I'm working on a SPIN object that will support the LK202-25 I2C Commands. This little device also allows a 5x5 keybpard to be attached to it allowing LCD output and keyboard input without using additional Propeller pins. I use this very setup throughout Embedded Systems Desktop Integration with the BASIC STAMP. I'm currently porting that over to the propeller. When completed there will be a debug supervisor that will hopefully offer single step, register display, and some other goodies for assembly program debugging.

    Regards,
    Oliver
Sign In or Register to comment.