Example MikroBus Rotary on the DEV-IOT6U
This is a guide to the MikroBus Rotary Demo on the DEV-IOT6U.
NOTE |
Do to a design flaw in the MikroBus Rotary B Click, the card does not allow another SPI device to be present on the SPI Bus. The SoM-IMX6U uses the SPI Bus and the presence of MikroBus Rotary B Card prohibits the SOM from booting. To alleviate this issue, the pin labeled “SDO” must be cut and jumpers JB5 and JB6 on the Dev Kit Carrier Board (SoM-112) must be set to 3P3 (see figures below) |
Contents
General Information
Hardware Requirements
- The DEV-IOT6U Development Kit
- Desktop PC (Windows/Linux/Mac will work)
Software Requirments
These tools should already be installed if you installed the EMAC SDK using the automatic installer.
- EMAC OE 5.X SDK
- EMAC Qt Creator
- GNU
make
- CMake
- Putty (Windows) or Minicom (Linux/MacOS)
Setup
If you haven't already, please review the "getting started" page for the DEV-IOT6U. EMAC_OE_SDK will need to be installed and serial and network connections will need to be established between the developer machine and the target device. See the Serial Connections or Network Connections page for more information on how to connect to the target EMAC product using a serial port or Ethernet connection.
- Follow the setup described in the getting started page for the DEV-IOT6U
- Open a text editor and copy paste the provided .c file: dev-iot6u_mikrobus_demo.c
- Save as "dev-iot6u_mikrobus_demo.c"
- Open a terminal session with the DEV-IOT6U through your preferred serial monitoring program:
- Putty on Windows https://www.putty.org/
- Minicom on Linux/Mac
- Login to the DEV-IOT6U and run command "ifconfig" to retrieve the device's IP Address
- In a second terminal window, navigate to where the dev-iot6u_mikrobus_demo.c file was saved
- Run the following commands with the device's IP substituted:
source /opt/emac/5.2/environment-setup-armv5e-emac-linux-gnueabi
$CC dev-iot6u_mikrobus_demo.c -o dev-iot6u_mikrobus_demo -lgpiod
scp dev-iot6u_mikrobus_demo root@xxx.x.x.xxx:
- This process is explained in the Getting Started with EMAC OE SDK
- Enter the device password: emac_inc
- The terminal will give a a success message to let you know that the file was securely copied.
- A "ls" command on the device will show that the executable is there.
Usage and Behavior
Using the Demo
In a terminal session with the DEV-IOT6U enter the following to run the demo:
./dev-iot6u_mikrobus_demo
The MikroBus Rotary dial may then be turned, and with each click, the lights will increment in binary. One side of the card's lights are associated with one of the card's registers, likewise for the other set of lights.
The MikroBus Rotary B click™ carries a 15-pulse incremental rotary encoder with detents, surrounded by a ring of 16 blue LEDs. It communicates with the target board through mikroBUS™SPI lines (CS, SCK, MISO, MOSI), and three additional lines for outputting the Encoder info: ENCB OUT, ENCA OUT and SW (in place of the standard AN, RST and INT pins, respectively). Rotary B click™ can be used with either a 3.3V or 5V power supply.
Summary
This example is a demonstration of the use of the Mikro Bus on the DEV-IOT6U.