What is the mikrobus?
The mikroBUS socket is an open standard advertised as the world’s fastest growing add-on board standard. At the time of this writing, there are over 1772 unique “Click” boards that click into the mikroBUS socket. The socket is featured on boards from over 100 manufacturers with Microchip, Renesas, and NXP among the largest supporters.
The Click boards may be viewed as expansion boards for a wide range of sensors, wireless transceivers, GNSS receivers, displays, and others. A typical application includes a microcontroller base with one or more microbus sockets. An example is shown in Figure 1. Here, the Arduino UNO R4 Minima hosts a Click shield for Arduino UNO, Terminal Click, Digi In Click, and IPD Click. Together, these products provide the foundation for DIY Programmable Logic Controller (PLC).
The mikroBUS is best defined by its supported protocols. For greatest flexibility, it includes SPI (4 pins), I2C (2 pins), and UART (2 pins). It has provisions for analog with an input line and a PWM output line. A reset line is included as well as +3.3 VDC, 5.0 VDC, and ground.
Figure 1: The Terminal Click expansion board is sandwiched between the Arduino UNO shield and the Digi In Click board.
What are the challenges associated with developing and troubleshooting the mikroBUS?
The challenges aren’t so much about the boards, as they are about protocols. It can be challenging to physically connect test equipment to the board’s pins. This is especially true when there are multiple pins such as the 4 lines required for SPI. We could use mini grabbers, however, I find them increasingly challenging to use as the number of connections increases.
Use a Terminal Click board and a logic analyzer
A simple and relatively low-cost solution is to use the Terminal Click board. This solution is shown in Figure 1 with a close-up image of the board in Figure 2. The right angle 0.1-inch headers allow easy connection of a logic analyzer shown in Figure 3.
Figure 2: Image of the MIKROE Terminal Click expansion board with clearly labeled I/O pins.
Figure 3: Image of the MIKRO Terminal Click connected to the Digilent Analog Discovery.
Logical analyzer
A representative logic analyzer screen capture is shown in Figure 4. This was generated by the Digilent Analog Discovery 3 using the WaveForms software as it monitored the MIKROE Digi In Click board.
The upper part of the logic analyzer presents the input lines including CS, MISO, MOSI along with the Digi In’s latch, fault, and ready. The power of the WaveForms software is seen in the SPI MISO and SPI MOSI presentation where the hex values may be read directly. In this example, the Arduino is writing the value of 0x0F to the 0x08 register (MSB set to 1 for write). The 0x07 is a CRC. In the second half, the Arduino is reading the 0x08 register which was previously written to 0x0F. The 0x08 is the CRC.
Bottom line: the SPI transfer between Arduino UNO and MIKROE Digi In Click is functional. We can inspect the packets and analyze the timing.
Figure 4: Screen capture from the Digilent Waveforms logic analyzer showing data transfer over a SPI protocol.
Parting thoughts
The MIKROE Terminal Click board is a must-have tool if you spend time developing and troubleshooting using mikroBUS products. When combined with a logic analyzer, it provides an easy way to diagnose those challenging communication protocols.
Please share your troubleshooting tips in the comments section.
Best wishes,
APDahlen
Related information
Please follow these links to related and useful information:
About this author
Aaron Dahlen, LCDR USCG (Ret.), serves as an application engineer at DigiKey. He has a unique electronics and automation foundation built over a 27-year military career as a technician and engineer which was further enhanced by 12 years of teaching (interwoven). With an MSEE degree from Minnesota State University, Mankato, Dahlen has taught in an ABET-accredited EE program, served as the program coordinator for an EET program, and taught component-level repair to military electronics technicians. Dahlen has returned to his Northern Minnesota home and thoroughly enjoys researching and writing articles such as this.