Offcourse I forgot the brackets
I made one error in my explanation
the first mux is on AN0 the second one AN1
so in the middle of the for nextloop i need to switch to ADCIN 1
Your single loop for ADCin0 and 1 is not clear to me
Offcourse I forgot the brackets
I made one error in my explanation
the first mux is on AN0 the second one AN1
so in the middle of the for nextloop i need to switch to ADCIN 1
Your single loop for ADCin0 and 1 is not clear to me
rmteo has forgotten to set portC. Just add the red line and it will work. (I sugget you to use a small delay)Your single loop for ADCin0 and 1 is not clear to me
Code:for i = 8 to 23 PortC = i Pause 1 ADCIN 0, AD[i-8] next iRemember that as you have wired the system mux2 will start first (from 8 to 15) and then to follow mux1 will be activated (from 16 to 23). If you need them the other way around then swap the wiring of portC.3 & portC.4S0,S1,S2 are on RC0-RC2
Enable of Mux 1 on RC4
Enable of mux 2 on RC3
Al.
Last edited by aratti; - 20th March 2010 at 00:46.
All progress began with an idea
Yes, I did leave out setting PORTC in my single loop example. If you are using AN0 and AN1, try this.
You can also use a single analog input by tying the outputs (Z pin) of the muxes together to AN0 then the code is simplified to this. Insert appropriate delays in both cases.Code:for i = 8 to 23 PORTC = i if i < 16 then ADCIN 0, AD[i-8] else ADCIN 1, AD[i-8] next i
Code:for i = 8 to 23 PORTC = i ADCIN 0, AD[i-8] next i
Last edited by rmteo; - 20th March 2010 at 01:23.
Bookmarks