November 23, 2024, 04:14:30 AM

MOD-IO2 Analog Inputs

Started by veseo, January 23, 2013, 09:43:59 PM

Previous topic - Next topic

veseo

Hi Forum,

I'm looking to the readme file of MOD-IO2 examples, it list the functional codes available. For analog read there are four codes available 0x10, 0x11, 0x12, 0x13, 0x17 each of them related to a pin.
What I cannot found is how set the pins in analog mode, in other words how set the ANSELA register to declare which input pins are analog and which are digitals.

Does the ANSELA register is set automatically once used an analog read functional code?

If I look to the source code of the MOD-IO2 I cannot found the analog functional code
   
switch(command
{
case SET_TRIS: CommandSetTris(); break;
case SET_LAT: CommandSetLat(); break;
case GET_PORT: CommandGetPort(); break;
case SET_PU: CommandSetPullUps(); break;
case SET_REL: CommandSetRelay(); break;
case SET_ADDRESS: CommandSetAddress(); break;
default: break;
}


Thanks.

Regards,
Dario.
Have a look at Souliss [url="//www.souliss.net"]www.souliss.net[/url] for Internet of Things and Home Automation, working to be compatible with Olimex modules.

veseo

I was looking for an old example, while requesting an analog read the pin is set as analog input.

There is one fix that shall be applied to the README file of the MOD-IO2+OLinuXino example, for GET_PORT function is reported to perform two reads, first with arguments (address0, address1, address2, command) and later read for get the data.

In the real case the first command is a write (address+W) with such arguments and then a read to get data.

Regards,
Dario.
Have a look at Souliss [url="//www.souliss.net"]www.souliss.net[/url] for Internet of Things and Home Automation, working to be compatible with Olimex modules.

veseo

New question, for MOD-IO this time. Where I can found a reference manual with supported commands as per MOD-IO2?

Thanks,
Dario.
Have a look at Souliss [url="//www.souliss.net"]www.souliss.net[/url] for Internet of Things and Home Automation, working to be compatible with Olimex modules.

LubOlimex

Technical support and documentation manager at Olimex