the magic 'F' pin mode of IIC

This is where you talk about the EV3 software itself, installation issues, and programming talk.

Moderators: roger, gloomyandy, skoehler

the magic 'F' pin mode of IIC

Postby topikachu » Mon Oct 28, 2013 2:43 pm

Hi,
As I test, to enable my mindsensor PS2 controller interface IIC sensor, I need to setup the pin mode to 'F'.
And there are a lot of 'F'(0x46) in the ev3 device list http://python-ev3.org/types.html

I'd like to know what this 'F' means.

Thanks
topikachu
Novice
 
Posts: 32
Joined: Wed Sep 18, 2013 3:27 am

Re: the magic 'F' pin mode of IIC

Postby gloomyandy » Mon Oct 28, 2013 2:56 pm

'F' puts the pins into float mode, You can see what the various modes do here:
https://sourceforge.net/p/lejos/ev3sdca ... og.c#l3325
Note however that in he case of many of the sensors (like i2c and uart) the actual kernel module will override the pi settings if it needs to. So for hings like i2c the only settings that really mean anything are those that impact the voltage provided on pin 1.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3645
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: the magic 'F' pin mode of IIC

Postby topikachu » Tue Oct 29, 2013 12:44 am

confused. In the kernel, it's lower case 'f' 0x66. I will test if this works.
topikachu
Novice
 
Posts: 32
Joined: Wed Sep 18, 2013 3:27 am

Re: the magic 'F' pin mode of IIC

Postby gloomyandy » Tue Oct 29, 2013 10:33 am

Yep the config files are wrong. But because it is an i2c sensor it actually makes no difference what so ever....

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3645
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: the magic 'F' pin mode of IIC

Postby topikachu » Thu Oct 31, 2013 3:51 pm

tested!
Only the upper case 'F' works.
Totally confused.
topikachu
Novice
 
Posts: 32
Joined: Wed Sep 18, 2013 3:27 am

Re: the magic 'F' pin mode of IIC

Postby gloomyandy » Thu Oct 31, 2013 4:39 pm

What have you tested? What works and what does not and why are you confused?
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3645
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: the magic 'F' pin mode of IIC

Postby topikachu » Fri Nov 01, 2013 1:01 am

I use a mindsensor psp controller receiver to test ev3 iic. The receiver firmware is 4.20
I can only receive the correct data once I set pin mode to 'F'
If set to 'f' or doesn't set any pin mode the data is garbage.
topikachu
Novice
 
Posts: 32
Joined: Wed Sep 18, 2013 3:27 am

Re: the magic 'F' pin mode of IIC

Postby gloomyandy » Fri Nov 01, 2013 4:41 pm

Hi,
are you sure? 'F' would seem to do nothing at all. So it seems odd that this would make any difference. What are you using to test this with?

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3645
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: the magic 'F' pin mode of IIC

Postby topikachu » Tue Nov 05, 2013 2:08 pm

I create a pure c application to test my mindsensor psp controller
https://gist.github.com/topikachu/7319065

It only works after set correct DEVCON, and dcm pin mode must be 'F'

If I skip any step or set another pin mode, I only get garbage data from IIC
topikachu
Novice
 
Posts: 32
Joined: Wed Sep 18, 2013 3:27 am

Re: the magic 'F' pin mode of IIC

Postby gloomyandy » Tue Nov 05, 2013 3:29 pm

Still makes no sense to me what so ever. I don't see how writing a pin mode of 'F' makes any difference at all. The code in the krnel module would seem to do nothing in this case. Also at that point after the calls to SET_CONN the hardware will have been setup to perform i2c operations, so if it did change the pins it might well stop them from working correctly for i2c.. In leJOS we set the pins into float mode before we do the SET_CONN see the init code in the following:
https://sourceforge.net/p/lejos/ev3/ci/ ... CPort.java

What happens if instead of setting the value to 'F' you set it to '-'? Does that work as well?
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3645
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: the magic 'F' pin mode of IIC

Postby topikachu » Wed Nov 06, 2013 1:05 pm

Hi, Andy
You are right. The 'F' is same as like '-'
In fact, the only thingis is that you can't set 'f' for this sensor.

Thanks
topikachu
Novice
 
Posts: 32
Joined: Wed Sep 18, 2013 3:27 am

Re: the magic 'F' pin mode of IIC

Postby gloomyandy » Wed Nov 06, 2013 2:40 pm

Hi,
well '-' and 'F' do nothing as far as I can tell. You can set 'f' but you need to set it before you initialize the i2c side of things. If you float the pins after that, then i2c will not work properly as the initialization code configures the pins for i2c use.... There are other pins though (in particular the one that supplies 9V to the NXT Ultrasonic sensor), so it is worth making sure that the pins are set correctly.

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3645
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK


Return to EV3 Software

Who is online

Users browsing this forum: No registered users and 3 guests

more stuff