Outputs
Archiver
Posts: 46,084
Hi,
I'm using a BS2 and here is my question: could I make multiple
outputs active in one command? I know i could make something like
high 1
low 2
high 3
but could I do something like writing $1d to the output register?
I'm using a BS2 and here is my question: could I make multiple
outputs active in one command? I know i could make something like
high 1
low 2
high 3
but could I do something like writing $1d to the output register?
Comments
The trick is to use OUTS (16 bits), OUTH & OUTL (8 bits), and OUTA,
OUTB, OUTC, OUTD (4 bits). However, you also have to set the direction
bits. So:
DIRS=%0000000000001111 ' P3-P0 are outputs
OUTA=5 ' p3=0, p2=1, p1=0, p0=0
There should be an article about this in the Stamp FAQ at
http://www.wd5gnr.com/stampfaq.htm
Al Williams
AWC
* Easy RS-232 Prototyping
http://www.al-williams.com/awce/rs1.htm
>
Original Message
> From: thekoookooo [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=PjeulSfzcA9P0R3FjLOglC38fPTq1vO_pBmIWMMfnh2XKxCiRsKC9F-zAVd_DlrjgQFzY6FeVymoQsOslA]thekoookooo@y...[/url
> Sent: Tuesday, July 09, 2002 12:17 PM
> To: basicstamps@yahoogroups.com
> Subject: [noparse][[/noparse]basicstamps] Outputs
>
>
> Hi,
>
>
> I'm using a BS2 and here is my question: could I make multiple
> outputs active in one command? I know i could make something like
>
> high 1
> low 2
> high 3
>
> but could I do something like writing $1d to the output register?
>
>
> 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/
>
outputs at once by writing to the Outs register. To get to pins 0 - 7; write
to OutL. To write to pins 8 - 15, write to OutH. Need more resolution? You
can write to pins 0 - 3 with OutA, pins 4 - 7 with OutB, 8 - 11 with OutC
and, finally, 12 - 15 with OutD.
This is all covered in the manual. Remember, you must setup the appropriate
Dirs register before addressing parallel outputs. HIGH and LOW make the
target pin an output so the commands are actually doing two things.
-- Jon Williams
-- Applications Engineer, Parallax
In a message dated 7/9/02 12:19:10 PM Central Daylight Time,
thekoookooo@y... writes:
> I'm using a BS2 and here is my question: could I make multiple
> outputs active in one command? I know i could make something like
>
> high 1
> low 2
> high 3
>
> but could I do something like writing $1d to the output register?
>
[noparse][[/noparse]Non-text portions of this message have been removed]