Using the TXB0108 Logic Level Shifter this quick start will show how to connect a UART channel between Beagle Bone Black (logic level 3.3V) and a Teensy 2.0 (logic level 5V). To validate the connection we will send an “a” from the Beagle Bone Black to the Teensy 2.0 and the Teensy will automatically respond with “Hello World”.
- TXB0108 logic level shifter
- Male header
- Female to female jumper wires
- Teensy 2.0 microcontroller
- USB to USB-mini
- Beagle Bone Black (BBB)
- Solder male header pins on the module. If you have not assembled the Teensy 2.0 board yet, do it now.
- Using the jumper wires connect all devices:
*Note: You must have a common Ground between all devices. I used a breadboard to make a common ground node.
- Load the example code RS232.hex on to the teensy using the Teensy bootloader.
- Open Putty on your PC and connect to your BBB. If you do now know how to connect your beagle bone via Putty, follow this tutorial.
- Once you are connected to the internet and have Putty running execute the following commands:
- sudo apt-get update
- sudo apt-get install build-essential python-dev python-setuptools python-pip python-smbus –y
- sudo pip install Adafruit_BBIO pyserial
- In a text editor create the following program on your BBB or import the teensy.py file provided:
#initialize BBB UART to use UART 02
"/dev/ttyO2", baudrate=9600, timeout=4)
#open comms with the teensy
#check if we can write something to serial
"Teensy serial is open!"
#send to teensy
#grab the response from the teensy
- Execute the following command:
- python teensy.py
- Enter “a” to initiate communication
- Congratulations you have successfully used the TXB0108 Logic Level Shifter to make a UART channel between your BBB and Teensy 2.0!