Problem With I/O Aux of BS2p40
Archiver
Posts: 46,084
I have a problem to use the 16 IO Aux of BS2P40
How do I use DIRS, OUTS and INS Instruction with Aux IO, because I know
AUXIO, MAINIO, but I don´t know how i can use this 3 Instruccion..
I have a program that I put pins 0,1,2 with Serial Interface and 3,4,5 are
Input of my System (Program Clock) and then, I have two port to BCD - 7
segment chip (74ls47), in fact, this two chip use 4 pin c/u (8,9,10,11 and
the other 12,13,14,15)..
In this two port, I try to multiplexer 16 7-segment (8 and 8 7-segment) and
then... to finish, I need to put the address of 8 par of 7 segment with a
Decoder (74hc237), this chip have 3 input... I try to put this 3 input in
the AUX IO pin 0,1,2 in the Aux IO (X0,X1,X2) (put cathode common).....
How do i make to use this AUXIO? because I need to put the complete
information in OUTS in the AUX IO
Can you help me, Please????
Atentamente.
Ing. Damian Trujillo G.
RIESE & CIA, S.A.
Caracas - Venezuela
Phone: 58-212-7934266/4377
Fax: 58-212-7940791/0908
Email: dtrujillo_riese@c...
[noparse][[/noparse]Non-text portions of this message have been removed]
How do I use DIRS, OUTS and INS Instruction with Aux IO, because I know
AUXIO, MAINIO, but I don´t know how i can use this 3 Instruccion..
I have a program that I put pins 0,1,2 with Serial Interface and 3,4,5 are
Input of my System (Program Clock) and then, I have two port to BCD - 7
segment chip (74ls47), in fact, this two chip use 4 pin c/u (8,9,10,11 and
the other 12,13,14,15)..
In this two port, I try to multiplexer 16 7-segment (8 and 8 7-segment) and
then... to finish, I need to put the address of 8 par of 7 segment with a
Decoder (74hc237), this chip have 3 input... I try to put this 3 input in
the AUX IO pin 0,1,2 in the Aux IO (X0,X1,X2) (put cathode common).....
How do i make to use this AUXIO? because I need to put the complete
information in OUTS in the AUX IO
Can you help me, Please????
Atentamente.
Ing. Damian Trujillo G.
RIESE & CIA, S.A.
Caracas - Venezuela
Phone: 58-212-7934266/4377
Fax: 58-212-7940791/0908
Email: dtrujillo_riese@c...
[noparse][[/noparse]Non-text portions of this message have been removed]
Comments
execute an AUXIO or IOTERM 1 statement; this includes setting DIRS and OUTS
or reading the INS register.
The use of MAINIO, AUXIO and IOTERM are explained in the compiler help file,
but briefly...
MAINIO causes Stamp commands (including DIRS, OUTS and INS access) to work on
the main IO pins. The same can be accomplished with IOTERM 0.
AUXIO causes Stamp commands (including DIRS, OUTS and INS access) to work on
the auxillary IO pins. The same can be accomplished with IOTERM 1.
-- Jon Williams
-- Parallax
In a message dated 1/15/2003 7:54:41 AM Central Standard Time,
dtrujillo_riese@c... writes:
> I have a problem to use the 16 IO Aux of BS2P40
>
> How do I use DIRS, OUTS and INS Instruction with Aux IO, because I know
> AUXIO, MAINIO, but I don´t know how i can use this 3 Instruccion..
>
> I have a program that I put pins 0,1,2 with Serial Interface and 3,4,5 are
> Input of my System (Program Clock) and then, I have two port to BCD - 7
> segment chip (74ls47), in fact, this two chip use 4 pin c/u (8,9,10,11 and
> the other 12,13,14,15)..
>
> In this two port, I try to multiplexer 16 7-segment (8 and 8 7-segment) and
> then... to finish, I need to put the address of 8 par of 7 segment with a
> Decoder (74hc237), this chip have 3 input... I try to put this 3 input in
> the AUX IO pin 0,1,2 in the Aux IO (X0,X1,X2) (put cathode common).....
>
> How do i make to use this AUXIO? because I need to put the complete
> information in OUTS in the AUX IO
>
> Can you help me, Please????
>
[noparse][[/noparse]Non-text portions of this message have been removed]
When I put IOTERM 1, I have a new register DIRS and OUTS and INS.... Or is
the same...
Example
If I have in my program:
DIRS = %0000 0000 0000 1111
OUTS = %0000 0000 0000 1010 'I write this otuput
and then i change port
IOTERM=1 ' The output continue
active (Pin 1,3) when i put the other Aux PORT
DIRS = %1111 0000 0000 0000
OUTS = %1111 0000 0000 0000 'I write this otuput in the AUX port
when i recover MAIN port DIRs is this DIRS = %0000 0000 0000 11111
and OUTS is this OUTS = %0000 0000 0000
10101
Can you explain me this instruction and architecture?? I don´t understand
Atentamente.
Ing. Damian Trujillo G.
RIESE & CIA, S.A.
Caracas - Venezuela
Phone: 58-212-7934266/4377
Fax: 58-212-7940791/0908
Email: dtrujillo_riese@c...
Original Message
From: basicstamps@yahoogroups.com
Date: Miércoles 15 de Enero de 2003 11:43:35 AM
To: basicstamps@yahoogroups.com
Subject: Re: [noparse][[/noparse]BasicStamps] Problem With I/O Aux of BS2p40
Any time you do anything that relates to the auxillary IO pins you must
first
execute an AUXIO or IOTERM 1 statement; this includes setting DIRS and OUTS
or reading the INS register.
The use of MAINIO, AUXIO and IOTERM are explained in the compiler help file,
but briefly...
MAINIO causes Stamp commands (including DIRS, OUTS and INS access) to work
on
the main IO pins. The same can be accomplished with IOTERM 0.
AUXIO causes Stamp commands (including DIRS, OUTS and INS access) to work on
the auxillary IO pins. The same can be accomplished with IOTERM 1.
-- Jon Williams
-- Parallax
In a message dated 1/15/2003 7:54:41 AM Central Standard Time,
dtrujillo_riese@c... writes:
> I have a problem to use the 16 IO Aux of BS2P40
>
> How do I use DIRS, OUTS and INS Instruction with Aux IO, because I know
> AUXIO, MAINIO, but I don´t know how i can use this 3 Instruccion..
>
> I have a program that I put pins 0,1,2 with Serial Interface and 3,4,5 are
> Input of my System (Program Clock) and then, I have two port to BCD - 7
> segment chip (74ls47), in fact, this two chip use 4 pin c/u (8,9,10,11 and
> the other 12,13,14,15)..
>
> In this two port, I try to multiplexer 16 7-segment (8 and 8 7-segment)
and
> then... to finish, I need to put the address of 8 par of 7 segment with a
> Decoder (74hc237), this chip have 3 input... I try to put this 3 input in
> the AUX IO pin 0,1,2 in the Aux IO (X0,X1,X2) (put cathode common).....
>
> How do i make to use this AUXIO? because I need to put the complete
> information in OUTS in the AUX IO
>
> Can you help me, Please????
>
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
.
[noparse][[/noparse]Non-text portions of this message have been removed]
want to affect the DIRS register on the auxillary pins, you must have an
AUXIO before you set DIRS, otherwise you'll be affecting the MAINIO DIRS.
Yes, this can be a bit confusing but it was the only way we could add more
pins to the existing BASIC Stamp architechure.
-- Jon Williams
-- Parallax
In a message dated 1/15/2003 11:18:14 AM Central Standard Time,
dtrujillo_riese@c... writes:
> When I put IOTERM 1, I have a new register DIRS and OUTS and INS.... Or is
> the same...
>
[noparse][[/noparse]Non-text portions of this message have been removed]
I have only one queston more....
1) If i have a DIR Configuration to MAIN, and I put AUXIO with other
configuration IO, I have to chage a MAINIO and Put again a last
configuration in DIR ??? or the configuration Main put automatic...?????????
2) The other question...
Example to second question: I put pin 0 (Main) in 1 (High 0) If i have to
put Pin 0 (AuxIO), when i put AUXIO and HIGH 0... The first Pin0 (Main)
would have in 1???
In resume.... When i put AUXIO The IO (Main) have run or not run??????
3) If You have more information about this BasicStamp BS2p40??? I would
appreciate your help?
Thank you....
I appreciate your email and prompt response
Ing. Damian Trujillo G.
Venezuela, Caracas
Mensaje Original
De: jonwms [noparse]/noparse][url=http://forums.parallaxinc.com/group/basicstamps/post?postID=BUQswT3EkMrqDADxLTNAsZRnc_fykaEl6ChlYAnqRd780edG1bKBGoxocMrUeO3eO8UHpIgB]jonwms@a...[/url
Para: basicstamps@yahoogroups.com [noparse]/noparse][url=http://forums.parallaxinc.com/group/basicstamps/post?postID=5XPXahtBQFey-voPJzCbX6VE7jnoHFCoSCTAp6UMbHuSkP5u3J444GY7YL-HY5JyYctc6V24e6jmSKL9AMbFQY4]basicstamps@yahoogroups.com[/url
Cc:
Asunto: Re: [noparse][[/noparse]BasicStamps] Problem With I/O Aux of BS2p40
Fecha: 15/01/2003 13:44:26
Mensaje:
Each bank of pins has its own set of DIRS, OUTS and INS registers.
If you
want to affect the DIRS register on the auxillary pins, you must have an
AUXIO before you set DIRS, otherwise you'll be affecting the MAINIO DIRS.
Yes, this can be a bit confusing but it was the only way we could add more
pins to the existing BASIC Stamp architechure.
-- Jon Williams
-- Parallax
In a message dated 1/15/2003 11:18:14 AM Central Standard Time,
dtrujillo_riese@c... writes:
> When I put IOTERM 1, I have a new register DIRS and OUTS and INS.... Or is
> the same...
>
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
associated registers you're dealing with. If you anything with the AUXIO
pins and then want to go back to the main group, you must issue a MAINIO
command.
Answers:
1) No, the connection to the MAINIO group is NOT automatic.
2) The MAINIO and AUXIO pins run independently of each other. If you do
this:
MAINIO
HIGH 0
PAUSE 500
AUXIO
HIGH 0
Pin 0 on the main group will go high and one-half second later the Pin 0 on
the aux group will go high. They will both stay high until you do something
to change them.
3) Check the website. Read the manual. Read the help file. There is plenty
of information available.
Note: If you have version 1.3 firmware, you can tell which IO group is
currently selected by doing a:
GET 134, ioGroup
Bit 0 [noparse][[/noparse]lowest bit] of ioGroup will now contain which group currently
selected: 0 = Main, 1 = Aux.
-- Jon Williams
-- Parallax
In a message dated 1/15/2003 12:44:15 PM Central Standard Time,
dtrujillo_riese@c... writes:
> Sorry Jon,
>
> I have only one queston more....
>
> 1) If i have a DIR Configuration to MAIN, and I put AUXIO with other
> configuration IO, I have to chage a MAINIO and Put again a last
> configuration in DIR ??? or the configuration Main put
> automatic...?????????
>
> 2) The other question...
>
> Example to second question: I put pin 0 (Main) in 1 (High 0) If i have to
> put Pin 0 (AuxIO), when i put AUXIO and HIGH 0... The first Pin0 (Main)
> would have in 1???
> In resume.... When i put AUXIO The IO (Main) have run or not run??????
>
> 3) If You have more information about this BasicStamp BS2p40??? I would
> appreciate your help?
>
> Thank you....
[noparse][[/noparse]Non-text portions of this message have been removed]
from anything first):
dirs_copy VAR WORD
DEBUG CR,HEX4 DIRS
DIRS = $FF00
DEBUG CR,HEX4 DIRS
AUXIO
DEBUG CR,HEX4 DIRS
DIRS = $F0F0
DEBUG CR,HEX4 DIRS
DIR0 = 1
DEBUG CR,HEX4 DIRS
dirs_copy = DIRS
MAINIO
DEBUG CR,HEX4 DIRS
DEBUG CR,HEX4 dirs_copy
The first DEBUG shows the initialized setting of DIRS for the
MAINIO. The second shows MAINIO DIRS after modification. The third
shows the initalized setting of DIRS for AUXIO. The fourth shows
AUXIO DIRS after modification. The fifth shows AUXIO DIRS after
modifying just one pin (DIR0). The sixth shows DIRS after reverting
to MAINIO to show how the MAINIO DIRS are unchanged. The last DEBUG
shows how you can recall the AUXIO DIRS (or OUTS or INS or whatever)
after while MAINIO is in effect. If you study the output you'll see
how this works.
Bottom line: you may assume there are two DIRS (or INS or OUTS)
within your Stamp, one for MAINIO and one for AUXIO. Your Stamp
know which is in effect. You address individual pins within DIRS,
INS and OUTS as 0 through 15 regardless of using MAINIO or AUXIO.
Changing one does not change the other. You needn't restore
DIRS/INS/OUTS when swapping from MAINIO to/from AUXIO.
As an aside, the program above works fine on a BS2p24 (mine, at
least) as well as a BS2p40. Looks like a BS2p24 is just a BS2p40
without the other 16 pins in place.
I agree this is a little confusing and could use some more
explanation in the manual. Somethimes you just have to figure out
what to try to find out for yourself how something works. Also,
DEBUG is your friend.
Regards,
Steve