Quantcast
Channel: Beagle Board-xM Explorations » software
Viewing all articles
Browse latest Browse all 2

Progress! SPI is working on the BeagleBoard-xM

$
0
0

As a first step to writing a Linux SPI device driver for the Maxim 7221 LED display driver chip I decided to at least prove that I can get SPI working on the BeagleBoard-xM with the BeagleBoard-xM Trainer Expansion Board which provides level translated SPI and GPIO pins.

To get this to work I had to do the following:

  1. Patch the Linux Kernel 2.6.32 BeagleBoard board specific arch/arm/mach-omap2/board-omap3beagle.c so that the SPI pins get configured correctly and the SPIDEV driver is made aware of the SPI devices on the board. For the patch information see this page.
  2. Once the kernel was patched I used the Angstrom distribution OpenEmbedded build environment to re-build the kernel.
  3. Build the spidev_test.c program that is part of the Documentation/spi tree in the linux kernel source using a cross compiler built using the crosstool-ng cross compiler build system.
  4. Load the spidev_test executable onto the Beagleboard-xM

With everything set up and ready to go it was time to boot BeagleBoard-xM and verify that the required SPI devices appeared in the /dev directory. Upon booting I was very happy to see the following:

root@beagleboard:/# ls /dev/spi*
/dev/spidev3.0 /dev/spidev3.1 /dev/spidev4.0

With the spidev devices being present it was time to see if they actually worked! So I hooked up my USBee SX logic analyzer to the Trainer boards McSPI4 pins and ran the spidev_test program. What the logic analyzer saw was exactly what the spidev_test program was sending! I’ve now verified that I can communicate with SPI devices using the kernels SPIDEV driver.

The spidev_test program sends the following data:


uint8_t tx[] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x40, 0x00, 0x00, 0x00, 0x00, 0x95,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xDE, 0xAD, 0xBE, 0xEF, 0xBA, 0xAD,
0xF0, 0x0D,
};

You can see from the following screen shot that the data was properly transmitted via the SPI:

Click the image to view full size.

And here are some images of the BeagleBoard-xM set up with the Trainer card and the USBee logic analyzer attached:

Click on image to see full size.

 

Click on image to see full size.

 

The next step is to write some code to put the SPI LED display through it’s paces.

 


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images