Easiest approach to binary counting on three output pins?
clayexi
Posts: 3
What is the most efficient way to code·three parallel output pins·to count from 000 to 111 (in my case, to drive a·4051 multiplexer and 4028 decoder)?
The way I'm getting this done now seems wasteful.
Low·· mpxA
High·· mpxB
Low·· mpxC
Pause 50
...and then incrementing, and so on.
There has to be a better way, thanks.
The way I'm getting this done now seems wasteful.
Low·· mpxA
High·· mpxB
Low·· mpxC
Pause 50
...and then incrementing, and so on.
There has to be a better way, thanks.
Comments
Somewhere earlier, you'd have to set the direction of the pins.· If you want to keep pin 11 as an input, you could just say "DIRC = %1010".· I think I have that right (0 = output, 1 = input).
I have quite a bit of wiring to change, but it will be worth it.
Hi Clayexi, using the DIR , OUT and IN registers (under Memory and Variables in the help files) is one of the most powerful set of instructions the BS2 has IMO but seems a little hidden and sparcely documented for the beginner, or maybe I was just slow to latch on.
Good luck
Jeff T.
Thanks again, Clayexi