Shop OBEX P1 Docs P2 Docs Learn Events
Firmware Revision — Parallax Forums

Firmware Revision

StuartWStuartW Posts: 3
edited 2008-05-16 23:15 in BASIC Stamp
I have an older STAMP 2 that shows 1.0 as its firmware revision. Is this the latest? I have copied some software examples that use the READ function (for a 7 segment display) and it will not work...

Comments

  • Ken GraceyKen Gracey Posts: 7,401
    edited 2008-05-16 13:39
    Stuart,

    Chances are the code you are using is PBASIC 2.5 as it reads and writes word variables, so you need to add the directive to the top of your PBASIC program.

    ' {$PBASIC 2.5}

    Ken Gracey
    Parallax, Inc.
  • StuartWStuartW Posts: 3
    edited 2008-05-16 22:55
    Here is my test program:
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    '----[noparse][[/noparse]Varables]
    DATAOut CON 1
    Clock CON 2
    Latch CON 3
    ' EEPROM DATA
    ' ABCDEFG.

    Digit0 DATA %11111100
    Digit1 DATA %00001100
    Digit2 DATA %11011010
    Digit3 DATA %11110010
    Digit4 DATA %01100110
    Digit5 DATA %10110110
    Digit6 DATA %10111110
    Digit7 DATA %11100000
    Digit8 DATA %11111110
    Digit9 DATA %11110110

    '----[noparse][[/noparse]Initialisation]

    reset:
    DIRS = %01111111

    '
    Main:
    SHIFTOUT DATAOut,Clock,MSBFIRST,[noparse][[/noparse]Digit0]
    SHIFTOUT DATAOut,Clock,MSBFIRST,[noparse][[/noparse]Digit1]
    PULSOUT Latch,1
    GOTO Main

    (I am using Allegro 6276 drivers and I know they work from entering BINARY in the place where Digit0 is right now)

    The results is that the first display is blank, and the second illuminates teh decimal point!

    I can make it work by writing a load of "Data typing" like code, but the xamples given show that I should be ableto say "Ditit0 + x" and the READ function should index.

    THanks for your help
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-05-16 23:15
    ·
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    '----[noparse][[/noparse]Varables]------
    
    DATAOut CON 1
    Clock CON 2
    Latch CON 3
     
    digit VAR Byte
    index VAR Byte
     
    '----[noparse][[/noparse]Initialisation]-
    reset:
    DIRS = %01111111
    '---------------------
    
    Main:
     FOR index = 0 TO 9
     READ digit, index
     SHIFTOUT DATAOut,Clock,MSBFIRST,[noparse][[/noparse]digit]
     PULSOUT Latch,1
     PAUSE 1000
     NEXT
     
    GOTO Main
     
    
    DATA %11111100  ' index = 0
    DATA %00001100  '         1
    DATA %11011010  '         2
    DATA %11110010  '         3
    DATA %01100110  '         4
    DATA %10110110  '         5
    DATA %10111110  '         6
    DATA %11100000  '         7
    DATA %11111110  '         8
    DATA %11110110  '         9
    
Sign In or Register to comment.