Shop OBEX P1 Docs P2 Docs Learn Events
Making the BS2 Object Work — Parallax Forums

Making the BS2 Object Work

Kirk FraserKirk Fraser Posts: 364
edited 2011-06-28 16:13 in Propeller 1
How do I get the BS2 object to work? I got the serial terminal to work with forum help using the Debug: "FullDuplexSerial" object with COM3, Baud 115200. The following using the BS2 object fails to report to the Serial Terminal but causes a slow blink on P15. I have no indication of success of the RCTime command.
OBJ
  BS2 : "BS2_Functions"         'Create BS2 Object   
con
  _clkmode = xtal1+pll16x       'For Debug
  _clkfreq = 100_000_000        'For Debug 
PUB CodeTest   |  x
  BS2.start (31,30)             'Initialize BS2 Object timing, Rx and Tx pins for DEBUG
  BS2.PWM_Set(15,4095,12)
  repeat
    x := BS2.RCTime(13,1)
    BS2.Debug_Str(string(13,"Test dec: "))
    BS2.Debug_dec(x)
    BS2.Debug_Str(string(13,"Test hex: ")) 
    BS2.Debug_hex(x,1) 
    BS2.Debug_Str(string(13,"Test bin: ")) 
    BS2.Debug_bin(x,12)
    BS2.Debug_Str(string(10))
    BS2.PWM(15,x,12)
    BS2.Pause(1000)

If it is not possible to get this to work, is it reasonable to just set the output pin to a fraction between 0 and 1, pause for a moment, then revert to 0 and pause so the ratio of pause1 and pause2 would equal the desired voltage level and the loop frequency would equal 20K?

Thanks.
Sign In or Register to comment.