Wednesday, January 24, 2018

Beaglebone Black I2C Verifying

My Beaglebone black, laying there for months. I wass caught up with work load, the work stress and I wanted a complete blank mind at home.

I was indulging myself in novel and movie. Completely waste of time without making any progress in my self-achievement.

Previously, I promised myself to write one blog per month. I want to try something new, explore new feature, experience that little achievement when proof of concept is working. But I was utterly wasted all the time on movies, make no progress in work, didnt make effort to step out of that vicious cycle.

Cut long story short.
Now I have some time, I want to continue exploring Beaglebone Black.

Most simple one is always the I2C communication.

I have my favourite logic analyzer LA1002, just updated the KINGST VIS to version 2.1. (Cant be sure what is the new features).

This is the settings I have set at the KINGST VIS.

Now to the pinout for I2C. P9 - pin 19 and pin 20.

Picture from BeagleBoard.org

Taking out my elongated header pin, I connect the LA1002 and pin 19 & pin 20.


For the test app, I use the famous i2c-tools.

for the device node, only 2 device nodes are available, I2C2 is mapped to /dev/i2c-1
bash command: ls /dev/i2c*
/dev/i2c-0  /dev/i2c-1

Run the command: i2cdetect -r 1

Let see the output at KINGST VIS side.
Signal is sent start from address 3:

Frequency is 100KHz:

Value is decoded, all NACK (expected as no slave device attached):

I2C is proven working, now is to find a slave device and write a user app for it.

TO BE CONTINUE ...
To the slave device testing.
I have one Adafruit BME280 module.


Use the i2cdetect to check the slave device and there it is, circled in red.

Now to google a test app. "Control Everything Community"
Providing free c code for BME280. Worth the promotion.
source code github link

You need to do little modification, change the slave device address.

Do the compilation: gcc -Wall -Wextra bme280.c -o bme280


Type this command to continue showing the data: "watch -n 1 ./bme280"

Now bring the thing to your mouth and continue blowing, you will see the reading changes.

TO BE CONTINUE

No comments:

Post a Comment