Shop OBEX P1 Docs P2 Docs Learn Events
Byte variable expected — Parallax Forums

Byte variable expected

BanditBandit Posts: 12
edited 2007-09-19 13:46 in General Discussion
I declared a variable "ms" as
ms var Byte(1)
and when I debug the program it comes to a line
READ Seg_Map + ms, display(0)
and I get the "Byte variable expected error 11"

Comments

  • BeanBean Posts: 8,129
    edited 2007-09-19 13:04
    Download the latest version of the SX/B compiler from here
    http://forums.parallax.com/showthread.php?p=597707
    I just tried this code and it works with SX/B version 1.51.03 (the latest).
    DEVICE SX28, OSC4MHZ, TURBO, STACKX, OPTIONX, BOR26
    FREQ 4_000_000
     
    ms      VAR BYTE(1)
    display VAR BYTE(10)
     
    PROGRAM Start
     
    Start:
      READ Seg_Map + ms, display(0)
    END
     
    Seg_Map:
      DATA 0, 1, 2, 3, 4, 5, 6
    
    


    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I know what I know, don't confuse me with the facts...
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.hittconsulting.com
    ·
  • BanditBandit Posts: 12
    edited 2007-09-19 13:16
    What's the BOR26 in your device line?
  • BanditBandit Posts: 12
    edited 2007-09-19 13:28
    Thanks

    I had declared my data table Seg_Map as a Byte(3)
    commenting out this line eliminated the error.
  • BeanBean Posts: 8,129
    edited 2007-09-19 13:46
    BOR26 is the brown-out reset.
    Sometimes if the supply voltage rises slowly, the SX doesn't start properly. The BOR26 holds the SX in reset until the supply reaches 2.6 volts.

    Seg_Map should be a lablel not an array ?

    If you post your program I'd be happy to help you more.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I know what I know, don't confuse me with the facts...
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.hittconsulting.com
    ·
Sign In or Register to comment.