[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4694: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4695: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4696: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
8devices Community - View topic - Working with SPI, GPIO and I2C
www.8devices.com
View unanswered posts | View active topics It is currently 18 Apr 2024, 22:20



Reply to topic  [ 26 posts ]  Go to page 1, 2, 3  Next
 Working with SPI, GPIO and I2C 
Author Message
User avatar

Joined: 16 Dec 2011, 14:44
Posts: 105
Location: The Netherlands
After some hours of tinkering I've got Carambola working nicely. It's hooked up to the RX/TX of a 3.3V Arduino and spits out commands via /dev/ttyS1. However, I would like to get rid of the Arduino and address some peripherals directly via SPI and I2C. In the Wiki those items are listed as TODO so no documentation is available yet.

I would like to know where to start, so I can start experimenting. Is there a way to interface through SPI using scripts (shell/python/lua) or do I need to make a compiled C program? Can anyone point me to some useful documentation that applies to the Carambola? Thanks!

_________________
| |


27 Dec 2011, 15:54
Profile

Joined: 19 Dec 2011, 23:05
Posts: 20
I'm able to see /sys/class/gpio, and I can do
echo 5 > export
and then see /sys/class/gpio/gpio5
However, I'm unable to perform any operations on gpio5 that actually seem to affect the pin.
Many of the GPIO pins are not 'exportable' to userspace - they come back as "ash: write error: Device or resource busy"

So, how DOES one use the GPIO pins on this guy?

As soon as somebody gets any hardware interfaces working (SPI, I2C, GPIO) please let us know!

*Brian


27 Dec 2011, 21:31
Profile

Joined: 21 Dec 2011, 06:23
Posts: 9
I2C works fine from my experience. Just download the i2c-tools package and compile your package with the i2c-dev.h header (The userland one, NOT the kernel one)


27 Dec 2011, 23:23
Profile
User avatar

Joined: 16 Dec 2011, 14:44
Posts: 105
Location: The Netherlands

_________________
| |


28 Dec 2011, 10:15
Profile

Joined: 08 Dec 2011, 09:35
Posts: 138


28 Dec 2011, 21:11
Profile
User avatar

Joined: 16 Dec 2011, 14:44
Posts: 105
Location: The Netherlands
Thanks! Will try gpioctl today.

By the way, when searching for SPI and Carambola I found who seems to be working on spidev for Carambola on GitHub. I tried manually adding his changes to the source and recompiling but it hasn't provided me with a working SPI yet.

_________________
| |


29 Dec 2011, 09:23
Profile
User avatar

Joined: 16 Dec 2011, 14:44
Posts: 105
Location: The Netherlands
The examples work nicely: I can set and clear gpio1 and gpio2. The other gpio don't seem to work. Why don't they? Are they used by other peripherals?

_________________
| |


29 Dec 2011, 09:44
Profile

Joined: 08 Dec 2011, 09:35
Posts: 138
As I mentioned before, some I/O pins are shared with other functions. If function is set to GPIO, gpioctl can control them, else function should be switched.


29 Dec 2011, 10:50
Profile
User avatar

Joined: 16 Dec 2011, 14:44
Posts: 105
Location: The Netherlands

_________________
| |


29 Dec 2011, 11:07
Profile

Joined: 08 Dec 2011, 09:35
Posts: 138


31 Dec 2011, 09:54
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 26 posts ]  Go to page 1, 2, 3  Next

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Protected by Anti-Spam ACP Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.