Shop OBEX P1 Docs P2 Docs Learn Events
How many "Var word" variables using a BS2-IC and using the BS2-Pe — Parallax Forums

How many "Var word" variables using a BS2-IC and using the BS2-Pe

JoeJoe Posts: 184
edited 2006-08-18 14:38 in BASIC Stamp
Hi,

Only to know how many "Var Word" variables can I use
with the BS2-IC and how many with the BS2-Pe

I need to use 3 or 4 sensirion sensors and the Basic Stamp 2-IC (BS2-IC)
hasn't enough var word variables.

Thanks , Joe

Comments

  • dandreaedandreae Posts: 1,375
    edited 2006-08-18 14:15
    You have 26 bytes size variables (13 words)·for each BASIC Stamp except for the BASIC Stamp 1.

    Dave


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    Http://www.parallax.com



    Post Edited (Dave Andreae (Parallax)) : 8/18/2006 2:23:56 PM GMT
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-08-18 14:31
    Yup. The "Variables" are stored in internal registers in the PIC16C57. The 'run-time' library in the BS2 family only knows about those registers. So that's only 26 bytes, total (or 13 words, total). No way to expand them, since the run-time wouldn't 'know' about any expansion.

    Having said that, you CAN add an external SPI interfaced eeprom very easily.
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2006-08-18 14:38
    With the BS2pe, you also have the scratchpad RAM, 127 bytes, so your program can deal with each Sensirion in turn and PUT the resulting temperature and humidity Words there.


    FOR channel=0 to 3
      GOSUB Sensirion
      PUT SPtem0+(channel*4), Word temperature
      PUT SPhum0+(channel*4), Word humidity
    NEXT
    
    ' ---- locations in scrachpad
    SPtem0 CON 10
    SPhum0 CON 12
    SPtem1 CON 14
    SPhum1 CON 16
    SPtem2 CON 18
    SPhum2 CON 20
    SPtem3 CON 22
    SPhum3 CON 24
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
Sign In or Register to comment.