Electronza
  • Homepage
  • Privacy
    • Privacy Policy
  • Contact
Electronza
  • Homepage
  • Privacy
    • Privacy Policy
  • Contact
Electronza
You are at:Home»Electronics projects»8-bit PIC projects»Microchip Code Configurator: now with support for click boards
Xpress Board with Altitude Click
Xpress Board with Altitude Click

Microchip Code Configurator: now with support for click boards

0
By Electronza on March 9, 2017 8-bit PIC projects, Reviews

MPLAB® Code Configurator (MCC) is a fantastic tool. One can use the intuitive, graphical interface to configure the peripherals and functions of many microcontrollers – over 300 8-bit PIC16 and PIC18 microcontrollers are supported by the current 1.35 version. I like it a lot, and it’s a perfect tool to configure the new generation of PIC microcontrollers with Peripheral Pin Select (PPS) module – one can forget about configuration registers and such. It’s also a major time saver, I can generate the code routines in a matter of minutes.

And now MCC comes with a new benefit: click board™ support. Yes, code libraries for various click boards from MikroElekctronika will be added directly to MCC. There are over 50 click boards that will be added in the next 50 days, and probably more will follow soon.

The initial release of code libraries supports seven click boards:

  • Accel3 click – based on H3LIS331DL from ST
  • Alcohol click – based on the MQ-3 gas sensor
  • Altitude click – with MPL3115A2 sensor
  • CO click –  based on the MQ-7 gas sensor
  • Compass2 click – with an AK8963 3-axis electronic compass
  • Current click – featuring INA196 current shunt monitor, MCP3201 12-bit ADC and MAX6106 voltage reference
  • DiffPressure click – with NXP MPXV5010DP pressure sensor

With some exception related to the particular schematic of the click board (such as the case of Current click), the code libraries are rather specific to the sensor used and can be easily adapted to work in other configurations. A major time-saver when working with the sensors mentioned above.

So, how does it work? Let’s take a look.

I will start with the latest MPLAB X IDE version 3.55, with XC8 version 1.41 and MCC version 3.26.2.

Microchip Code Configurator window
Microchip Code Configurator window

The release notes provide the following installation instructions:

  • Download mikroEClickLibrary_1.0.7.jar from Microchip website.
  • In the MPLAB® X IDE, select Options from the Tools menu
  • Select Plugins tab
  • Click on Add Library
  • Add mikroEClickLibrary_v1.0.7.jar
  • Restart MPLAB® X IDE (it will ask for restart anyway, so save your work before ou begin the installation process)

The same applies to the Foundation Services library, file foundationServicesLibrary-0.1.14.jar.

If the installation process is OK, in the MCC window we should see the new libraries:

Microchip Code Configurator: with Click libraries
Microchip Code Configurator: with Click board libraries

Using the click libraries in MCC

For this walkthrough, I will take one MPLAB Xpress board and one Altitude click, and I will try to see how easy is to work with the provided library.

So, I start a new project in MPLAB X IDE, choosing “Microchip Embedded”, “Standalone project”. Then I select the PIC16F18855 microcontroller. I have selected the PICkit3 tool, and XC8 version 1.41. After giving a name to my project, I started MCC.

I performed all the basic settings I usually do when working with the MPLAB Xpress board, then I’ve added the Altitude click library. The MSSP library needed to perform I2C communication is automatically added. All I have to do is click on the “Generate button”.

MCC: altitude click example
MCC: altitude click example

Simple as that. All the required code is generated by MCC, ready to be used. A quick look into the altitude.c reveals the functions to read temperature and altitude. All I had to do is add the EUSART library, and to redirect STDIO to UART.

Still, I wish to have some pre-made functions to read and write the MPL3115A2 registers, so I can configure the sensor as I wish. The library is quite simple for the given moment.

Even as this is the first time I’m using the library, it took less than 20 minutes to create a working project. Compare this against 1-2 hours of work that were needed to create my own Altitude click example.

Here comes trouble: Alcohol click

After successfully running the Altitude click example, I tried to do the same with the Alcohol click. This click board uses one A/D channel. Well, here is a little issue: the code library assumes a 3.3V reference voltage for ADC. However, some PIC microcontrollers use 5V power (and thus 5V as ADC reference). One has to check this and change 3.3 to 5 inside the code.

MCC, Click libraries and MPLAB Xpress

If you prefer the simpler interface of the MPLAB Xpress, you can still have all the benefits of using the code libraries for MCC. All you need is open MCC, select the code libraries and click the download button. You’ll be able to do the same things that you do in MPLAB X.

Overall, a great addition to the already nice Microchip Code Configurator, and a time-saving option if you work with the sensors on the click boards.

 

MIKROE-1489 MIKROE-2264 Mikroe MIKROE-1396 code Current click Alcohol Click Diff pressure click MikroeElektronika MIKROE-2387 Microchip MIKROE-1586 libraries MPLABX Accel3 click MIKROE-2102 MPLAB CO click MCC MIKROE-1626 Altitude click Compass 2 click
Share. Facebook Twitter Pinterest LinkedIn Tumblr Email

Related Posts

Prettifying preformatted text

Google Cloud IoT Core is being retired on August 16, 2023

Multicomp Pro MP740061 soldering iron

Multicomp Pro soldering iron: a review

Leave A Reply Cancel Reply

Latest posts
January 15, 2023

A pretty text box for Blogger posts

January 15, 2023

New blog section: beginners’ corner

January 15, 2023

Cleaning unused images from blogs hosted on Blogger

Categories
  • Beginners' corner
  • Electronics projects
    • ESP8266
    • Arduino projects
    • IoT
    • 8-bit PIC projects
    • Raspberry PI
    • PIC32 projects
    • Robots
  • Arduino libraries
  • Reviews
    • Tools & equipment
    • Development boards
    • IoT
    • Industrial Arduino
  • Blogger / Blogspot
  • Tutorials
  • Casual stuff
Popular posts
Arduino Uno 4-20mA communication using 4-20mA R click and 4-20mA T click boards from MikroElektronika: MIKROE-1296, MIKROE-1387, Uno Click Shield
August 17, 2016

4-20mA current loop Arduino tutorial Part I: hardware

ECG click on Arduino Uno
December 5, 2016

ECG click: Arduino IDE code examples

Arduino water timer
February 25, 2015

Gardena water timer controller using Arduino Uno

ESP8266 Thing Dev from Sparkfun
May 15, 2019

ESP8266 – running on battery power

Thunderstorm
February 10, 2015

AS3935 lightning detection using Arduino Uno

Copyright © 2023 Teodor Costachioiu

Type above and press Enter to search. Press Esc to cancel.