5

Testing ArduiPi board

This post describe the procedure used to verify that ArduiPi board is working correctly.

Edit 03/17/2014 : Modified for testing ArduiPi Rev 1.1 board

What do you need ?

  • A Raspberry Pi Rev 2 with Raspbian, I recommand the Wheezy version (Revision 2 board is mandatory to test the new GPIO available on the Raspberry board. If you have a Revision 1 the ArduiPi board will not be correctly tested for the new GPIO
  • Raspberry Pi test scripts for ArduiPi
  • A Seeedstudio I2C Grove 96×96 OLED display
  • A ArduiPi Board with Arduino flashed with test firmware
  • A ArduiPi test board with pogo pins to get onto the ArduiPi pads (or other methods if you solder connectors onto your ArduiPi board)
  • A external power to power the ArduiPi board (9 to 12V is fine)

Assumptions

  • You must have dev tool installed onto your Raspberry Pi for compilation and a updated Wheezy distribution is preferable.
  • You can connect to the Raspberry Pi with SSH or launch a root terminal directly on the Pi connected to a screen with keyboard
  • Electronic and IT skills are preferable in case of problem

Configure ArduiPi board

  • Set the switch named PI_VCC_EXT to the EXT position to tell the board you are using external Power
  • Set the switch named 3V3_VDD_5V to the 5V position to tell the board we are going to work with 5V power
  • Flash Arduino Test Firmware onto the Arduino of ArduiPi board (using FTDI cable and connector is perfect for this). The ArduiPi board have the correct FTDI connector on the board. The test program firmware for Arduino is located on the ArduiPi github repository. More precisely here.

Installing the test shield

  • Plug the ArduiPi test board onto ArduiPi board (with Raspberry powered off)
  • Plug the OLED display in Grove connector I2C_OLED of the test board
  • Take Care, the ArduiPi 1st prototype and test board have line SCL and SDA reversed (only on I2C Grove connector) so you need to manually invert SDA and SCL on your Grove cable
  • If you want to program the Arduino again you will need to remove the test board because the test board connect Pi Uart to Arduino Serial and this conflict with Arduino flash (This is corrected on latest test board PCB with jumpers)
  • Power on Raspberry Pi
  • Plug external power onto ArduiPi board (Led state are fancy, don’t worry this is okay)

What should happen ?

  • Led 2 to 9 of ArduiPi test board
    • should blink one after one in a loop (Arduino is alive !!!)
  • OLED display should display test passed state of differents features as follow :
    • 1-Wire communications between Arduino and I2C controller
    • Analog input values on ArduiPi board
    • I2C communications between Arduino and Raspberry PI
    • SPI communications between Arduino and Raspberry PI
    • Serial communications between Arduino and Raspberry PI

Of course, until action is done on Raspberry PI, 3 of theese tests will fail, the tests of communication between Arduino and Raspberry PI (I2C, SPI and Serial) should display — instead of OK

Here below a screen shot of what should be displayed

ArduiPi-test-nok

ArduiPi-test-nok

Ok done, now go to Raspberry Pi

I am connecting to Pi with ssh, once you’ll on the Pi issue the following commands to be able to compile. Because you will need the compiler and some others tools :

Free up the serial port used by the Linux console

Please check the post I already wrote for enabling the serial port on Raspberry Pi, follow the procedure.

Install I2C and SPI modules on Pi

By default I2C and SPI modules are disabled onto Raspian Wheezy version. You need to enable the kernel modules to be able to use SPI and I2C. to do so, edit the file raspi-blacklist.conf do disable the blacklist module

Then comment the two lines that are blacklisting the modules adding # before, this should be something like that :

Verify that the file /etc/modules contains the following lines and add them if it is not the case to autoload these modules at bootup.

now reboot your Pi

After reboot check that the modules are loaded, you should see both i2c_bcm* and spi_bcm*.

 Installing WiringPi library and tools

To drive the Raspberry PI I/O ports I decided to use the small and pretty cool library named WiringPi from here. You need to install this library on the Raspberry, follow this tutorial for doing that. Thank to Gordon for this excellent job.

Installing ArduiPi tools from GitHub repo

The ArduiPi program is the program that permit communications between the Raspberry Pi and Arduino. It can do I2C/SPI and Serial communication according the ArduiPi protocol defined for this project.

Download ArduiPi tools suite suite from the ArduiPi github repository by cloning the repository.

The ArduiPi program is located into folder raspberry/ardupi. To build it, Issue a :

If all went well, the aruipi program has been installed into /usr/local/bin folder. Check this out using a :

Once done we could check that Arduino is seen on i2c bus and other devices issuing a

you should have the following result (use i2cdetect -y 0 if your Pi is revision 1)

Raspberry saw 3 devices :

  • 18 is DS2482 1-Wire controller
  • 2a is the Arduino of ArduiPi board
  • 3c is the Grove OLED display

Ok all seems fine, now deep test the ArduiPi board

Goto the folder containing the test_board shell script that need to be launched on the Raspberry Pi.

This script use WiringPi command so remember that this need to be installed onto the Raspberry Pi as indicated above so as the ArduiPi executable.

To be sure the first time, set the script to executable issuing a :

Now you can launch the script from Raspberry by :

What should happen ?

  • Script will ask you to press POWER-PI switch button (ArduiPi board V1.1 only) to start test.
  • Then script will test autoreset feature by issuing a reset to Arduino using GPIO 18 (ArduiPi V1.1)
  • Led D13 should blink 2 times indicating that Arduino reset has been done (ArduiPi V1.1)
ArduiPi-test-ok

ArduiPi-test-ok

  • I2C Communications on OLED should
    • pass from — to OK
  • SPI Communications on OLED should
    • pass from — to OK
  • Serial Communications on OLED should
    • pass from — to OK
  • Raspberry Leds (17 and 18 are disabled on ArduiPi board >= V1.1 because GPIO are used for Power PI and Auto-Reset features)
    • Leds CE1, 4, 17, 18, 21, 22, 23, 24, 25, 28, 29, 30, 31 should all be off
  • then
    • Leds CE1, 4, 17, 18, 21, 22, 23, 24, 25, 28, 29, 30, 31 should all be on
  • then
    • Leds CE1, 4, 17, 18, 21, 22, 23, 24, 25, 28, 29, 30, 31 should all be off
  • then
    • Leds CE1, 4, 17, 18, 21, 22, 23, 24, 25, 28, 29, 30, 31 should now cycle
  • then script will end

You must also test the 2 free pins by pressing the tactile switches on the test board. SW1 should lit LEDFREE1 and SW2 LEDFREE2

If all these steps worked, ArduiPi board is working fine, and I hope you will have fun with it.

Charles

 

 

 

Charles

Charles

5 Comments

  1. Running make for arduipi I get the error “I2C_SMBUS_WRITE” undeclared

  2. Hi!

    Just received my arduipi 1.1 in the mailbox 🙂
    And trying out your instructions “Testing ArduiPi board”, but cant connect with i2c.

    pi@raspberrypi ~/arduipi $ sudo i2cdetect -y 0
    0 1 2 3 4 5 6 7 8 9 a b c d e f
    00: — — — — — — — — — — — — —
    10: — — — — — — — — 18 — — — — — — —
    20: — — — — — — — — — — — — — — — —
    30: — — — — — — — — — — — — — — — —
    40: — — — — — — — — — — — — — — — —
    50: — — — — — — — — — — — — — — — —
    60: — — — — — — — — — — — — — — — —
    70: — — — — — — — —

    Any ideas?

    The modules are loaded:
    pi@raspberrypi ~ $ sudo lsmod | grep bcm
    snd_soc_bcm2708_i2s 5486 0
    regmap_mmio 2818 1 snd_soc_bcm2708_i2s
    snd_soc_core 128166 3 snd_soc_pcm512x,snd_soc_wm8804,snd_soc_bcm2708_i2s
    spi_bcm2708 4808 0
    i2c_bcm2708 4719 0

    • Hi Karim,

      Got a good news for you, the 1st thing is your I2C is working fine, the device 18 is the I2C to 1-wire controller on the ArduiPi board, so Pi and ArduiPi are working fine.
      Would you describe me in detail what you want to do ? I’m not sure of what you’re trying to do. Do you want the Pi to speak I2C with Arduino ? If so you need to upload on Arduino a firmware that can speak I2C (like the test firmware) and also connect the two pads PSCA and PSDL with some solder. By default the I2C SDA,SCL of the Pi are not connected to the I2C of Arduino (A4,A5), this is the role of the 2 PAD. But take care, if you do that, you MUST have a correct firmware on the Arduino. If for example your Arduino is driving SDA, SCL line for other purpose than I2C (mainly as output LED for example), since the line are connected to Pi I2C, this will result of a non working I2C bus on Pi until you remove the solder the pad or leave pins A4,A5 of Arduino as “Input” in your Arduino Sketch.
      Let me know in detail your problem so I can check and try to help or if you need more details.
      Charles

  3. Ok, I didn’t flash the Arduino Test Firmware onto Arduipi.
    As soon I receive a FTDI cable I will also test Arduipi standalone.

Comments on this topic in community Forums.