Review: Flip & Click for PIC32MZ

Teodor Costachioiu
Nov 1, 2017 · 4 min read
Image for post
Image for post

A new development board waits for my review: the Flip & Click for PIC32MZ, the second board in the Flip&Click series by MikroElektronika.

Almost two years have passed since the first ATSAM3X8E-based Flip&Click SAM3X board was released. That particular board was a redesigned Arduino Due, with four mikroBUS sockets on one side, and a typical Arduino Uno layout on the other side. It was the first board designed by MikroElektronika that was meant to be programmed in Arduino IDE.

Unfortunately, the I2C library in Arduino Due is seriously flawed, and some devices that need a stop condition to be sent on the I2C bus are not working with the Flip&Click. That is a software issue; it affects the original Arduino Due boards as well. Strangely though, none cares to fix this, and even now some I2C click boards are not working with the Flip&Click for SAM3X. Of course, one can switch to Python, and install the Zerynth virtual machine. All the I2C click boards work fine with python.

But what happens if we still want to use Arduino?

Today we have a nice alternative: the Flip&Click for PIC32MX keeps the same board layout as the previous Flip& Click for SAM3X, but it comes with a PIC32MZ2048EFH100-I/PF microcontroller, delivering 415 DMIPS /252 MHz. The program memory size is 2048 kb, while the RAM is 512kb. We also have 160kb of auxiliary FLASH memory. Same as the SAM3X board, this Flip&Click uses 3.3V logic, but with the addition of some 5V tolerant pins.

The board can be ordered in two flavors, with Arduino bootloader or with the MikroElektronika bootloader. My version is with the Arduino bootloader.

So, what do we get? Let’s start with the Arduino side first:

Image for post
Image for post

A bright red board, with the PIC32 microcontroller right in the center. Besides the built-in USB port of the PIC32MZ microcontroller, we also find one USB-UART bridge, connected to the UART5 port of the PIC32MZ. The same UART5 port is also used by pins TX0 and RX0 of the Arduino expansion connector.

As a side note, this UART5 port is also used by the Arduino bootloader. When programming the board, one must use the USB port located between C and D sockets.

On the Arduino expansion connector, the I2C bus follows the Arduino Uno R3 layout, with the I2C bus located after pin 13, and GND. Shields that rely on having the I2C bus on pins A4 and A5 will not work, or one must use software I2C (bit banging).

As compared with the SAM3X counterpart, one notices that the ICSP connector is missing. That connector is not only used for programming, but some Arduino shields are taking the SPI lines from it rather than using pins 10–13. One of those shields is the Arduino Ethernet shield. Again, the only thing to do is use software SPI.

mikroBUS sockets

The white side features four click™ sockets, which are just like mini-shields. I don’t know how many click boards are available today, there must be over 350 different boards, and new boards are added every day. I have the feeling that the Arduino side will be left unused, and I can implement many complex projects using just the four mikroBUS sockets.

Image for post
Image for post

One notices that each mikroBUS socket has its own UART port. The first two mikroBUS sockets A and B share the same I2C and SPI ports. The same happens with mikroBUS sockets C and D, which are sharing the same I2C and SPI data lines.

This opens up an interesting possibility: one can use two click boards with the same I2C address, by placing one click board in socket A and the second click board in socket C.

Arduino programming

Programming of the Flip& Click for PIC32MZ board in Arduino IDE is just as easy as working with any third party board. The version 1.4.3 of the chipKIT library offers support for the Flip&Click for PIC32MZ. One has either to use the boards manager, or add the following URL https://raw.githubusercontent.com/chipKIT32/chipKIT-core/master/package_chipkit_index.json in the Preferences window. Then just select the Flip&Click board from the boards manager.

But what about pin definitions? Let’s take a look into https://github.com/chipKIT32/chipKIT-core/blob/master/pic32/variants/FlipNClick_MZ/Board_Defs.h.

PIN_BTN1–46
PIN_BTN2–47

The standard I2C port uses I2C (SCL5/SDA5), corresponding to pins 20/21 on the Arduino connector. Click sockets A and B are using I2C1 (pins 36, 37), while click sockets C and D are using I2C2.

A much nicer drawing is coming in the next few days, after I will check that everything works OK.


Originally published at https://electronza.com on November 1, 2017. Moved to Medium on May 2, 2020.

Electronza

DIY electronics projects and more

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store