Difference between revisions of "Example MikroBus Rotary on the DEV-IOT6U"

From wiki.emacinc.com
Jump to: navigation, search
m
(Added login info to this page as well)
 
(9 intermediate revisions by the same user not shown)
Line 15: Line 15:
  
 
* The DEV-IOT6U Development Kit
 
* The DEV-IOT6U Development Kit
* Desktop PC (Windows/Linux/Mac will work)
 
  
 
===Software Requirments===
 
===Software Requirments===
Line 24: Line 23:
 
* GNU <code>make</code>
 
* GNU <code>make</code>
 
* CMake
 
* CMake
 +
* Minicom
  
 
=== Setup ===
 
=== Setup ===
 
If you haven't already, please review the [[Getting_Started_with_the_DEV-IOT6U| "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.
 
If you haven't already, please review the [[Getting_Started_with_the_DEV-IOT6U| "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.
  
*Download this file
+
*Follow the setup described in the [[Getting_Started_with_the_DEV-IOT6U|getting started page for the DEV-IOT6U]]
*Open a terminal and minicom/putty into the board
+
*Open a text editor and copy paste the provided .c file: [http://git.emacinc.com/OE/qt-creator-example-projects/raw/master/mikrobus_iot6u/dev-iot6u_mikrobus_demo.c dev-iot6u_mikrobus_demo.c]
*get the ip address
+
*Save as "dev-iot6u_mikrobus_demo.c"
*second terminal
+
*Open a terminal session with the DEV-IOT6U through Minicom
*use EMAC OE SDK guide for host compiling
+
* Login to the DEV-IOT6U and run command "ifconfig" to retrieve the device's IP Address
 +
** somimx6ul login: root
 +
** password: emac_inc
 +
*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 and SDK version substituted:
 +
<syntaxhighlight lang="text">
 +
source /opt/emac/5.X/environment-setup-armv5e-emac-linux-gnueabi        // update SDK version (found with "ls /opt/emac")
 +
$CC dev-iot6u_mikrobus_demo.c -o dev-iot6u_mikrobus_demo -lgpiod
 +
scp dev-iot6u_mikrobus_demo root@xxx.x.x.xxx:                          // update IP address
 +
</syntaxhighlight>
 +
**This process is explained in the [[Getting_Started_with_the_EMAC_OE_SDK#Target_Board_Compiling|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.
 +
*The "ls" command on the device will show that the executable exists on the device.
  
 
==Usage and Behavior==
 
==Usage and Behavior==
  
 
===Using the Demo===
 
===Using the Demo===
In a terminal session with the iMX6U-112:
+
In a terminal session with the DEV-IOT6U enter the following to run the demo:
<code>
+
<syntaxhighlight lang="text">
./name
+
./dev-iot6u_mikrobus_demo
</code>
+
</syntaxhighlight>
The MikroBus Rotary dial may then be turned, and with each click, the lights with 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 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 terminal window will also display back the number of "clicks" that have been registered by the card</br></br>
 +
Whenever the rotary dial is turned, each "click" produces a pulse that is sent through its encoder A (ENC_A) pin and is registered as an event by the program. The demo program tracks the number of clicks received, incrementing a value that is seen in the terminal. The number of ticks is then used as data to control the number of LEDs that are turned on. In the program, the number of clicks goes through a modulus 128 operation before being output as data for the LEDs. The handling of events and assignment of the data are accomplished in the handle_event() function in the demo .c file.
  
 
==Summary==
 
==Summary==
  
This example is a demonstration of use of the MicroBus Module on the DEV-IOT6U
+
This example is a demonstration of the use of the Mikro Bus on the DEV-IOT6U.
 +
 
 +
===Related Links===
 +
* [[DEV-IOT6U | DEV-IOT6U Hardware Main Page]]
 +
* [[Getting_Started_with_the_DEV-IOT6U|Getting Started with the DEV-IOT6U]]

Latest revision as of 10:29, 15 September 2020

TODO: {{#todo:SEOKWREV (01.02.14-14:09->JG+);(01.02.14-14:30->MD+);(01.02.14-16:15->MG+);(04.04.14-15:40->BS+)|Jgreene|oe 4,oe 5,jg,md,SEOKWREV,mg,bs}}

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)


General Information

Hardware Requirements

  • The DEV-IOT6U Development Kit

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
  • Minicom

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 Minicom
  • Login to the DEV-IOT6U and run command "ifconfig" to retrieve the device's IP Address
    • somimx6ul login: root
    • password: emac_inc
  • 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 and SDK version substituted:
source /opt/emac/5.X/environment-setup-armv5e-emac-linux-gnueabi        // update SDK version (found with "ls /opt/emac")
$CC dev-iot6u_mikrobus_demo.c -o dev-iot6u_mikrobus_demo -lgpiod
scp dev-iot6u_mikrobus_demo root@xxx.x.x.xxx:                           // update IP address
  • Enter the device password: emac_inc
  • The terminal will give a a success message to let you know that the file was securely copied.
  • The "ls" command on the device will show that the executable exists on the device.

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 terminal window will also display back the number of "clicks" that have been registered by the card

Whenever the rotary dial is turned, each "click" produces a pulse that is sent through its encoder A (ENC_A) pin and is registered as an event by the program. The demo program tracks the number of clicks received, incrementing a value that is seen in the terminal. The number of ticks is then used as data to control the number of LEDs that are turned on. In the program, the number of clicks goes through a modulus 128 operation before being output as data for the LEDs. The handling of events and assignment of the data are accomplished in the handle_event() function in the demo .c file.

Summary

This example is a demonstration of the use of the Mikro Bus on the DEV-IOT6U.

Related Links