The number of analog channels on a PICAXE can be increased by connecting the output of a multiplexer to one of its ADC inputs. The multiplexer channels are addressed using PICAXE output lines, as shown by the following example.
low 0: low 1: low 2 ; select channel 0
readadc 0, b0 ; read channel 0
high 0: low 1: low 2 ; select channel 1
readadc 0, b1 ; read channel 1
etc…
This approach allows eight multiplexer addresses to be generated, without effecting the state the other output bits. However, the state of the address bits cannot change simultaneously but ripple through with a 300uS delay between each bit (28X1 running at 16MHz). It therefore takes over 1mS for the multiplexer output to settle on the next channel.
Is there a way of simultaneously changing the multiplexer address bits, without altering the state of the other output pins?
low 0: low 1: low 2 ; select channel 0
readadc 0, b0 ; read channel 0
high 0: low 1: low 2 ; select channel 1
readadc 0, b1 ; read channel 1
etc…
This approach allows eight multiplexer addresses to be generated, without effecting the state the other output bits. However, the state of the address bits cannot change simultaneously but ripple through with a 300uS delay between each bit (28X1 running at 16MHz). It therefore takes over 1mS for the multiplexer output to settle on the next channel.
Is there a way of simultaneously changing the multiplexer address bits, without altering the state of the other output pins?