Using the ready-made Bifferboard files
some more notes for when I have to do it again

I used these files
http://bifferos.planetlee.eu/bb-bin-1.2.tar.bz2
This is my backup

Objective
Create a fully featured file system for the Bifferboard from the ready-made files with
ftp
samba
mp3 to play simple dictionary of numbers and words like "the" "temperature" "is" etc
nano
http and scripting
USB to RS232 converter
HD webcam
i2c bus
WiFi
gpio pin drivers


Experiments with i2c ( PCF8574AP and PCF8591 now working !)

It works! see the 4 red leds - 1 on, 3 off - that's a 7 !!

Hardware
I used the same FET 3.3V to 5V level converter as for my Sweex router (but without the long line driver)
and connected to a PCF8574AP port expander and a PCF8591 A to D and D to A chip

I placed the .ipk files on my server and used "opkg install kmod-xxxxx" to load these modules
i2c_gpio
i2c_algo_pcf
i2c_algo_pca
i2c_algo_bit
i2c_dev
i2c_core

i2c-gpio-custom was present in the basic files

I have yet to use i2c_algo_pcf and i2c_algo_pca

Into /etc/init.d I put a file graham_start

#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=60
#insmod i2c-gpio-custom bus0=0,SDA,SCL
insmod i2c-gpio-custom bus0=0,3,2

and put a link into rc.s - why not just put the file in there??
ln /etc/init.d/graham_start /etc/S97graham_start

I compiled the drivers that I used in my nslu2 for PCF8574AP and PCF8591
by using the tool chain created from the Bifferboard 1.1 files

On the command line and in a folder containing the i2c C code in my Linux box I wrote
/home/graham/bb-src-1.1/openwrt/staging_dir/toolchain-i386_gcc-4.1.2_uClibc-0.9.29/
usr/bin/i486-openwrt-linux-uclibc-gcc -o PCF8574_addr_byteout_slug PCF8574_addr_byteout_slug.c

I also found that this will make a working driver
gcc --static -o PCF8574_addr_byteout_slug PCF8574_addr_byteout_slug.c
but at 544.3KB as opposed to 4.9 KB for the tool chain version!

These are my driver files, c code then working binary
PCF8574_addr_byteout_Biff.c - - - PCF8574_addr_byteout_Biff
PCF8574_addr_read_Biff.c - - - PCF8574_addr_read_Biff
PCF8591_address_channel-in_Vout_Biff.c - - - PCF8591_address_channel-in_Vout_Biff

The instructions to drive them are in the c code files

These seem to work to write to i2c devices but read gives errors - watch the Bifferboard forum.
Some progress has been made but not yet using OpenWrt Linux.

Sunspot Home

Bifferboard Index

Sweex Project