Shop OBEX P1 Docs P2 Docs Learn Events
Parallel Read — Parallax Forums

Parallel Read

ArchiverArchiver Posts: 46,084
edited 2000-11-05 04:56 in General Discussion
How can I read inputs P12, P13, P14 and P15 as a one instruction parallel
read?

Thanx

Jay

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2000-11-04 04:03
    At 11/3/2000 07:45 PM, you wrote:
    >How can I read inputs P12, P13, P14 and P15 as a one instruction parallel
    >read?
    >
    >Thanx
    >
    >Jay
    Jay -

    Page 214 in the Basic Stamp II Manual shows a memory map with all the data
    area and pin names. INA, INB, INC, IND represent each quad, so P12-P15 =
    IND as shown in the third column "Nibble Names".

    This is a Page with a great deal of importance, and aids in the
    understanding of how the internals of the BS-II are constructed.

    Hope that is what you were seeking.

    Regards,

    Bruce Bates
  • ArchiverArchiver Posts: 46,084
    edited 2000-11-04 04:04
    Use the

    varname=ins & %1111000000000000

    That will read the state of the Pins and the bitwise AND will drop all the
    other pins that are unused. Hope that helps.

    MH

    Original Message
    From: "Jay Kay" <pcb4u@e...>
    To: <basicstamps@egroups.com>
    Sent: Friday, November 03, 2000 10:45 PM
    Subject: [noparse][[/noparse]basicstamps] Parallel Read


    > How can I read inputs P12, P13, P14 and P15 as a one instruction parallel
    > read?
    >
    > Thanx
    >
    > Jay
    >
    >
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2000-11-04 04:04
    Better call than mine. = )

    MH

    Original Message
    From: "Bruce Bates" <bvbates@u...>
    To: <basicstamps@egroups.com>
    Sent: Friday, November 03, 2000 11:03 PM
    Subject: Re: [noparse][[/noparse]basicstamps] Parallel Read


    > At 11/3/2000 07:45 PM, you wrote:
    > >How can I read inputs P12, P13, P14 and P15 as a one instruction parallel
    > >read?
    > >
    > >Thanx
    > >
    > >Jay
    > Jay -
    >
    > Page 214 in the Basic Stamp II Manual shows a memory map with all the data
    > area and pin names. INA, INB, INC, IND represent each quad, so P12-P15 =
    > IND as shown in the third column "Nibble Names".
    >
    > This is a Page with a great deal of importance, and aids in the
    > understanding of how the internals of the BS-II are constructed.
    >
    > Hope that is what you were seeking.
    >
    > Regards,
    >
    > Bruce Bates
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2000-11-04 04:19
    At 11/3/2000 11:04 PM, you wrote:
    >Better call than mine. = )

    Just easier to remember : )


    >MH
    >
    >
    Original Message
    >From: "Bruce Bates" <bvbates@u...>
    >To: <basicstamps@egroups.com>
    >Sent: Friday, November 03, 2000 11:03 PM
    >Subject: Re: [noparse][[/noparse]basicstamps] Parallel Read
    >
    >
    > > At 11/3/2000 07:45 PM, you wrote:
    > > >How can I read inputs P12, P13, P14 and P15 as a one instruction parallel
    > > >read?
    > > >
    > > >Thanx
    > > >
    > > >Jay
    > > Jay -
    > >
    > > Page 214 in the Basic Stamp II Manual shows a memory map with all the data
    > > area and pin names. INA, INB, INC, IND represent each quad, so P12-P15 =
    > > IND as shown in the third column "Nibble Names".
    > >
    > > This is a Page with a great deal of importance, and aids in the
    > > understanding of how the internals of the BS-II are constructed.
    > >
    > > Hope that is what you were seeking.
    > >
    > > Regards,
    > >
    > > Bruce Bates
    > >
    > >
    > >
    > >
  • ArchiverArchiver Posts: 46,084
    edited 2000-11-04 04:46
    Where is the best place to get some info on the "bitwise anding", I've heard
    of it but after seeing your discussion it looks as if it may save me a lot
    of code reading 4 inputs.
    thanks in advance,
    Chris
    Original Message
    From: Michael Hendricks <mjh80@b...>
    To: <basicstamps@egroups.com>
    Sent: Saturday, November 04, 2000 12:04 PM
    Subject: Re: [noparse][[/noparse]basicstamps] Parallel Read


    > Use the
    >
    > varname=ins & %1111000000000000
    >
    > That will read the state of the Pins and the bitwise AND will drop all the
    > other pins that are unused. Hope that helps.
    >
    > MH
    >
    >
    Original Message
    > From: "Jay Kay" <pcb4u@e...>
    > To: <basicstamps@egroups.com>
    > Sent: Friday, November 03, 2000 10:45 PM
    > Subject: [noparse][[/noparse]basicstamps] Parallel Read
    >
    >
    > > How can I read inputs P12, P13, P14 and P15 as a one instruction
    parallel
    > > read?
    > >
    > > Thanx
    > >
    > > Jay
    > >
    > >
    > >
    > >
    > >
    > >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2000-11-04 05:06
    Read Bruce's response... using ins.nibd is much easier, takes less code
    space and i would think is faster. There is not a lot on bitwise operatiors
    in the stamp manual but here is a brief description...

    Bitwise And If both bits are "1" then the result is a 1

    1 & 1 = 1
    1 & 0 = 0
    0 & 0 = 0
    0 & 1 = 0

    Bitwise OR If either bit is a "1" then the output will be true
    0 | 1 = 1
    1 | 1 = 1
    0 | 0 = 0

    Exclusive Or (Xor) If either bit is a "1" then the result is "1". If
    both bits are 1 then the result is "0"
    1 ^ 0 = 1
    1 ^ 1 = 0
    0 ^ 0 = 0
    0 ^ 1 = 1


    So a binary expression of

    variable= 10011001 | 01100110 (result is 11111111)


    Hope that helps.

    MH


    Original Message
    From: "Chris Anderson" <fes@g...>
    To: <basicstamps@egroups.com>
    Sent: Friday, November 03, 2000 11:46 PM
    Subject: Re: [noparse][[/noparse]basicstamps] Parallel Read


    > Where is the best place to get some info on the "bitwise anding", I've
    heard
    > of it but after seeing your discussion it looks as if it may save me a lot
    > of code reading 4 inputs.
    > thanks in advance,
    > Chris
    >
    Original Message
    > From: Michael Hendricks <mjh80@b...>
    > To: <basicstamps@egroups.com>
    > Sent: Saturday, November 04, 2000 12:04 PM
    > Subject: Re: [noparse][[/noparse]basicstamps] Parallel Read
    >
    >
    > > Use the
    > >
    > > varname=ins & %1111000000000000
    > >
    > > That will read the state of the Pins and the bitwise AND will drop all
    the
    > > other pins that are unused. Hope that helps.
    > >
    > > MH
    > >
    > >
    Original Message
    > > From: "Jay Kay" <pcb4u@e...>
    > > To: <basicstamps@egroups.com>
    > > Sent: Friday, November 03, 2000 10:45 PM
    > > Subject: [noparse][[/noparse]basicstamps] Parallel Read
    > >
    > >
    > > > How can I read inputs P12, P13, P14 and P15 as a one instruction
    > parallel
    > > > read?
    > > >
    > > > Thanx
    > > >
    > > > Jay
    > > >
    > > >
    > > >
    > > >
    > > >
    > > >
    > >
    > >
    > >
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2000-11-04 17:24
    Thanks to all with their suggestions on reading parallel data. To a new user
    it doesn't jump right at ya!!

    Jay
  • ArchiverArchiver Posts: 46,084
    edited 2000-11-04 17:40
    Keep in mind that ins, outs, and dirs are just other variables and can be
    modified with bit, highbyte, nib, etc just like any other variable...

    MH
    Original Message
    From: "Jay Kay" <pcb4u@e...>
    To: <basicstamps@egroups.com>
    Sent: Saturday, November 04, 2000 12:24 PM
    Subject: Re: [noparse][[/noparse]basicstamps] Parallel Read


    > Thanks to all with their suggestions on reading parallel data. To a new
    user
    > it doesn't jump right at ya!!
    >
    > Jay
    >
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2000-11-05 04:56
    Many thanks...
    Original Message
    From: Michael Hendricks <mjh80@b...>
    To: <basicstamps@egroups.com>
    Sent: Saturday, November 04, 2000 1:06 PM
    Subject: Re: [noparse][[/noparse]basicstamps] Parallel Read


    > Read Bruce's response... using ins.nibd is much easier, takes less code
    > space and i would think is faster. There is not a lot on bitwise
    operatiors
    > in the stamp manual but here is a brief description...
    >
    > Bitwise And If both bits are "1" then the result is a 1
    >
    > 1 & 1 = 1
    > 1 & 0 = 0
    > 0 & 0 = 0
    > 0 & 1 = 0
    >
    > Bitwise OR If either bit is a "1" then the output will be true
    > 0 | 1 = 1
    > 1 | 1 = 1
    > 0 | 0 = 0
    >
    > Exclusive Or (Xor) If either bit is a "1" then the result is "1".
    If
    > both bits are 1 then the result is "0"
    > 1 ^ 0 = 1
    > 1 ^ 1 = 0
    > 0 ^ 0 = 0
    > 0 ^ 1 = 1
    >
    >
    > So a binary expression of
    >
    > variable= 10011001 | 01100110 (result is 11111111)
    >
    >
    > Hope that helps.
    >
    > MH
    >
    >
    >
    Original Message
    > From: "Chris Anderson" <fes@g...>
    > To: <basicstamps@egroups.com>
    > Sent: Friday, November 03, 2000 11:46 PM
    > Subject: Re: [noparse][[/noparse]basicstamps] Parallel Read
    >
    >
    > > Where is the best place to get some info on the "bitwise anding", I've
    > heard
    > > of it but after seeing your discussion it looks as if it may save me a
    lot
    > > of code reading 4 inputs.
    > > thanks in advance,
    > > Chris
    > >
    Original Message
    > > From: Michael Hendricks <mjh80@b...>
    > > To: <basicstamps@egroups.com>
    > > Sent: Saturday, November 04, 2000 12:04 PM
    > > Subject: Re: [noparse][[/noparse]basicstamps] Parallel Read
    > >
    > >
    > > > Use the
    > > >
    > > > varname=ins & %1111000000000000
    > > >
    > > > That will read the state of the Pins and the bitwise AND will drop all
    > the
    > > > other pins that are unused. Hope that helps.
    > > >
    > > > MH
    > > >
    > > >
    Original Message
    > > > From: "Jay Kay" <pcb4u@e...>
    > > > To: <basicstamps@egroups.com>
    > > > Sent: Friday, November 03, 2000 10:45 PM
    > > > Subject: [noparse][[/noparse]basicstamps] Parallel Read
    > > >
    > > >
    > > > > How can I read inputs P12, P13, P14 and P15 as a one instruction
    > > parallel
    > > > > read?
    > > > >
    > > > > Thanx
    > > > >
    > > > > Jay
    > > > >
    > > > >
    > > > >
    > > > >
    > > > >
    > > > >
    > > >
    > > >
    > > >
    > >
    > >
    > >
    > >
    >
    >
    >
Sign In or Register to comment.