Shop OBEX P1 Docs P2 Docs Learn Events
BS2p RAM with I2C messaging — Parallax Forums

BS2p RAM with I2C messaging

ArchiverArchiver Posts: 46,084
edited 2002-09-23 19:58 in General Discussion
Dinesh-

The BS2p also has 128 bytes of "scratch pad" ram which can be used
to store and retrieve data with GET and PUT statements. These bytes
can be used indirectly by the I2COUT statement by first moving them
into variables which can then be I2COUT arguments.

In addition, you can embed any constants directly in your I2COUT
statement without using any variable space. Depends on what you're
sending. An example of your output would help to give you a better
answer.

Regards,

Steve

On 23 Sep 02 at 18:12, dineshus2002 wrote:

> Hi,
>
> I understand that the BS2p Stamp has 32 bytes of RAM. I'm running a
> program on it wherein I send 38 I2COUT messages to a particular
> device. I would also like to incorporate more features into the
> stamp, but I'm afraid that I'll run out of RAM space...

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-09-23 19:12
    Hi,

    I understand that the BS2p Stamp has 32 bytes of RAM. I'm running a
    program on it wherein I send 38 I2COUT messages to a particular
    device. I would also like to incorporate more features into the
    stamp, but I'm afraid that I'll run out of RAM space.

    Could anyone tell me if how much RAM of the stamp I'm using by
    sending out these 38 I2C messages?

    Thanks
    Dinesh
  • ArchiverArchiver Posts: 46,084
    edited 2002-09-23 19:16
    You could store your "messages" in EEPROM DATA statements and send them as
    needed. A pointer variable and placeholder is all you'd need -- just a
    couple of bytes and some code to pull things together. Pretty easy, really.

    -- Jon Williams
    -- Parallax

    In a message dated 9/23/02 1:13:35 PM Central Daylight Time,
    dineshus2002@y... writes:


    > Hi,
    >
    > I understand that the BS2p Stamp has 32 bytes of RAM. I'm running a
    > program on it wherein I send 38 I2COUT messages to a particular
    > device. I would also like to incorporate more features into the
    > stamp, but I'm afraid that I'll run out of RAM space.
    >
    > Could anyone tell me if how much RAM of the stamp I'm using by
    > sending out these 38 I2C messages?
    >
    > Thanks
    >




    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2002-09-23 19:51
    Hi Jon,

    Thanks for your email. The data sheet of the BS2p says that there are
    6 bytes for I/0 and 26 for variables.

    What exactly is meant by 6 bytes for I/O?

    Thanks



    --- In basicstamps@y..., jonwms@a... wrote:
    > You could store your "messages" in EEPROM DATA statements and send
    them as
    > needed. A pointer variable and placeholder is all you'd need --
    just a
    > couple of bytes and some code to pull things together. Pretty
    easy, really.
    >
    > -- Jon Williams
    > -- Parallax
    >
    > In a message dated 9/23/02 1:13:35 PM Central Daylight Time,
    > dineshus2002@y... writes:
    >
    >
    > > Hi,
    > >
    > > I understand that the BS2p Stamp has 32 bytes of RAM. I'm running
    a
    > > program on it wherein I send 38 I2COUT messages to a particular
    > > device. I would also like to incorporate more features into the
    > > stamp, but I'm afraid that I'll run out of RAM space.
    > >
    > > Could anyone tell me if how much RAM of the stamp I'm using by
    > > sending out these 38 I2C messages?
    > >
    > > Thanks
    > >
    >
    >
    >
    >
    > [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2002-09-23 19:58
    Due to the PIC/SX architecture, IO pins are mapped into RAM. That makes
    changing them easy. Since there are 16 pins (two bytes), those six bytes are
    used like this:

    * Data direction registers
    -- Dirs (16 bits) == DirL/DirH (8 bits) == DirA/DirB/DirC/DirD (4 bits)
    == Dir0 .. Dir15 (1 bit)

    * Output registers
    -- Outs (16 bits) == OutL/OutH (8 bits) == OutA/OutB/OutC/OutD (4 bits)
    == Out0 .. Out15 (1 bit)

    * Input registers
    -- Ins (16 bits) == InL/InH (8 bits) == InA/InB/In/InD (4 bits) == In0 ..
    In15 (1 bit)


    The manual has a good explenation of variable allocation and usage.

    -- Jon Williams
    -- Parallax


    In a message dated 9/23/02 1:51:59 PM Central Daylight Time,
    dineshus2002@y... writes:


    > Hi Jon,
    >
    > Thanks for your email. The data sheet of the BS2p says that there are
    > 6 bytes for I/0 and 26 for variables.
    >
    > What exactly is meant by 6 bytes for I/O?
    >
    >




    [noparse][[/noparse]Non-text portions of this message have been removed]
Sign In or Register to comment.