Fitlet and GPIO access

DaveLangstaff
Posts: 5
Joined: Thu Oct 29, 2015 10:21 am

Re: Fitlet and GPIO access

Post by DaveLangstaff »

Hi,

I've finally gotten some time to play with the Fitlet and gpio under Mint and am having a few difficulties.

In the documentation for the fitlet SDK under Linux, under the usage section, there is a line
"modprobe fch_gpio"

This fails, saying "module fch-gpio not found". I checked the other documentation and presume it is a typo, as "modprobe gpio_fch" seems to work and loads the module as required. So far, so good, however I can't seem to set the direction of the I/O pin and it acts like an input at all times.

The line "Echo 89 > /sys/class/gpio/export" seems to work ok, as is confirmed by the creation of a directory named gpio89 on the path /sys/class/gpio

The line "echo out > /sys/class/gpio/gpio89/direction" appears to work, as the file direction does now hold the value "out". This can also be set to "in" successfully as well as "low" and "high" but no other values, AFAIK.

At this point there is 3.3v on pin gpio89, echoing 1 or 0 to /sys/class/gpio/gpio89/value makes no difference to this value.

The pin does seem to work as an input with a pull-up, however. If I leave it alone, then the command
"cat /sys/class/gpio/gpio89/value" yields a 1 whereas if I connect the pin down to ground then
"cat /sys/class/gpio/gpio89/value" yields a 0 - which is as required.

So in summary, the problem seems to be with the implementation of the direction command and communicating this information to the gpio chip.

I'd be grateful for any help you can give

regards

dave Langstaff

DaveLangstaff
Posts: 5
Joined: Thu Oct 29, 2015 10:21 am

Re: Fitlet and GPIO access

Post by DaveLangstaff »

Oops,
The direction error was due to me having an out of date kernel, I updated that and everything is working fine now, although the fch_gpio typo in the documentation is still a gotcha.

mbirger

Re: Fitlet and GPIO access

Post by mbirger »

Thanks, we will check this

bjorn_latronix
Posts: 21
Joined: Thu Sep 17, 2015 8:43 am

Re: Fitlet and GPIO access

Post by bjorn_latronix »

I am trying Win10-64 and Matlab 2016B-64 on Fitlet. Very nice experience but I fail to load the GPIO.dll into Matlab.
>> loadlibrary('C:\System\GPIO','C:\System\GPIO.h')
Matlab complains that the dll is not 64-bit. There is a known issue that 64-bit Matlab does not run 32-bit dlls. Could you post a link to a 64-bit dll and the header file. Matlab requires the header file and it would save me some trials in the dark. I'll be happy to post the results here when I have something that works.

Post Reply

Return to “General fitlet questions”