Difference between revisions of "BeagleBone Black RFID Adaptor Cape"

From eLinux.org
Jump to: navigation, search
(Formated pictures)
(SPI Device Tree Overlay Setup)
Line 13: Line 13:
  
 
== SPI Device Tree Overlay Setup==
 
== SPI Device Tree Overlay Setup==
'''NOTE:''' You CAN NOT use SPI1 on the BeagleBone Black WITHOUT disabling the HDMI interface
+
The following information is slightly modified from [http://elinux.org/BeagleBone_Black_Enable_SPIDEV BeagleBone Black Enable SPIDEV]
 +
 
 +
'''NOTE:''' You MUST disable the HDMI interface to use SPI1 to talk to the adaptor cape.
 
<br>
 
<br>
Create a file called BB-SPI1-01-00A0.dts and copy-paste the following code into the file
+
Create a file called BB-SPI1-01-00A0.dts [[
<pre>
+
Compile the dtc:
/dts-v1/;
+
dtc -O dtb -o BB-SPI1-01-00A0.dtbo -b 0 -@ BB-SPI1-01-00A0.dts
/plugin/;
 
 
 
/ {
 
    compatible = "ti,beaglebone", "ti,beaglebone-black";
 
 
 
    /* identification */
 
    part-number = "spi1mux";
 
 
 
    fragment@0 {
 
        target = <&am33xx_pinmux>;
 
        __overlay__ {
 
            spi1_pins_s0: spi1_pins_s0 {
 
                        pinctrl-single,pins = <
 
                                0x190 0x33      /* mcasp0_aclkx.spi1_sclk, INPUT_PULLUP | MODE3 */
 
                                0x194 0x23      /* mcasp0_fsx.spi1_d0, INPUT_PULLDOWN | MODE3 */
 
                                0x198 0x03      /* mcasp0_axr0.spi1_d1, OUTPUT_PULLDOWN | MODE3 */
 
                                0x19c 0x13      /* mcasp0_ahclkr.spi1_cs0, OUTPUT_PULLUP | MODE3 */
 
                >;
 
            };
 
        };
 
    };
 
 
 
    fragment@1 {
 
        target = <&spi1>;
 
        __overlay__ {
 
 
 
            #address-cells = <1>;
 
            #size-cells = <0>;
 
            status = "okay";
 
            pinctrl-names = "default";
 
            pinctrl-0 = <&spi1_pins_s0>;
 
            cs-gpios  = <&gpio4 17 0>;
 
 
 
            spidev@0 {
 
                spi-max-frequency = <16000000>;
 
                reg = <0>;    /* Use 0 if you want CS0 */
 
                compatible = "linux,spidev";
 
                spi-cpha;
 
            };
 
        };
 
    };
 
};
 
</pre>
 
  
Compile the dtc:
 
<pre>
 
dtc -O dtb -o BB-SPI1-01-00A0.dtbo -b 0 -@ BB-SPI1-01-00A0.dts
 
</pre>
 
 
Then, copy the file into /lib/firmware/:
 
Then, copy the file into /lib/firmware/:
<pre>
 
 
  cp BB-SPI1-01-00A0.dtbo /lib/firmware/
 
  cp BB-SPI1-01-00A0.dtbo /lib/firmware/
</pre>
+
 
 
Then enable the device tree overlay:
 
Then enable the device tree overlay:
<pre>
 
 
  echo BB-SPI1-01 > /sys/devices/bone_capemgr.*/slots
 
  echo BB-SPI1-01 > /sys/devices/bone_capemgr.*/slots
</pre>
 
  
 
Plug in your BBB to a host computer using the mini usb data cable.
 
Plug in your BBB to a host computer using the mini usb data cable.
Line 85: Line 37:
 
capemgr.enable_partno=BB-SPI1-01
 
capemgr.enable_partno=BB-SPI1-01
 
</pre>
 
</pre>
after you save the changes, reboot your beaglebone black
+
Save the changes, reboot Beaglebone Black.
 
<br>
 
<br>
 
Make sure it is enabled
 
Make sure it is enabled
 
You should now have two spidev-files in the folder /dev/
 
You should now have two spidev-files in the folder /dev/
 
<pre>
 
<pre>
ls -al /dev/spidev1.*
+
ls -al /dev/spidev1.0
 
</pre>
 
</pre>
 +
 +
If you don't see it, you can type the following to manually enable the device tree overlay.
 +
echo BB-SPI1-01 > /sys/devices/bone_capemgr.*/slots
  
 
== Eagle Files ==
 
== Eagle Files ==

Revision as of 19:32, 24 July 2013

BeagleBone Pin Usage

Description

The RFID adaptor cape is an interface between the Beaglebone Black (BBB) and Texas Instrument's TRF7970ATB, (Multi-Protocol Fully Integrated 13.56-MHz RFID and NFC Transceiver) It allows users to have fully functional RFID and NFC capabilities on the BBB. The adaptor board also features four additional LEDs and a push button.

The communication between the BBB and the TB is via SPI. Since SPI pins are not automatically enabled on BBB, a device tree overlay is used to configure the pins properly for SPI use.

Schematic

RFID Adaptor Cape Schematic
RFID Adaptor Cape Layout






Sample Code

SPI Device Tree Overlay Setup

The following information is slightly modified from BeagleBone Black Enable SPIDEV

NOTE: You MUST disable the HDMI interface to use SPI1 to talk to the adaptor cape.
Create a file called BB-SPI1-01-00A0.dts [[ Compile the dtc:

dtc -O dtb -o BB-SPI1-01-00A0.dtbo -b 0 -@ BB-SPI1-01-00A0.dts

Then, copy the file into /lib/firmware/:

cp BB-SPI1-01-00A0.dtbo /lib/firmware/

Then enable the device tree overlay:

echo BB-SPI1-01 > /sys/devices/bone_capemgr.*/slots

Plug in your BBB to a host computer using the mini usb data cable.

Go to My Computer>BeagleBone Getting Started> and open uEnv.txt Copy and paste this command into the .txt file. Make sure to save your changes. (Ctrl+s)

optargs=quiet drm.debug=7 capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN
capemgr.enable_partno=BB-SPI1-01

Save the changes, reboot Beaglebone Black.
Make sure it is enabled You should now have two spidev-files in the folder /dev/

ls -al /dev/spidev1.0

If you don't see it, you can type the following to manually enable the device tree overlay.

echo BB-SPI1-01 > /sys/devices/bone_capemgr.*/slots

Eagle Files

References