Shop OBEX P1 Docs P2 Docs Learn Events
As it happens I'm busy spinning up a new project for the basic stamp and the Prop Backpack.... — Parallax Forums

As it happens I'm busy spinning up a new project for the basic stamp and the Prop Backpack....

Buck RogersBuck Rogers Posts: 2,185
edited 2021-04-26 13:48 in General Discussion
Hello!
Okay as the title says, as it happens I'm busy spinning up a new project for the basic stamp and the Prop Backpack, I decided to confirm that this one still work.
' =========================================================================
'
'   File...... screentest4.bs2
'   Purpose... screener
'   Author.... GCL -- Jedi Knight Computers
'   E-mail.... gregg@levine.name
'   Started... 10 Mar 2014
'   Updated... 11 Mar 2014
'
'   {$STAMP BS2}
'   {$PBASIC 2.5}
'
' =========================================================================

' -----[ Program Description ]---------------------------------------------

' This program outputs video to an NTSC color monitor via a Propeller
' Backpack module and demonstrates the various features of the video driver.


' -----[ I/O Definitions ]-------------------------------------------------

io     PIN 15           ' Serial I/O pin for Propeller Backpack.
U1A    PIN 0
U1B    PIN 1
U1C    PIN 2
' -----[ Constants ]-------------------------------------------------------

' Baudrate definitions. Serial I/O must be open-drain. The Propeller Backpack
' includes a pullup internally.

#SELECT $STAMP
  #CASE BS2, BS2E, BS2PE
    baud    CON  84 + 32768
  #CASE BS2SX, BS2P
    baud    CON  240 + 32768
  #CASE BS2PX
    baud    CON  396 + 32768
#ENDSELECT

' The following is a table of "command" constants for the Propeller Backpack
' that can be copied to other programs. The ones that are commented are already
' defined by the BASIC Stamp Editor and perform the same functions as they
' would in a DEBUG screen.

'CLS           CON $00  'clear screen
'HOME          CON $01  'home
'CRSRXY        CON $02  'set X, Y position (X, Y follow)
'CRSRLF        CON $03  'cursor left
'CRSRRT        CON $04  'cursor right
'CRSRUP        CON $05  'cursor up
'CRSRDN        CON $06  'cursor dn
 USECLR        CON $07  'use color C (C follows)
 BS            CON $08  'backspace
'TAB           CON $09  'tab (8 spaces per)
'LF            CON $0A  'linefeed
'CLREOL        CON $0B  'clear to end of line
'CLRDN         CON $0C  'clear down (to end of window)
'CR            CON $0D  'return
'CRSRX         CON $0E  'set X position (X follows)
'CRSRY         CON $0F  'set Y position (Y follows)
 DEFWIN        CON $10  'define window  W (W, Left, Top, nCols, nRows follow)
 USEWIN        CON $11  'use window W (W follows)
 DEFCLR        CON $12  'define color C (C, FG, BG follow)
 SCRLLF        CON $13  'scroll window left
 SCRLRT        CON $14  'scroll window right
 SCRLUP        CON $15  'scroll window up
 SCRLDN        CON $16  'scroll window down
 CHGCLR        CON $17  'change all colors in window to C (C follows)
 SCRSIZ        CON $1D  'set screen size (Rows, Columns follow)
 CLRW          CON $1E  'same as CLR, but can be used in strings.
 ESC           CON $1F  'escape next character C (i.e. print as-is) (C follows)
 ZERO          CON $FF  'can be used for 0, which is not allowed in strings, for command arguments

'-------[ Variables ]----------------------------------------------------------

i             VAR Word
char          VAR Byte
'U             VAR Word
U1            VAR Word
W             VAR Word
'-------[ Program starts here. ]-----------------------------------------------

LOW io            'Reset the Propeller Backpack
PAUSE 500
INPUT io

PAUSE 2000        'Wait for it to come out of reset.

SEROUT io, baud, [DEFWIN, 1, 20, 2, 9, 18, USEWIN, 1, CHGCLR, 12]
SEROUT io, baud, [DEFCLR, 12, $AD, $0C]
'FOR U =  65 TO 127
'FOR W = 1000 TO 1050
'FOR W = 65 TO 127
'FOR W = 65 TO 91
FOR W = 65 TO 255
SEROUT U1B, baud,[W]
PULSOUT U1A, 8
'PULSIN  U1C, 8, U1
COUNT U1C, 8, U1
SEROUT io, baud, ["___>", DEC U1, CR]
PAUSE 1000
SEROUT io, baud, [" ", ASC ?W,CR]
PAUSE 350
SEROUT io, baud, [" ", DEC W,CR]
PAUSE 700
NEXT
'NEXT
That was last used approximately 2 years previously. I believe I put aside the original project because the constant being pointed to via:
"___>" kept repeatedly displaying a discouraging number, namely a zero.

Although of them were variations on a theme, they all responded the same way.

I recall comparing the schematic for the Prop Backpack design to on that esteemed author and technological consultant (also skeptic and occasional curmudgeon) Donald Lancaster, created for the video generation portion of his famous TV Typewriter, as found in the Cookbook by that name that he wrote ages ago. To which of course our own Phil was decidedly pleased as anything. The same goes for the documentation.

And the reason? Why because the idea that's spinning up will make use of much the same process as above. But hopefully will display more then a batch of zeros. If anyone who owns a Prop BackPack wants to try out the code, be my guest, the part used is a garden variety SN74LS37, or SN7437, both will work. I've attached both. All I ask is that credit be maintained in the headers.

The board used for confirming that my code isn't suffering bitrot was in fact a BASIC Stamp HomeWork Board USB, which I bought from Radio Shack, sometime after 2011, when my collection of Parallax items mysteriously vanished.

Comments

  • And an update.

    I've moved from that BS2 HWB to an PDB one, who did support a respectable variety of boards, including the BS2. Right now I have that program running and tweaking gate one on a SN7437 and providing output functions to the Stamp. And connecting it to the first output LED on the board, since these are active high there's visible functions.

    Oddly enough I should have thought of that before, I always chose to set my parts up as active low.

    It's still a beginning of sorts.

    Phil what style BS2 board did you use for trying out your program code with your Prop Backpack?
Sign In or Register to comment.