This chapter describes bus communication in detail, explaining and comparing the different bus types that are available on the Beagle boards. It describes how you can configure them for use, and how you can communicate with and control I2C, SPI, and UART devices, using both Linux tools and custom-developed C/C++ code. Practical examples are provided using different low-cost bus devices, such as a real-time clock, an accelerometer, a serial shift register with a seven-segment display, a USB-to-TTL 3.3V cable, and a GPS receiver. Finally, the AM335x DCAN controller is used to send and receive messages to and from a CAN Bus using Linux SocketCAN. After reading this chapter, you should have the skills necessary to begin interfacing almost any type of bus device to the Beagle boards.
EQUIPMENT REQUIRED FOR THIS CHAPTER:
- Any Beagle board
- A real-time clock on a breakout board (e.g., the DS3231)
- ADXL345 accelerometer on an I2C/SPI breakout board
- 74HC595 shift register, seven-segment display, and resistors
- A USB-to-TTL 3.3V cable (see Chapter 1 and Chapter 2)
- A low-cost UART GPS receiver (e.g., the GY-GPS6MV2)
- A low-cost physical-layer CAN Bus module (ideally one with a TI SN65HVD230 CAN controller)
Further details on this equipment and chapter are available at
Introduction to Bus Communication
In Chapter 6, the use of general-purpose input/outputs (GPIOs) is discussed in detail, which makes it clear ...