Page 1 of 1

ECIO-40P and ADC

Posted: Sun Feb 08, 2009 3:56 pm
by wim314
Hello,

I am trying to use the ADC(7) input (RE2) of the ECIO-40P module.
One reason or another, the pin OUTPUTS a voltage of around 4V instead of sampling the INPUT voltage.
Does someone has an idea? Or do I do something totally wrong?

Best regards
Wim

Re: ECIO-40P and ADC

Posted: Mon Feb 09, 2009 1:06 pm
by Benj
Hello Wim

The ADC component will switch the pin to an input automatically and then restore after the sample so if you are outputting a 1 at the same time then it could be the switching in and out that is causing the apparent 4V to be generated on the pin. What value are you getting when you read the sample back.

Re: ECIO-40P and ADC

Posted: Mon Feb 09, 2009 2:38 pm
by wim314
Hi Ben,

I am getting as sample value something around 210 (corresponding with the 4V). When I disconnect the wire between the RE2 pin and the sensor, then there is still 4V on the RE2 pin, while there is 2,5V at the sensor output.
I have looked into the code and I cannot find a reference to the RE2 pin other than sampling the ADC(7).
Is there an easy way to launch a FIND command within flowcode that will look also inside all macro's?

best regards
Wim

Re: ECIO-40P and ADC

Posted: Mon Feb 09, 2009 3:37 pm
by Benj
Hello Wim

Sorry my mistake. RE2 is used by the ECIO as the USB detect pin and also the ECIO LED pin. You are still free to use this pin as an input or output but the analogue value read in will be dominated by the USB voltage eg your 4V. I would suggest disconnecting the USB detect circuitry but then the bootloader would not work correctly and that wouldn't really be much use... unless that is you can alter the voltage to this pin easy enough to send the voltage high when resetting to allow for reprogramming and low when resetting to enter the user program mode.

Sorry for the runaround, should have spotted this when you asked before.

Re: ECIO-40P and ADC

Posted: Mon Feb 09, 2009 5:03 pm
by wim314
Hi Ben,

thanks for the clarification. Now I do not have to try it again :D .
I will try to recuperate some of the other ADC input pins (this needs a little bit of rewire in my robot, but I think it sould be possible). I have somewhere still some ICs of Microchip which allows me to expand the IO pins via the I2C interface.
Maybe it is a good idea to add the remark about pin RE2 to the ECIO-40P datasheet?

Best regards,
Wim

Re: ECIO-40P and ADC

Posted: Sat Feb 28, 2009 3:13 pm
by wim314
Ben,

still one small issue. When removing ADC(7) and adding a new ADC which I want to assign to ADC(9) then the channel is correctly set to ADC(9), but the component itself is called ADC(7). Probably because 7 is the first free number in the row as ADC(0)... ADC(6) are in use. When I try to add ADC(9) to my project, it is not in the list. Any suggestions how I can add ADC(9)?
ADC9.JPG
ADC9.JPG (72.92 KiB) Viewed 6033 times
Best regards,
Wim

Re: ECIO-40P and ADC

Posted: Mon Mar 02, 2009 5:13 pm
by Sean
Hello Wim,

The allocation of the number 7 in ADC(7) is controlled by Flowcode. It is the internal index number of the individual instance of the ADC component (allocated sequentially). It has no relation to the ADC channel being accessed.

If you want the ADC component accessing ADC Channel 9 to be referenced as ADC(9), you can create ADC(7), ADC(8) and ADC(9), then delete ADC(7) and ADC(8). Flowcode will not produce any code relating to the deleted components.

Re: ECIO-40P and ADC

Posted: Mon Mar 02, 2009 5:32 pm
by wim314
Hi Sean,

Thank you very much for the tip. I have just tested it and it works!
Great, you helped me further in developing my project.

Best regards,
Wim