Interfacing with I2C on PC-Engines ALIX

All,

I have done some work in the past with PC Engines ALIX 2c3/2d3 systems, for firewalls, lightweight servers etc. Those have an I2C header on board. I wonder if it is possible to interface an Arduino with this I2C header.

Unfortunately, I'm unable to find any information on this that doesn't ultimately lead to traditional lmsensors motherboard temperature reading stuff. I don't know where to start, as this appears to be a low-level task that seems to be beyond my usual system programming skills.

Information on the ALIX is on pcengines.ch - Sorry, I'm not allowed to insert a link in my first post here.

Any OS on the ALIX will be fine as long as it's Linux or OpenBSD. :wink:

Thanks all! :slight_smile:

Hi,
both models have a USB-port so connecting the arduino there is the natural choice (and much easier too). Moreover the IIC-bus doesn't seem to be available on external pins, so don't waste your time.

Eberhard

I don't want to connect anything externally (USB) and I2C appears to be pretty much available on J13.

I could use the internal USB header, but that would require physical adaptation as well, so why not save the cost for USB and exchange my few bytes between Arduino and ALIX through I2C?

Hi,
well if you really want to dive into it: get the linux-sources for your intended system and read the docs in
/usr/src/linux/Documentation/i2c
I think it will be a hell lot of work, and you will learn a lot about kernel-code probably even about writing a kernel-module. Good luck.

I could use the internal USB header, but that would require physical adaptation as well, so why not save the cost for USB

Which costs could that be?

Eberhard

I planned to use an Arduino Pro Mini. Cost means either an FTDI interface, or a different Arduino with USB on-board.

I was hoping to save 10 euros and learn something in the progress, but if there really is no userspace interface to I2C in any OS, then that's probably not an option.

Hi,
the only I²C (Linux-)user-space driver I ever came across was one for the (old) FoxBoard http://foxlx.acmesystems.it/. This one used some general purpose IO-pins available on the board. But the timing was somewhat shakey, if I remember it correctly.

Maybe you find some example-code checking the beagleboard sites http://beagleboard.org/.

But I would spend the 10? and look for a different lerniog challenge.

Eberhard

From the manual:

J13 / J8 I2C bus (build option)
This optional header can be used to connect user specific hardware, e.g. a front panel
microcontroller, or for a licensing dongle. See AMD CS5536 data sheet for programming details.
1 +3.3V power supply
2 SMB_SCL I2C clock
3 SMB_SDA I2C data
4 GND ground

the lmsensors code is where you would want to start as far as talking i2c.

http://lists.lm-sensors.org/pipermail/i2c/2006-September/000279.html

http://lm-sensors.org/svn/i2c-tools/trunk/tools/i2cget.c
http://lm-sensors.org/svn/i2c-tools/trunk/tools/i2cset.c

looks like most of the pieces are out there.

With the arduino, remember that you need to program it somehow, either over serial or through ICSP

Armed with the information found by KyleK's, it looks like you could talk to something over I2C from your pcengines ALIX.

The Arduino hasn't got a bootloader which will use I2C though, so you'll need some way to program it. The Arduino has a serial bootloader. It looks like the ALIX has a serial interface, so you could use that to upload programs to an Arduino.

If the ALIX has a real RS232 (I can't tell from the spec, but it looks like it), you'll need a level shifter because the Arduino doesn't work at RS232 voltages. Have a look at Arduino Single-Sided Serial Board or just get a generic RS232 level shifter.

So, it looks completely feasible.

There are several moving parts to get going in order to talk from your pcengines ALIX to an Arduino. If it doesn't go smoothly, maybe, if you get a second Arduino (maybe something low-cost, maybe a Boarduino or RBBB), you might be able to divide the problem into pieces and make it easier for yourself.

HTH
GB

I'm also interested in this. Please keep us posted if you succeed.