What eclectic describes is the fundamental basis of LED Multiplexing which also allows brightness control -
Code:
.--------. ___ LED
| AA |----|___|----|>|---.
| | |
| KK |-------------------'
`--------'
1) When AA=0, KK=1 no current will flow and LED is off ( reverse bias ).
2) When AA=0, KK=0 no current will flow and LED is off.
3) When AA=1, KK=1 no current will flow and LED is off.
4) When AA=1, KK=0 current will flow and LED is on.
Note that if KK is 1, AA can be changed 0 or 1 and the LED will not come on. So AA can be set off (low) or on (high), KK then pulsed low, then returned to high. The brightness will depend on how long the pulse lasts for. This is the usual mechanism for Common Cathode operation of multiple or dimming LED's.
The same can be done by setting KK low (on) or high (off) and pulsing AA high, then returning low. This is the usual mechanism for Common Anode operation of multiple or dimming LED's.
Both AA and KK can be put on any PICAXE output pins but it makes sense to put the pin being pulsed on a 'standard output pin' so PULSOUT can be used to create the pulse, otherwise a TOGGLE PORTC, PAUSE, TOGGLE PORTC ( or similar sequence ) needs to be used to achieve the pulsing. PULSOUT has much finer control of the pulse timing.
For a larger multiplexor, all pulsed pins can be on the 'standard output pins' and the others on PORTC, they can be individually set using HIGH PORTC or LOW PORTC, or, often very conveniently in this case, all set together using LET PINSC.
If the multiplex only requires 8 I/O lines ( 2x6, 3x5, 4x4 ), they can all be placed on the single 'standard output pins' ( assuming it has 8 I/O lines - 20M, 18X etc ).
Charlieplexing reduces the number of I/O pins needed for multiplexing at the expense of more complicated LED wiring and slightly more complicated code for PICAXE's which can have the I/O port pin directions changed. A single 8-bit I/O port allows the control of 8x7 (56) LED's.
The same AA and KK configuration is used as previous but operation is more complicated, I/O pins are both AA and KK - A pin which is output low is the KK ( only one is a KK / low at any time ), a pin which is output high is an AA with a LED on, a pin which is an input is an AA with a LED off.
This should work with a 28X or 28X1, will work very well with a 28X2, and should potentially work with an 18X and also 14M, though I haven't calculated what maximum size multiplex the 14M could handle.