4 bits out in one line of code?
I'd appreciate help with this code problem including listing constants and variables. I'm trying to use a 4 to 16 decoder to supply enables to data latches (9) and save pins. Thanks for any help. Al
Comments
All four sets of contiguous output pins can be addressed as follows:
·0-3···· 4-7··· 8-11·12-15
OUTA OUTB OUTC OUTD
Regards,
Bruce Bates
OUTA = $0F ' Set all OUTA pins high
OUTA = $00 ' set all OUTA pins low
You first have to set DIRA properly.
DIRA = $0F ' Set the OUTA pins to all OUTPUT.
So:
DIRA = $0F ' Set pins to output
MAIN:
OUTA = $0F ' Set pins high
PAUSE 200 ' Wait a bit
OUTA = $00 ' Set pins low
PAUSE 200 ' wait a bit
GOTO MAIN
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Thankyou Chris. I am using 74HC373s for 72 outputs not all of which are in use at the same time plus two dual digital pots for PWM. This complicates the wiring but simplifies the programing I think. Al